PDA

View Full Version : automatically spawning player


div
21/06/2018, 03:25 AM
public OnPlayerRequestSpawn(playerid)
{


if(gTeam[playerid] == TEAM_CIVILIAN)
{
if(pInfo[playerid][pXP] <= 14999)
return SendClientMessage(playerid, -1, "{FF0000}[ERROR]{FFFFFF} You do not have sufficient XP to join this class.");
else
{
SpawnPlayer(playerid);
}
}



It sends me a MESSAGE, but also spawns me, i don't want it to spawn unless i meet the requirement..

DerickClark
21/06/2018, 03:38 AM
public OnPlayerRequestSpawn(playerid)
{
if(gTeam[playerid] == TEAM_CIVILIAN && pInfo[playerid][pXP] <= 14999)
{
SendClientMessage(playerid, -1, "{FF0000}[ERROR]{FFFFFF} You do not have sufficient XP to join this class.");
return 0;
}
return 1;
}

div
21/06/2018, 03:44 AM
thanks. +rep