24.10.2012, 17:14
PHP код:
new RestrictedSkins[2][1] =//we are setting the locked skins (by placing them in one array)
{
{294},
{189} //for examples
};
CMD:changeskin(playerid, params[])
{
new rSkins = sizeof(RestrictedSkins), str[18];
if(sscanf(params, "d", params)) return SendClientMessage(playerid, -1, "Usage: /changeskin [skinid]");//usage message(if he misused the command)
if(strval(params) == RestrictedSkins[rSkins][0])//if locked skins it will return a message
{
return SendClientMessage(playerid, -1, "The skin id you typed is restricted, choose another one");
}
else {//else if not a locked one
SetPlayerSkin(playerid, strval(params));
format(str, 18, "Your Skin id: %d", strval(params));
SendClientMessage(playerid, -1, str);
}
return 1;
}