How to add custom spawn weapon?
#1

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...
Reply
#2

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;
}
Reply
#3

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

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

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

Im not shore about the resetweapons code is totally correct
Reply
#6

AddPlayerClass can be used to assign weapons to a class.

https://sampwiki.blast.hk/wiki/AddPlayerClass
Reply
#7

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.
Reply
#8

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

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
Reply
#10

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 ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)