Little help with skin choose when player spawn
#1

Hey I need help with one little thing,

I want to make a server that when a player press spawn, the player didnt have choosen a skin, but when they press spawn he must be see a DIALOG_STYLE_LIST,
That he can choose this skins:

Skin Pilot (ID:61)
Skin Trucker (ID:7)

And when they use skin Pilot he must be spawn as a pilot with skin ID 61, same as when a player use skin Trucker he must be spawn as a trucker with the skin ID 7.

My question is, how can I make that? Do I need be add the skins in OnGameModeInit (AddPlayerClass)
Or not?

So yes or no how can I make that what I want,

This is now what I have in OnPlayerSpawn:

PHP код:
public OnPlayerSpawn(playerid)
{
    
ShowPlayerDialog(playerid, DIALOG_STYLE_LIST, DIALOG_STYLE_MSGBOX, "Which role would you like to play as?", "~b~Pilot\n~r~Trucker", "Select", "");
    
SetPlayerInterior(playerid,0);
    
//Pilot spawn
    
switch(GetPlayerSkin(playerid))
    {
        case 
61:
            {
                 new 
rand = random(sizeof(pRandomSpawns));
                 
SetPlayerPos(playerid, pRandomSpawns[rand][0], pRandomSpawns[rand][1], pRandomSpawns[rand][2]);
                 
SetPlayerFacingAngle(playerid,pRandomSpawns[rand][3]);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerColor(playerid, 0x4467F2AA);
         }
    }
    
//Trucker spawn
    
switch(GetPlayerSkin(playerid))
    {
        case 
7:
            {
                 new 
rand = random(sizeof(tRandomSpawns));
                 
SetPlayerPos(playerid, tRandomSpawns[rand][0], tRandomSpawns[rand][1], tRandomSpawns[rand][2]);
                 
SetPlayerFacingAngle(playerid,tRandomSpawns[rand][3]);
               
SetCameraBehindPlayer(playerid);
               
SetPlayerColor(playerid, 0xF74D4DAA);
         }
    }
    return 
1;
} 
And in OneGameModeInit:

PHP код:
public OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("Blank Script");
    
AddPlayerClass(61, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    
AddPlayerClass(7, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 
1;
} 
Thank you for reading

Mickos0087
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)