Giving weapons at player spawn
#1

I use this code on OnPlayerSpawn so when player spawns he will get those weapons
nothing isn't wrong but i dont know why player doesn't get weapons when he spawns.


pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerInterior(playerid,5);
    SetPlayerPos(playerid,1267.663208,-781.323242,1091.906250);
    if(gTeam[playerid] == TEAM_SWAT)
    {
        SetPlayerTeam(playerid,TEAM_SWAT);
        GivePlayerWeapon(playerid,41,100000);
        GivePlayerWeapon(playerid,23,100000);
        GivePlayerWeapon(playerid,35,100000);
        GivePlayerWeapon(playerid,31,100000);
        GivePlayerWeapon(playerid,17,10);
        SetPlayerTeam(playerid,1);
    }
    else if(gTeam[playerid] == TEAM_T)
    {
        SetPlayerTeam(playerid,TEAM_T);
        GivePlayerWeapon(playerid,4,1000000);
        GivePlayerWeapon(playerid,24,100000);
        GivePlayerWeapon(playerid,27,100000);
        GivePlayerWeapon(playerid,30,100000);
        GivePlayerWeapon(playerid,16,2);
        SetPlayerTeam(playerid,1);
    }
    return 1;
}
Reply
#2

try changing the ammo to 32767
Reply
#3

Quote:
Originally Posted by Rachael
Посмотреть сообщение
try changing the ammo to 32767
Doesn't work.
Reply
#4

do you have a ResetPlayerWeapons(); script anywhere in script?
try to change ammo to 100 and try then, i think ammo now its a little to high.
Reply
#5

Have you added the player to a team?
Reply
#6

Quote:
Originally Posted by nejc001
Посмотреть сообщение
do you have a ResetPlayerWeapons(); script anywhere in script?
No I don't have.
Reply
#7

debugging tip: put a printf("anything"); after the GiveplayerWeapon, and check the logs to make sure that the script is passing that point.
Reply
#8

May i ask why u use SetPlayerTeam 4x? TEAM_SWAT TEAM_T and twice 1...?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)