SA-MP Forums Archive
How to add custom spawn weapon? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to add custom spawn weapon? (/showthread.php?tid=157141)



[HELP] How to add custom respawn weapon other than Deagle when we DIED/ GET KILLED - ramshidjafar - 05.07.2010

I'm using inbuild 'LVDM' GM, but in that as we know, it has only deagle as Spawn weapon, now i need a help from you people that how can i add custom player spawn weapon, like On player spawns player have sawnoffs, uzi, etc...


Re: How to add custom spawn weapon? - !CryWolf - 05.07.2010

pawn Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerWeapon(playerid, weaponid, ammu);//weapon id at wiki.sa-mp.com
        GivePlayerWeapon(playerid, weaponid, ammu);//weapon id at wiki.sa-mp.com
    return 1;
}



Re: How to add custom spawn weapon? - ramshidjafar - 05.07.2010

ty bro.. thatz okay!
but i forgot to add one more thing....
that is after getting killed the "WEAPONS SHOULD BE RESPAWNED" any idea?


Re: How to add custom spawn weapon? - ramshidjafar - 05.07.2010

anyone Please replay, i know many knew this .... please i'm in btween scripting


Re: How to add custom spawn weapon? - [NTX]MikeQ - 05.07.2010

i know that it was under OnPlayerDeath ResetPlayerWeapons(playerid);

Im not shore about the resetweapons code is totally correct


Re: How to add custom spawn weapon? - Karlip - 05.07.2010

AddPlayerClass can be used to assign weapons to a class.

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


Re: How to add custom spawn weapon? - TKZ227 - 05.07.2010

If you mean respawn as in remove their weapons and give them back the normal spawn weapon, then:

OnPlayerDeath:
pawn Код:
ResetPlayerWeapons(playerid); //removes their weapons
GivePlayerWeapon(playerid, 24, 500); // That's where you give them whatever weapon you want
Replace the 24 in the GivePlayerWeapon with the weapon ID of the gun you want. For a full list of gun ID's, visit here:

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

The 500 is the amount of ammo.

For more help with functions, I recommend you visit wiki.sa-mp.com.


Re: How to add custom spawn weapon? - ramshidjafar - 06.07.2010

I have tried all what you people said, no difference....


Re: How to add custom spawn weapon? - ramshidjafar - 06.07.2010

sorry for double post.. i cant delete the previous one.


Now,

I have tried everything u people suggested stilll i cant get the other weapons other than Deagle get Spawned after death


Re: How to add custom spawn weapon? - dice7 - 06.07.2010

TheKingOfSamp, he is not using your gamemode and the code you gave would just error

ramshidjafar, maybe you could show us what've you actually tried ?