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



OnPlayerRequestClass & OnPlayerRequestSpawn - Deaglez - 07.10.2012

Hello guyz, I wanted to add some skins. But it is not working! Plz help!

Heres the code:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(gTeam[playerid] == HUMAN)
    {
        GameTextForPlayer(playerid,"~b~Human",2000,6);
        return 0;
    }
}
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    if(gTeam[playerid] == HUMAN)
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Choose your skin", "Skin ID (16)\nSkin ID (110)\nSkin ID (7)", "Choose", "");
        return 1;
    }
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(response)
    {
        switch(dialogid)
        {
            case 1:
            {
                switch(listitem)
                {
                    case 0:
                    {
                        AddPlayerClass(16,1756.4003,-1645.9061,14.3910,84.6941,0,0,0,0,0,0); // Request human 2
                    }
                    case 1:
                    {
                        AddPlayerClass(110,1653.8729,-1659.1406,22.5156,180.0620,0,0,0,0,0,0); // Request human 3
                    }
                    case 2:
                    {
                        AddPlayerClass(7,1359.9155,-1772.3690,13.4787,269.0417,0,0,0,0,0,0); // Request human 4
                    }
                }
            }
        }
    }
    return 1;
}