Weapon help
#5

Well for example if you want to make a give weapon cmd you can do something like this

Let's say that your command is /givewep <playerid> <weaponid>

We will use weaponid to see what the player inserted, of course we'll use sscanf for that which you can find here: https://sampwiki.blast.hk/wiki/Fast_Commands

PHP код:
if (sscanf(params"ud"idweaponid)) SendClientMessage(playerid0xFF0000AA"Usage: \"/givewep <playerid/partname> <weaponid>\""); 
define id and weaponid to avoid any errors

And you can check if the id that the player inserted is valid by doing this

if(weaponid >=1 && weaponid <= 46)
{
code here
}
else
{
code here if he inserted an invalid it
}
Reply


Messages In This Thread
Weapon help - by silverms - 14.04.2017, 17:33
Re: Weapon help - by AndreiWow - 14.04.2017, 17:40
Re: Weapon help - by silverms - 14.04.2017, 17:51
Re: Weapon help - by ISmokezU - 14.04.2017, 18:01
Re: Weapon help - by AndreiWow - 14.04.2017, 18:06
Re: Weapon help - by LEOTorres - 14.04.2017, 18:11

Forum Jump:


Users browsing this thread: 1 Guest(s)