OnPlayerRequestSpawn help
#9

Quote:
Originally Posted by nicholasramdhan
Посмотреть сообщение
The message is never received
Then one of the following lines are not 'true':
Код:
if(gTeam[playerid] == TEAM_CIA)

if(strfind(name, "[CIA]", true) != 0)

if(gTeam[playerid] == TEAM_ED)

if(strfind(name, "[ED]", true) != 0)
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).
Код:
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;
}
After trying this code show us your log after you've been through class selection and have been (or have not been) spawned.
Reply


Messages In This Thread
OnPlayerRequestSpawn help - by nicholasramdhan - 14.04.2015, 22:13
Re: OnPlayerRequestSpawn help - by fuckingcruse - 15.04.2015, 07:50
Re: OnPlayerRequestSpawn help - by nicholasramdhan - 15.04.2015, 21:14
Re: OnPlayerRequestSpawn help - by Crayder - 15.04.2015, 21:18
Re: OnPlayerRequestSpawn help - by nicholasramdhan - 16.04.2015, 01:19
Re: OnPlayerRequestSpawn help - by Crayder - 16.04.2015, 02:37
Re: OnPlayerRequestSpawn help - by nicholasramdhan - 18.04.2015, 16:31
Re: OnPlayerRequestSpawn help - by Azula - 18.04.2015, 17:27
Re: OnPlayerRequestSpawn help - by Crayder - 18.04.2015, 18:49

Forum Jump:


Users browsing this thread: 2 Guest(s)