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; |
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;
}
public SetPlayerTeamFromClass(playerid, classid)
{
SetupPlayerForClassSelection(playerid,classid);
gPlayerClass[playerid] = classid;
{
if (classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6 || classid == 7 || classid == 8 || classid == 9 || classid == 10 || classid == 11)
{
gTeam[playerid] = COPS;
GameTextForPlayer(playerid, "~b~POLICE OFFICER", 600, 5);
return 1;
}
else if (classid == 12 )
{
gTeam[playerid] = ARMY;
GameTextForPlayer(playerid, "~b~~h~ARMY", 500, 5);
return 1;
}
else if (classid == 13)
{
gTeam[playerid] = FBI;
GameTextForPlayer(playerid, "~b~FBI", 500, 5);
return 1;
}
else if (classid == 14 || classid == 15 || classid == 16)
{
gTeam[playerid] = CIA;
GameTextForPlayer(playerid, "~w~CIA", 500, 5);
return 1;
}
else if (classid == 17 || classid == 18 || classid == 19 || classid == 20)
{
gTeam[playerid] = MEDICS;
GameTextForPlayer(playerid, "~p~~h~MEDIC", 500, 5);
return 1;
}
else if (classid >= 21)
{
gTeam[playerid] = CIVILIANS;
GameTextForPlayer(playerid, "~w~CIVILIAN", 500, 5);
return 1;
}
return 1;
}
}
//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 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 Код:
|