13.05.2008, 05:22
i need the base of the /Skin command so you say /skin and it give you skin 272, Thanks
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/skin", cmdtext, true) == 0)
return SetPlayerSkin(playerid, 272);
// All your other commands.
return 0;
}
#include <a_samp>
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/skin", cmdtext, true) == 0)
{
if(strlen(cmdtext) < 7)
return SendClientMessage(playerid, 0x33CCFFAA, "USAGE: /skin [skin id]");
new skin = strval(cmdtext[6]);
if(IsInvalidSkin(skin))
return SendClientMessage(playerid, 0x33CCFFAA, "ERROR: Invalid skin id!");
SetPlayerSkin(playerid, skin);
return SendClientMessage(playerid, 0x33CCFFAA, "Your skin id was successfully changed.");
}
// All your other commands.
return 0;
}
IsInvalidSkin(skinid)
{ // Created by Simon
// Checks whether the skinid parsed is crashable or not.
#define MAX_BAD_SKINS 14
new badSkins[MAX_BAD_SKINS] = {
3, 4, 5, 6, 8, 42, 65, 74, 86,
119, 149, 208, 273, 289
};
for (new i = 0; i < MAX_BAD_SKINS; i++) {
if (skinid == badSkins[i]) return true;
}
return false;
}