SA-MP Forums Archive
Creat /givegun command(zcmd) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Creat /givegun command(zcmd) (/showthread.php?tid=280520)



Creat /givegun command(zcmd) - ServerScripter - 01.09.2011

hi , i want to creat /givegun command to give a gun to a player Near Me ... how to do it?


Re: Creat /givegun command(zcmd) - Jafet_Macario - 01.09.2011

PHP код:
CMD:givegun(playeridparams[])
{
    new 
idgunammo;
    if(
sscanf(params,"uii"idgunammo)) return SendClientMessage(playerid, -1,"USAGE: /givegun [playerid/partofname] [gunid] [ammo]");
    if(
gun 47 || gun 1) return SendClientMessage(playerid, -1,"GUN ID'S: 1-47");
    if(
ammo 999 || ammo 1) return SendClientMessage(playerid, -1,"Ammo 1-999");
     
GivePlayerWeapon(idgunammo);
    return 
1;




Re: Creat /givegun command(zcmd) - ServerScripter - 01.09.2011

Thank you but i want for an exaple i have M4 i want to give it to other Player near me not spawning to him a Gun(but i copy your Code to use it Later)


Re: Creat /givegun command(zcmd) - System64 - 01.09.2011

You mean, you want to give him your gun?


Re: Creat /givegun command(zcmd) - ServerScripter - 01.09.2011

yea System64 and the player must be near me


Re: Creat /givegun command(zcmd) - ServerScripter - 01.09.2011

any Idea?