SKIN QUESTION
#1

How can i do like if player is choosing skin you can say player is underrequestclass and choosing skin. I want if player type 123 so it give player skin id 123 . I don't want to click on arrow for next skin . I have seen this system on other server. You can choose skin by typing skin id. but idk how. Anyone?
Reply
#2

you mean, there would be a command. /skin [id]?
Reply
#3

Nope, I mean you have to type skin number on chat and you will get your skin but it works only when you are under requestclass
Reply
#4

new PlayerUnderRequestClass[MAX_PLAYERS]

OnPlayerText

If(PlayerUnderRequestClass[playerid] == 1)
{
Any number typed here will choose a skin
return 0; // So your numbers will not go into chat
}

OnPlayerRequestClass

PlayerUnderRequestClass[playerid] = 1;
Reply
#5

Under OnPlayerRequestClass, Show a dialog (style INPUTTEXT) > when a player enters the skin id > OnDialogResponse SetPlayerSkin as the inputtext.
Reply
#6

Quote:
Originally Posted by Sime30
Посмотреть сообщение
new PlayerUnderRequestClass[MAX_PLAYERS]

OnPlayerText

If(PlayerUnderRequestClass[playerid] == 1)
{
Any number typed here will choose a skin
return 0; // So your numbers will not go into chat
}

OnPlayerRequestClass

PlayerUnderRequestClass[playerid] = 1;
i want something like this not dialog but explain me more how can i add skin as number?
Reply
#7

pawn Код:
If(PlayerUnderRequestClass[playerid] == 1)
{
     new skinID;
     skinID = strval(text); // set it to the value of the text.
     if(skinID >= 0 && skinID <= 311)
     {
          SetPlayerSkin(playerid, skinID);
     }
     else SendClientMessage(playerid, -1,"Skin IDs only 0-311 !");
     return 0;
}
Reply
#8

It works fine and even i type a number it shows me correct skin but whenever i spawn the skin so it doesn't spawn the skin that i got from number. It spawns me the skin which i choosed from using arrows < > .

here's my class sections:
PHP код:
public SetPlayerTeamFromClass(playeridclassid)
{
    
SetupPlayerForClassSelection(playerid,classid);
    
gPlayerClass[playerid] = classid;
    {
    if (
classid == || classid == || classid == || classid == || classid == || classid == || classid == || classid == || classid == || classid == || classid == 10 || classid == 11)
    {
         
gTeam[playerid] = COPS;
         
GameTextForPlayer(playerid"~b~POLICE OFFICER"6005);
        return 
1;
    }
    else if (
classid == 12 )
    {
         
gTeam[playerid] = ARMY;
         
GameTextForPlayer(playerid"~b~~h~ARMY"5005);
         return 
1;
     }
    else if (
classid == 13)
    {
         
gTeam[playerid] = FBI;
         
GameTextForPlayer(playerid"~b~FBI"5005);
         return 
1;
    }
    else if (
classid == 14 || classid == 15 || classid == 16)
    {
        
gTeam[playerid] = CIA;
            
GameTextForPlayer(playerid"~w~CIA"5005);
        return 
1;
    }
    else if (
classid == 17 || classid == 18 || classid == 19 || classid == 20)
    {
        
gTeam[playerid] = MEDICS;
            
GameTextForPlayer(playerid"~p~~h~MEDIC"5005);
        return 
1;
    }
    else if (
classid >= 21)
    {
        
gTeam[playerid] = CIVILIANS;
            
GameTextForPlayer(playerid"~w~CIVILIAN"5005);
        return 
1;
    }
    return 
1;
    }

Reply
#9

I think it will always spawn you with a skin that was in AddPlayerClass (choosing with arrows). You can let's say send a message to a player after they type a number of a skin ID : "You choose skin ID %d, would you like to use it? Use /useskin to take it!
pawn Код:
//put this for the message after typing the number
new string[128];
format(string,sizeof(string),"You choose skin ID %d, would you like to use it? Use /useskin to take it!",skinID);
SendClientMessge(playerid, -1,string);
//

cmd:useskin(playerid, params[])
{
    if(PlayerUnderRequestClass[playerid] == 1)
    {
          SetPlayerSkin(playerid, skinID);
          PlayerUnderRequestClass[playerid] = 0;
          SpawnPlayer(playerid);
    }
    return 1;
}
Reply
#10

Quote:
Originally Posted by Sime30
Посмотреть сообщение
I think it will always spawn you with a skin that was in AddPlayerClass (choosing with arrows). You can let's say send a message to a player after they type a number of a skin ID : "You choose skin ID %d, would you like to use it? Use /useskin to take it!
pawn Код:
//put this for the message after typing the number
new string[128];
format(string,sizeof(string),"You choose skin ID %d, would you like to use it? Use /useskin to take it!",skinID);
SendClientMessge(playerid, -1,string);
//

cmd:useskin(playerid, params[])
{
    if(PlayerUnderRequestClass[playerid] == 1)
    {
          SetPlayerSkin(playerid, skinID);
          PlayerUnderRequestClass[playerid] = 0;
          SpawnPlayer(playerid);
    }
    return 1;
}
I have seen that in other server. Is there any idea instead of this? also, Anyone else?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)