CMD:changeskin(playerid, params[])
{
new skinid;
new string[160];
if(sscanf(params, "d", skinid)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /changeskin [id]");
if(skinid == 268) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are Not Allowed To Use This Skin!");
if(skinid < 0 || skinid > 299) return SendClientMessage(playerid, COLOR_RED, "ERROR: Invalid Skin Model! (0-299)");
SetPlayerSkin(playerid, skinid);
format(string, sizeof(string), "[SYSTEM]: %s Has Changed His Skin To id %d", GetName(playerid), skinid);
SendClientMessageToAll(COLOR_PURPLE, string);
return 1;
}
new skin[MAX_PLAYERS];
//Your command
{
skin[playerid]=GetPlayerSkin(playerid);
return 1;
}
OnPlayerSpawn(playerid)
{
SetPlayerSkin(playerid,skin[playerid]);
return 1;
}
Set a variable for the skin and save the skin when the player use the command and load it when he spawns.
Example: pawn Код:
|
If the player wants to change skin there is another way I can suggest click f4 and it will kill him and he can choose skin again just saying...
|
If the player wants to change skin there is another way I can suggest click f4 and it will kill him and he can choose skin again just saying...
|
CMD ![]() { new skinid, msg[80]; if(sscanf(params, "d", skinid))return SendClientMessage(playerid, COLOR_GREY, "USAGE: /skin [skinid]"); else if(!IsValidSkin(skinid)) return SendClientMessage(playerid, COLOR_GREY, "Invalid Skin ID!"); else if(IsValidSkin(skinid)) { SetPlayerSkin(playerid, skinid); format(msg, sizeof(msg), "You have changed your skin to skin ID %i.", skinid); SendClientMessage(playerid, COLOR_GREY, msg); } return 1; } |
CMD:setskin(playerid, params[])
{
new level, id;
new skinid;
new string[128];
if(sscanf(params, "dd", id, level)) return SendClientMessage(playerid, WHITE, "{FF0000}USAGE:{FFFFFF} /setskin [playerid] [skin id]");
{
if(skinid == 268) return SendClientMessage(playerid, COLOR_RED, "ERROR: You are Not Allowed To Use This Skin!");
if(level > 299 || level < 1) return SendClientMessage(playerid, GREY, "Invalid skin ID!");
SetPlayerSkin(id, level);
format(string, sizeof(string), "[SYSTEM]: %s Has Changed His Skin To id %d", GetName(playerid), skinid);
SendClientMessageToAll(COLOR_PURPLE, string);
}
return 1;
}