18.04.2015, 18:49
Then one of the following lines are not 'true':
So, 1st show us where you set gTeam to the players team. 2nd, just make sure the name does in fact have those characters.
Lastly, try adding some debugging messages (try the code below).
After trying this code show us your log after you've been through class selection and have been (or have not been) spawned.
Код:
if(gTeam[playerid] == TEAM_CIA) if(strfind(name, "[CIA]", true) != 0) if(gTeam[playerid] == TEAM_ED) if(strfind(name, "[ED]", true) != 0)
Lastly, try adding some debugging messages (try the code below).
Код:
public OnPlayerRequestSpawn(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); printf("OnPlayerRequestSpawn called for: [%i]%s.", playerid, name); if(gTeam[playerid] == TEAM_CIA) { printf("Player IS in the CIA team: [%i]%s.", playerid, name); if(strfind(name, "[CIA]", true) != 0) { printf("Player's name DOES contain '[CIA]': [%i]%s.", playerid, name); SendClientMessage(playerid,0xFF8000C8,"You are not a member of the Central Intelligence Agency! Choose another class."); ForceClassSelection(playerid); return 0; } } if(gTeam[playerid] == TEAM_ED) { printf("Player IS in the ED team: [%i]%s.", playerid, name); if(strfind(name, "[ED]", true) != 0) { printf("Player's name DOES contain '[ED]': [%i]%s.", playerid, name); SendClientMessage(playerid,0xFF8000C8,"You are not a member of the Electric Drifters! Choose another class."); ForceClassSelection(playerid); return 0; } } printf("Spawning Player: [%i]%s.", playerid, name); return 1; }