16.12.2014, 14:51
What's wrong with this command ?
Errors :
Код:
CMD:givegun(playerid, params[]) { new string[128], target, gun; if(APlayerData[playerid][PlayerLevel] >= 5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!"); if(sscanf(params, "ud", target, gun)) return SendClientMessage(playerid, COLOR_GREY, "Usage: /givegun <playerid> <gun>"); if(gun < 1 || gun > 47) return SendClientMessage(playerid, COLOR_GREY, "Don't go below 1 or above 47."); if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_GREY, "User is not connected!"); if(gun != 21) { GivePlayerWeapon(target, gun, 50000); //Your version would be GivePlayerValidWeapon, this also may be causing issues. format(string, sizeof(string), "Admin %s has given you a weapon.", PlayerName(playerid)); SendClientMessage(target, COLOR_YELLOW, string); format(string, sizeof(string), "You have given %s a weapon.", PlayerName(target)); SendClientMessage(playerid, COLOR_YELLOW, string); } return 1; }
Код:
(13824) : error 012: invalid function call, not a valid address (13824) : warning 215: expression has no effect (13824) : error 001: expected token: ";", but found ")" (13824) : error 029: invalid expression, assumed zero (13824) : fatal error 107: too many error messages on one line