SA-MP Forums Archive
How to give player weapon on connect ? - 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: How to give player weapon on connect ? (/showthread.php?tid=475727)



How to give player weapon on connect ? - Le3aT - 14.11.2013

Well i made that

GivePlayerWeapon(playerid,4,999);

Under the OnPlayerConnect and it doesn't give me errors but when i enter the game nothing comes

Help please


Re: How to give player weapon on connect ? - Beckett - 14.11.2013

You cannot give weapons on connect you can give them on Spawn.
Код:
public OnPlayerSpawn(playerid)
{
GivePlayerWeapon(playerid,4,999);
}



Re: How to give player weapon on connect ? - Twizted - 14.11.2013

Well, you cannot give a gun to player when he connects. The OnPlayerConnect callback lasts untill the player clicks "spawn" (on the default SA:MP class selection method). If you want to give a gun to the player, make your OnPlaySpawn callback look like this:

pawn Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerWeapon(playerid,4,999);
}



Re: How to give player weapon on connect ? - Areax - 14.11.2013

Also, you want to give a player a knife with 999 ammo ? (ID 4 = KNIFE) See all weapon's IDs here: https://sampwiki.blast.hk/wiki/Weapons

And then,

pawn Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerWeapon(playerid, WAEPOND_ID, AMMO);
}