PHP Code:
public handleJoin(id) {
if(bool:g_PlayerData[id][inTeam] == true) {
return PLUGIN_HANDLED_MAIN;
}
return PLUGIN_CONTINUE;
}
Handles
jointeam and
joinclass commands.
This part in the function is causing me problems:
PHP Code:
g_PlayerData[id][inTeam] = false;
client_cmd(id, "jointeam 1");
client_cmd(id, "joinclass 5");
//g_PlayerData[id][inTeam] = true;
If the boolean is commented out, it works perfectly, when it's not .. it won't work. I have an idea that I must have a longer delay when setting
inTeam to
true again but that would require me to create a task..
Am I doing anything wrong? Is there a better way so I wouldn't have to set a task?