25.03.2013, 01:36
pawn Код:
CMD:giveweapontoy(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
new string[128], giveplayerid, object, slot;
if(sscanf(params, "udd", giveplayerid, slot))
{
SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /giveweapontoy [playerid] [number] [slot]");
SendClientMessageEx(playerid, COLOR_GRAD3, "339 Katana 346 9mm 347 SDPistol");
SendClientMessageEx(playerid, COLOR_GRAD2, "348 Deagle 349 Shotgun 351 Spas");
SendClientMessageEx(playerid, COLOR_GRAD1, "352 Micro Uzi 353 MP5 355 AK");
SendClientMessageEx(playerid, COLOR_GRAD1, "356 M4 358 Sniper");
return 1;
}
if(slot < 0 || slot > 5) return SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid slot, must be between 0 and 5");
if( (object > 335 && object < 335) || (object > 339 && object < 339) || (object > 346 && object < 346) ||
(object > 347 && object < 347) || (object > 348 && object < 348) || (object > 349 && object < 349) || (object > 351 && object < 351) ||
(object && 352 || object && 352) || (object > 353 && object < 353) || (object > 356 && object < 356) || (object > 358 && object < 358)
{
if (IsPlayerConnected(giveplayerid))
{
PlayerToyInfo[giveplayerid][slot][ptModelID] = object;
PlayerToyInfo[giveplayerid][slot][ptBone] = 1;
format(string, sizeof(string), "You have given %s object %d in slot %d", GetPlayerNameEx(giveplayerid), object, slot);
SendClientMessageEx(playerid, COLOR_YELLOW, string);
SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have received a new /toys from an administrator!");
}
}
else
{
SendClientMessageEx(playerid, COLOR_WHITE, "* Invalid object");
}
}
return 1;
}