SA-MP Forums Archive
how to make to someone choose an skin - 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: how to make to someone choose an skin (/showthread.php?tid=400812)



how to make to someone choose an skin - diego_p11 - 20.12.2012

Hi, what I need to know is how to make when a player conects apears some skins, and below it is something like

<<< ok >>>

I dunno how is called =P but hope you understand me =)
So please, can someone help me =)


Re: how to make to someone choose an skin - LarzI - 20.12.2012

OnPlayerRequestClass is a callback which calls after OnPlayerConnect, before OnPlayerRequestSpawn. Use that. If you search the wiki you will find lots of tutorials and basics on this subject.


Re: how to make to someone choose an skin - diego_p11 - 20.12.2012

thanks =)


Re: how to make to someone choose an skin - diego_p11 - 20.12.2012

continue without an ideao on how to doit :`(
Please someone help me, or at least give me a link on where i can learn it =D


Re: how to make to someone choose an skin - Nick.D - 20.12.2012

You need to use OnPlayerRequestClass and AddPlayerClass to create classes with different skins. Then when a player connects, they will be able to use the arrows to choose a different class (different skin).


Re: how to make to someone choose an skin - diego_p11 - 20.12.2012

what i have done is:
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 2323.6460, 1283.2372, 97.8800);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    (playerid, 0);
    (playerid, 1);
    (playerid, 2);
    (playerid, 3);
    (playerid, 4);
    (playerid, 5);
    (playerid, 6);
    (playerid, 7);
    (playerid, 8);
    (playerid, 9);
    (playerid, 10);
    (playerid, 11);
    (playerid, 12);
    (playerid, 13);
    (playerid, 14);
    (playerid, 15);
   
    return 1;
}
pawn Код:
public OnGameModeInit()
{
    AddPlayerClass(0,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(1,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(2,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(3,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(4,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(5,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(6,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(7,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(8,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(9,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(10,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(11,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(12,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(13,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(14,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(15,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
Is it right??


Re: how to make to someone choose an skin - Nick.D - 20.12.2012

pawn Код:
public OnGameModeInit()
{
    AddPlayerClass(0,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(1,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(2,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(3,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(4,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(5,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(6,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(7,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(8,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(9,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(10,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(11,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(12,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(13,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(14,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
    AddPlayerClass(15,2169.4314,1408.6198,10.8203,89.3340,0,0,0,0,0,0); // spawn1
This is right, but now under OnPlayerRequestClass...
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
             SetPlayerSkin(playerid, 1);
        }
And so on for each class... unless you just want to use if(classid == 1) and then SetPlayerSkin for each class.


Re: how to make to someone choose an skin - diego_p11 - 20.12.2012

I did that and i got this error:
Код:
C:\Users\Parrilla\Desktop\SAR\gamemodes\SAR.pwn(142) : error 002: only a single statement (or expression) can follow each "case"
EDIT: Fixed


Re: how to make to someone choose an skin - Yiin - 20.12.2012

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0:
        {
             SetPlayerSkin(playerid, 1);
        }
        case 1:
        {
            SetPlayerSkin(playerid, 2);
            print("msg");
        }
    }
    return 1;
}