SA-MP Forums Archive
must have 300 score to spawn - 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: must have 300 score to spawn (/showthread.php?tid=533968)



must have 300 score to spawn - YanLanger - 27.08.2014

How can i make in homless team

You must have 300 Score To Choose this team.


Re: must have 300 score to spawn - Hwang - 27.08.2014

OnPlayerRequestClass:
pawn Код:
if(GetPlayerScore(playerid) < 300) return SendClientMessage(playerid,-1,"You must have 300 Score To Choose this team."), 0;



Re: must have 300 score to spawn - YanLanger - 27.08.2014

anyone else?


Re: must have 300 score to spawn - Lordzy - 27.08.2014

You should either set player's classid from OnPlayerRequestClass and then check if the classid of player is equal to your special class under OnPlayerRequestSpawn, to do the score checks. Or, use GetPlayerSkin. Here's an example:

pawn Код:
new
    p_ClassID[MAX_PLAYERS];
   
public OnPlayerRequestClass(playerid, classid)
{
    p_ClassID[playerid] = classid;
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    if(p_ClassID[playerid] == 5) //Assuming that 5th class is so special
    {
        if(GetPlayerScore(playerid) < 300) return !SendClientMessage(playerid, 0xFF0000FF, "You must have at least 300 score to choose this class."); //! was used to return 0 after SCM function.
    }
    return 1;
}