You need to install the latest version of samp which is 0.3.7.
|
stock IsInvalidSkin(skin)
{
#define MAX_BAD_SKINS 15
new badSkins[MAX_BAD_SKINS] =
{
1, 3, 4, 5, 6, 8, 42, 65, 74, 86,
119, 149, 208, 273, 289
};
for (new i = 0; i < MAX_BAD_SKINS; i++)
{
if (skin == badSkins[i] || skin < 0 || skin >= 300 ) return true;
}
return false;
}
CMD:setskin(playerid, params[])
{
if (PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128], giveplayerid, skinid;
if(sscanf(params, "id", giveplayerid, skinid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /setskin [playerid] [skinid]");
if(IsPlayerConnected(giveplayerid))
{
if(!IsInvalidSkin(skinid))
{
if(GetPlayerSkin(giveplayerid) == skinid)
{
SendClientMessageEx( playerid, COLOR_WHITE, "The player you're trying to change skins of already is using the skin you're trying to set." );
}
else
{
PlayerInfo[giveplayerid][pChar] = skinid;
PlayerInfo[giveplayerid][pModel] = skinid;
format(string, sizeof(string), "Your skin has been changed to ID %d by Administrator %s.", skinid, GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
format(string, sizeof(string), "You have given %s skin ID %d.", GetPlayerNameEx(giveplayerid), skinid);
SendClientMessageEx(playerid, COLOR_WHITE, string);
SetPlayerSkin(giveplayerid, PlayerInfo[giveplayerid][pChar]);
}
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "Invalid skin ID!");
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
stock IsInvalidSkin(skin) { #define MAX_BAD_SKINS 15 new badSkins[MAX_BAD_SKINS] = { 1, 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 273, 289 }; for (new i = 0; i < MAX_BAD_SKINS; i++) { if (skin == badSkins[i] || skin < 0 || skin >= 311 ) return true; } return false; }
stock IsInvalidSkin(skin)
{
#define MAX_BAD_SKINS 15
new badSkins[MAX_BAD_SKINS] =
{
1, 3, 4, 5, 6, 8, 42, 65, 74, 86,
119, 149, 208, 273, 289
};
for (new i = 0; i < MAX_BAD_SKINS; i++)
{
if (skin == badSkins[i] || skin < 0 || skin >= 311 ) return true;
}
return false;
}
Try this:
Код:
stock IsInvalidSkin(skin) { #define MAX_BAD_SKINS 15 new badSkins[MAX_BAD_SKINS] = { 1, 3, 4, 5, 6, 8, 42, 65, 74, 86, 119, 149, 208, 273, 289 }; for (new i = 0; i < MAX_BAD_SKINS; i++) { if (skin == badSkins[i] || skin < 0 || skin >= 311 ) return true; } return false; } |
pawn Код:
|