SA-MP Forums Archive
[Help] Class Selection Textraw Click - 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: [Help] Class Selection Textraw Click (/showthread.php?tid=477381)



[Help] Class Selection Textraw Click - Alex_Obando - 23.11.2013

Hey!
Can somebody link me to this or either help me?

What im trying to do i've seen it on different servers.

When you are onRequestClass
Teams appear with different characters on top, so when you either click the skin or the text it spawns you with the choosen team.


Re: [Help] Class Selection Textraw Click - Spydah - 23.11.2013

Firstly use the search button first to see if you can find anything like this.

pawn Код:
public OnGameModeInit()
{
    AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); //Civilian - classid = 0
    AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); //Mafia - classid = 1
    return 1;
}
public OnPlayerRequestClass(playerid,classid)
{
     //Create the TextDraw on OnPlayerConnect.
    //---
    if(classid == 0)
    {
        TextDrawSetString(TextDrawName, "Civilian");
    }
    else if(classid == 1)
    {
        TextDrawSetString(TextDrawName, "Mafia");
    }
    TextDrawShowForPlayer(playerid, TextDrawName);
    return 1;
}
public OnPlayerRequestSpawn(playerid)
{
    TextDrawHideForPlayer(playerid, TextDrawName);
    return 1;
}