How to give player weapon on connect ?
#1

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

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

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

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);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)