30.05.2016, 23:07
Код:
CMD:givegun(playerid, params[]) { if(Player[playerid][pAdmin] < 4) return SCM(pid, ADMIN_COLOR, ADMIN_MESSAGE); new para1, gun, ammo; new sendername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME], string[128]; if(sscanf(params, "uii", para1, gun)) { SendClientMessage(pid, COLOR_WHITE, "{00E6FF}USAGE:{FFFFFF}/givegun [PlayerID/PartOfName] [WeaponID] [Bullets]"); SendClientMessage(pid, COLOR_WHITE, "Knuckles: 1 || Golf Club: 2 || Nightstick: 3 || Knife: 4: || Bat: 5 "); SendClientMessage(pid, COLOR_WHITE, "Shovel: 6 || Katana: 8 || Chainsaw: 9 || Purple Dildo: 10 || Dildo: 11"); SendClientMessage(pid, COLOR_WHITE, "Flowers: 14 || Cane: 15 || Grenade: 16 || Teargas: 17 || Molotov: 18"); SendClientMessage(pid, COLOR_WHITE, "Deagle: 24 || Shotgun: 25 || Sawedoff: 26 || Combat SGun: 27 || Uzi: 28"); SendClientMessage(pid, COLOR_WHITE, "AK47: 30 || M4: 31 || Rifle: 33 || Sniper: 34 || Flamethrower: 37"); SendClientMessage(pid, COLOR_WHITE, "Satchel: 39 || Spray: 41 || Extinguisher: 42 || Camera: 43 || Parachute: 46"); return 1; } return 1; if (para1 == INVALID_PLAYER_ID) return SCM(pid, -1, "Invalid player."); if(!( 1 <= gun <= 46 )) return SCM(pid, -1, "It must be between 1-46!"); if(!( 1 <= ammo <= 999 )) return SCM(pid, -1, "It must be between 1-999!"); switch (gun) { case 1: GivePlayerWeapon(pid, 1, ammo); case 2: GivePlayerWeapon(pid, 2, ammo); case 3: GivePlayerWeapon(pid, 3, ammo); case 4: GivePlayerWeapon(pid, 4, ammo); case 5: GivePlayerWeapon(pid, 5, ammo); case 6: GivePlayerWeapon(pid, 6, ammo); case 8: GivePlayerWeapon(pid, 8, ammo); case 9: GivePlayerWeapon(pid, 9, ammo); case 10: GivePlayerWeapon(pid, 10, ammo); case 11: GivePlayerWeapon(pid, 11, ammo); case 14: GivePlayerWeapon(pid, 14, ammo); case 15: GivePlayerWeapon(pid, 15, ammo); case 16: GivePlayerWeapon(pid, 16, ammo); case 17: GivePlayerWeapon(pid, 17, ammo); case 18: GivePlayerWeapon(pid, 18, ammo); case 24: GivePlayerWeapon(pid, 24, ammo); case 25: GivePlayerWeapon(pid, 25, ammo); case 26: GivePlayerWeapon(pid, 26, ammo); case 27: GivePlayerWeapon(pid, 27, ammo); case 28: GivePlayerWeapon(pid, 28, ammo); case 30: GivePlayerWeapon(pid, 30, ammo); case 31: GivePlayerWeapon(pid, 31, ammo); case 33: GivePlayerWeapon(pid, 33, ammo); case 34: GivePlayerWeapon(pid, 34, ammo); case 37: GivePlayerWeapon(pid, 37, ammo); case 39: GivePlayerWeapon(pid, 39, ammo); case 41: GivePlayerWeapon(pid, 41, ammo); case 42: GivePlayerWeapon(pid, 42, ammo); case 46: GivePlayerWeapon(pid, 43, ammo); } format(string, sizeof(string), " You have given %s weapon id %d with %d ammo.", giveplayer, gun, ammo); SCM(pid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), " You have been granted weapon %d with %d ammo by %s", gun, ammo, sendername); SCM(para1, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "{D11515}[AdmWarning]: {FF9203}%s {FFFFFF}has given {FF9203}%s {FFFFFF}weapon id {FF9203}%d with {FF9203} %d.", sendername, giveplayer, gun, ammo); SendAdminMessage(-1, string); } return 1; }
Код:
GM.pwn(485) : warning 225: unreachable code GM.pwn(524) : warning 217: loose indentation GM.pwn(530) : warning 209: function "cmd_givegun" should return a value GM.pwn(531) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase