SA-MP Forums Archive
HELP - Add player class with tag/name - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: HELP - Add player class with tag/name (/showthread.php?tid=275071)



HELP - Add player class with tag/name - Lak[S]hYa - 08.08.2011

i know addplayerclass cmd only !!!

help guys...how can i addplayerclass with name when players selecting a class... !!!

like this----


Re: HELP - Add player class with tag/name - zombieking - 08.08.2011

What? Explain better


Re: HELP - Add player class with tag/name - Godhimself - 08.08.2011

Define the classes like so:

pawn Код:
#define CLASS_ONE
#define CLASS_TWO
Make a stock that seperates the team from AddPlayerClass, So the 1st AddPlayerClass will be 0, the 2nd 1 and so on.

pawn Код:
stock OnPlayerSelectClass(playerid, classid);
{
    switch(classid)
    {
        case 0:
        {
             gTeam[playerid] = CLASS_ONE;
        }    
        case 1:
        {
             gTeam[playerid] = CLASS_TWO;
        }
    }
}
And place the function under OnPlayerRequestClass(playerid, classid) like so:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    OnPlayerSelectClass(playerid, classid);
    //other code here
    return 1;
}
Should work.

EDIT: typos

EDIT2: typo


Re: HELP - Add player class with tag/name - Lak[S]hYa - 08.08.2011

Thx Bro .... but check the img i want like that!!!