02.10.2015, 13:49
I can show you my skin cmd code.
I don't exactly understand your code lol
I don't exactly understand your code lol
PHP код:
CMD:setskin(playerid, params[])
{
new targetplayer, skinid;
if(sscanf(params, "ui", targetplayer, skinid)) return SendClientMessage(playerid, COLOR_ORANGE, "Usage: /setskin [ID] [skinid]");
if(skinid < 0 || skinid > 311) return SendClientMessage(playerid, COLOR_RED, "Error: Available skinids 0 - 311");
if(skinid == 74) return SendClientMessage(playerid, COLOR_RED, "Error: This skinid is unavailable!");
if(!IsPlayerConnected(targetplayer)) return SendClientMessage(playerid, COLOR_RED, "Error: Player is not connected!");
new string[64], pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
SetPlayerSkin(targetplayer, skinid);
format(string, sizeof string, "Your skin has been set to %i by an admin.", skinid);
SendClientMessage(targetplayer, COLOR_GREEN, string);
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
GetPlayerName(targetplayer, pName2, MAX_PLAYER_NAME);
format(string, sizeof string, "You have set %s's skinid to %i.", pName2, skinid);
printf("[SETSKIN] %s has set the skin of %s to %i", pName, pName2, skinid);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}