25.03.2013, 02:59
Код:
CMD:giveweapontoy(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1337) { new string[128], giveplayerid, object, slot; if(sscanf(params, "udd", giveplayerid, object, slot)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /giveweapontoy [playerid] [number] [slot]"); SendClientMessageEx(playerid, COLOR_WHITE, "339 Katana 346 9mm 347 SDPistol"); SendClientMessageEx(playerid, COLOR_WHITE, "348 Deagle 349 Shotgun 351 Spas"); SendClientMessageEx(playerid, COLOR_WHITE, "352 Micro Uzi 353 MP5 355 AK"); SendClientMessageEx(playerid, COLOR_WHITE, "356 M4 358 Sniper"); 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 weapon toy %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; }
Код:
USAGE: /giveweapontoy [playerid] [number] [slot]
Код:
USAGE: /giveweapontoy [playerid] [number] [slot] 339 Katana 346 9mm 347 SDPistol 348 Deagle 349 Shotgun 351 Spas 352 Micro Uzi 353 MP5 355 AK 356 M4 358 Sniper