SA-MP Forums Archive
GivePlayerWeapon - 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: GivePlayerWeapon (/showthread.php?tid=660784)



GivePlayerWeapon - kevi11 - 13.11.2018

PHP код:
CMD:lspdset(playeridparams[])
{
    if(
Player[playerid][PlayerFaction] != FACTION_LSPD) return SCM(playerid, -1"Non fai parte di una fazione legale!");
    if(
IsPlayerInRangeOfPoint(playerid51129.0151,-1485.1357,22.7690))
    {
       
Player[playerid][FactionDuty] = 1;
       
GivePlayerWeapon(playerid348100); //Desert Eagle
       
GivePlayerWeapon(playerid356100); // M4
       
GivePlayerWeapon(playerid349100); // Shotgun
       
GivePlayerWeapon(playerid358100); // Sniper
       
GivePlayerWeapon(playerid353100); // Mp5
       
GivePlayerWeapon(playerid3341); //Manganello
    
}
    return 
1;

Hi guys why when i write this cmd in game, that don't give me the weapon...?


Re: GivePlayerWeapon - Tenka - 13.11.2018

https://sampwiki.blast.hk/wiki/Weapons

Take a look and put the id of weapon not model number

GivePlayerWeapon(playerid, 24, 100); //Desert Eagle , 100 ammo


Re: GivePlayerWeapon - kevi11 - 13.11.2018

I'm retard..... sorry ahah


Re: GivePlayerWeapon - NaS - 13.11.2018

Quote:
Originally Posted by Tenka
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/Weapons

Take a look and put the id of weapon not model number

GivePlayerWeapon(playerid, 24, 100); //Desert Eagle , 100 ammo
Even better:

Use the defines that already exist, for example WEAPON_DESERT_EAGLE.
Then you never need to look up IDs or make comments to remember which weapon you've placed there!