ForceClassSelection gets called again somehow
#1

After a player goes off admin duty the script forces his class selection, and if he dies he is prompted into Class Selection again, this happens after the event too...
Код:
.
.
.
case 1: // <------- if hes on duty
{
ForceClassSelection(playerid);
print("force class - command");
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
TPLI[playerid][aduty] = 0;
}
I tried debugging, it gets called normally, it doesn't call it twice...
Reply
#2

pawn Код:
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
using TogglePlayerSpectating(playerid, true); in OnPlayerRequestClass will call the callback twice i really don't know why yet
Reply
#3

Quote:
Originally Posted by DaTa[X]
Посмотреть сообщение
pawn Код:
TogglePlayerSpectating(playerid, true);
TogglePlayerSpectating(playerid, false);
using TogglePlayerSpectating(playerid, true); in OnPlayerRequestClass will call the callback twice i really don't know why yet
TogglePlayerSpectating false will call OnPlayerSpawn.
Reply
#4

Quote:
Originally Posted by ******
Посмотреть сообщение
The problem is that the player doesn't die, you just return them. ForceClassSelection only resets when you DIE, not when you select a new class. Just add some logic to OnPlayerRequestClass to detect this double call, and spawn them if so.
Thanks for the info, I did that, I really hoped I didn't have to do that, but yeah, works normal now...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)