how to make to someone choose an skin
#1

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 =)
Reply
#2

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.
Reply
#3

thanks =)
Reply
#4

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
Reply
#5

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).
Reply
#6

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??
Reply
#7

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.
Reply
#8

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
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)