Open eduzappa18 opened 9 months ago
you dont need a event for this, if you add a variable to the player setting the original team he was and then keep checking if the actual team have changed to a different team as the variabel, you know when the player have changed team.
you dont need a event for this…
I don't need it. I want it
This is the same reply you have say to dragon about the feature he whanted:
No need for a new function, you can do this via script:
main:
while (1) {
waitframe
for (local.i = 1; local.i <= $player.size; local.i++) {
local.player = $player[local.i];
if(local.player.original_team == NIL)
{
local.player.original_team = local.player.dmteam
}
if(local.player.dmteam != local.player.original_team)
{
stuffsrv("say Player " + local.player.netname + " have changed team from " + local.player.original_team + " to " + local.player.dmteam)
local.player.original_team = local.player.dmteam
}
}
}
end
My reply to Dragon was a one line thing using the exact rcon command he was refering to, and I thought he didn't know that it could be used along with stuffsrv. Did that offend you or something?
And the whole point of having events is to prevent the use of while loops and workarounds like that.
But anyways, thanks for your help, doublekill
My feature request stays up
The while loops exist on the scripting, are meant to be used and we know a while loop doesnt do nothing to the performance of the server if his done properly.
What tilts me, is you prefer wasting time of RyBack on creating the event, instead you easly make this by script.
Sayng to avoid a while loop is bad escuse.
Other important thing is we should suggest features where theres no possible way by scripting so that feature are worth the time of RyBack and we know time is very valuable when you dont have pratacly him for the things you whant to do.
No worries double, I usually do the highest priority feature requests/bugfixes first. Thank you for considering the time factor for me 😄. Yes this can be done with loops, but IMO events are a cleaner way to do it. I already considered implementing it before releasing v1.2.0 in NF but there were some hurdles.
Basically an event triggered when a player switch teams. (I think this even already exist in openmohaa. Not sure if it really works tho)
with
local.oldteam
andlocal.newteam
returning the same possible values aslocal.player.dmteam
allies
,axis
,spectator
orfreeforall
(no idea if freeforall even works, never seen it returning that)