Quote:
Originally Posted by dice7
what are the lines 781 and 782
nvm, found it
pawn Код:
if(!strlen(Weapon)) return SendClientMessage(playerid, AdministrationError, "USAGE: /weapon [PlayerID] [WeaponID]"); if(!IsNumeric(Weapon)) return SendClientMessage(playerid, AdministrationError, "Error: Invalid WeaponID");
strlen and IsNumeric are functions for strings and Weapon is an integer
You don't need this
pawn Код:
if(!strlen(Weapon)) return SendClientMessage(playerid, AdministrationError, "USAGE: /weapon [PlayerID] [WeaponID]");
sscanf has its inbuilt error check to see if the string typed by the player can be deformated to fit the variables added as the third argument
pawn Код:
if(!IsNumeric(Weapon)) return SendClientMessage(playerid, AdministrationError, "Error: Invalid WeaponID");
Should be
pawn Код:
if(Weapon < 0 || Weapon > 46)return SendClientMessage(playerid, AdministrationError, "Error: Invalid WeaponID");
because valid weapon ids are between 0 and 46
https://sampwiki.blast.hk/wiki/Weapons
|
Thanks man done the trick.
Thanks, Chris.