SA-MP Forums Archive
Restriction on player spawn request - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Restriction on player spawn request (/showthread.php?tid=647556)



Restriction on player spawn request - Oshery - 06.01.2018

When I put a restriction on player request spawn for the FBI class I get the error message but I'm still able to spawn as FBI.
Код:
public OnPlayerRequestSpawn(playerid)
{
    if(gTeam[playerid] == FBI && GetPlayerCop(playerid, pInfo[playerid][Cop]) < 100) return SendClientMessage(playerid, COLOR_RED,"You need 100 cop skills to spawn as F.B.I ");
    return 1;
}
Код:
GetPlayerCop(playerid, score)
{
	GetPlayerScore(playerid, pInfo[playerid][Cop]);
	return 1;
}



Re: Restriction on player spawn request - m4karow - 06.01.2018

the sendclientmessage function returning with 1... you need to return with 0.

public OnPlayerRequestSpawn(playerid)
{
if(gTeam[playerid] == FBI && GetPlayerCop(playerid, pInfo[playerid][Cop]) < 100) return SendClientMessage(playerid, COLOR_RED,"You need 100 cop skills to spawn as F.B.I "), 0;
return 1;
}


Re: Restriction on player spawn request - Oshery - 06.01.2018

Thanks for that, +1 rep