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(playeridDIALOG_STYLE_LISTDIALOG_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(playeridpRandomSpawns[rand][0], pRandomSpawns[rand][1], pRandomSpawns[rand][2]);
                 
SetPlayerFacingAngle(playerid,pRandomSpawns[rand][3]);
                
SetCameraBehindPlayer(playerid);
                
SetPlayerColor(playerid0x4467F2AA);
         }
    }
    
//Trucker spawn
    
switch(GetPlayerSkin(playerid))
    {
        case 
7:
            {
                 new 
rand random(sizeof(tRandomSpawns));
                 
SetPlayerPos(playeridtRandomSpawns[rand][0], tRandomSpawns[rand][1], tRandomSpawns[rand][2]);
                 
SetPlayerFacingAngle(playerid,tRandomSpawns[rand][3]);
               
SetCameraBehindPlayer(playerid);
               
SetPlayerColor(playerid0xF74D4DAA);
         }
    }
    return 
1;

And in OneGameModeInit:

PHP код:
public OnGameModeInit()
{
    
// Don't use these lines if it's a filterscript
    
SetGameModeText("Blank Script");
    
AddPlayerClass(611958.37831343.157215.3746269.1425000000);
    
AddPlayerClass(71958.37831343.157215.3746269.1425000000);
    return 
1;

Thank you for reading

Mickos0087
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)