SA-MP Forums Archive
OnPlayerRequestClass - 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: OnPlayerRequestClass (/showthread.php?tid=656033)



OnPlayerRequestClass - Thanks - 05.07.2018

Hi I've making this for classes gametext! but It's not work!

PHP код:
public OnPlayerRequestClass(playeridclassid)
{
    if(
classid == 0)
    {
        if(
gTeam[playerid] == FBII(GetPlayerSkin(playerid)))
        {
            
GameTextForPlayer(playerid,"~B~F.B.I",3000,5); // This will show up an Text , when you select your class
            
return 1;
        }
    }
    else if(
classid == 1)
    {
        if(
gTeam[playerid] == Army(GetPlayerSkin(playerid)))
        {
            
GameTextForPlayer(playerid,"~p~A.R.M.Y",3000,5);
            return 
1;
        }
    }
    return 
1;

This message showing for ALL Classes!! I just want for F.B.I + Army

PHP код:
stock FBII(skinid)
{
    switch(
skinid)
    {
        case 
286: return 1;
        default: return 
0;
    }
    return 
1;
}
stock Army(skinid)
{
    switch(
skinid)
    {
        case 
287: return 1;
        default: return 
0;
    }
    return 
1;




Re: OnPlayerRequestClass - Thanks - 05.07.2018

soooooooooooooooooo


Re: OnPlayerRequestClass - Sew_Sumi - 05.07.2018

24 hour bumps only, as per the forum rules you agreed that you understood when you signed up.


Why are you using the classid, then using the gTeam?

If it's spawn selection, then the players team should almost not be set because if they're in the select screen, and someone else uses team chat, the person who is in the selection will likely see it if you don't check correctly.


Just use the classids alone, as it is for selection, nothing else. gTeam and anything player specific should be set after they select to spawn.