13.07.2012, 13:12
You're using the wrong function.
Onplayerrequestspawn is called when a player spawn, so it is wrong. The function should be OnPlayerRequestClass, this one is called when the players is selecting their skins. so your command is supposed to be something like this:
By the way, instead of get them by skins, you should do it by classes if you already got it.
Onplayerrequestspawn is called when a player spawn, so it is wrong. The function should be OnPlayerRequestClass, this one is called when the players is selecting their skins. so your command is supposed to be something like this:
pawn Код:
public OnPlayerRequestClass(playerid,classid)
{
if(GetPlayerSkin(playerid) == 280 || GetPlayerSkin(playerid) == 281 || GetPlayerSkin(playerid) == 282 || GetPlayerSkin(playerid) == 283 || GetPlayerSkin(playerid) == 284 || GetPlayerSkin(playerid) == 286 || GetPlayerSkin(playerid) == 288)// if the player has one of these skins.
{
if(GetPlayerScore(playerid) < 100)// if the player has of score less than 100.
{
GameTextForPlayer(playerid,"~r~~h~100~b~score needed!",3000,3); // This message will be displayed.
SendClientMessage(playerid,red,"» You need at least "lgrey"100"lred" score to be a cop!"); // This message will be displayed.
return 0;// And it will return 0; in others word, he won't spawn.
}
}
return 1; // always keep returning true at onplayerrequestclass otherwise he won't spawn.
}