03.02.2014, 01:20
PHP код:
COMMAND:setskin(playerid, params[])
{
// Setup local variables
new Msg[128], Skin;
// Send the command to all admins so they can see it
SendAdminText(playerid, "/setskin", params);
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 4
if (APlayerData[playerid][PlayerLevel] >= 0)
{
if (sscanf(params, "i", Skin)) SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/setskin <skin-id (0-299)>\"");
else
{
// Check if the player entered a valid skin-id
if ((Skin >= 0) && (Skin <= 299))
{
// Set the skin for the player
SetPlayerSkin(playerid, Skin);
// Let the other player know the reason too
format(Msg, 128, "{808080}Voce Mudou a Sua Skin pela Skin: {FFFFFF}%i", Skin);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
else
SendClientMessage(playerid, 0xFFFFFFFF, "{808080}Skin Invalida. Digite uma Skin de 0 a 299");
}
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}