30.01.2019, 09:15
Thanks, did in this way and it's working now.
As you can see, i restriced some wep ids to be given, but i can still do /fight 50 or even /fight 500 ...
How to add your sanity checks?
pawn Код:
CMD:fight(playerid, params[])
{
new wep_id, string[100], gunname[32];
if(sscanf(params, "d", wep_id)) return SCM(playerid, COLOR_GREEN, "* [USAGE]: /fight [weapon id]");
GetWeaponName(wep_id, gunname, sizeof(gunname));
switch(wep_id)
{
case 0, 1, 14, 17, 19, 20, 21, 40, 43, 44, 45, 46: return SCM(playerid, COLOR_RED, "* Invalid weapon ID.");
}
foreach(new i : Player)
{
GivePlayerWeapon(i, wep_id, 9999);
format(string, sizeof(string), "~g~%s ~w~fight!", gunname);
GameTextForPlayer(i, string, 3000, 4);
}
return 1;
}
How to add your sanity checks?