simple, but looks better than / skins [id] ...
And is modern, but includes this function: for skins invalid (no cart)
try to include this:
Код:
IsInvalidSkin(skinid)
{
#define MAX_BAD_SKINS 22
new InSkin[MAX_BAD_SKINS] = {
0, 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 == InSkin[i]) return true;}
return 0;
}
and here's a command that function including (without dialogue)
Код:
if (strcmp(cmd, "/skin", true) == 0 )
{
new skin[256];
skin = strtok(cmdtext, idx);
if (!strlen(skin))
{
SendClientMessage(playerid, COLOR_RED, "Use: /skin [skinid]");
return 1;
}
new newskin = strval(skin);
if ((newskin < 0) || (newskin > 299) || IsInvalidSkin(newskin)) {
SendClientMessage(playerid, COLOR_RED, "Server: This skin does not exist!");
return 1;
}
if (GetPlayerMoney(playerid) >= 0)
{
SetPlayerSkin(playerid, newskin);
GivePlayerMoney(playerid,-0);
format(string, 128, "Server: Skin changed to the id %d, have fun", newskin);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You can not change skin");
}
return 1;
}
bye
... sorry for my bad English ..