Posts: 6,129
Threads: 36
Joined: Jan 2009
Are you sure that your variable 'PlayerInfo[playerid][New]' for that player is equal to 0?
Posts: 330
Threads: 118
Joined: Jul 2010
Reputation:
0
Thanks for the quick response,
Yes it is
EDIT: It's like it skips the whole function because it doesn't turn 1. I tried it without the stock as well
Posts: 6,129
Threads: 36
Joined: Jan 2009
Try this code:
pawn Код:
stock SpawnWeapons(playerid)
{
print("test call from SpawnWeapons - the code works prior to the if statement");
if(PlayerInfo[playerid][New] == 0)
{
print("test call from SpawnWeapons - the code works from inside the if statement");
GivePlayerWeapon(playerid, 28, 1000);
GivePlayerWeapon(playerid, 22, 9999);
PlayerInfo[playerid][New] = 1;
}
return 1;
}
Check your server_log.txt to see whether the prints show up.
Posts: 330
Threads: 118
Joined: Jul 2010
Reputation:
0
Both show up so its reading it but not actually doing anything.
Posts: 6,129
Threads: 36
Joined: Jan 2009
Do you have any sort of anticheat code that would disarm the player of their weapon if it's not properly registered? An example of this could be an anticheat from an admin filterscript.
Posts: 330
Threads: 118
Joined: Jul 2010
Reputation:
0
No, no filterscripts or anticheats (yet) this is the first time I've tried to add weapons.
EDIT: I made a command earlier and that worked fine, if that helps at all
Posts: 6,129
Threads: 36
Joined: Jan 2009
Any other includes or anything?
Posts: 330
Threads: 118
Joined: Jul 2010
Reputation:
0
No nothing but my GM
EDIT: Never mind I will find another way to give the player weapons once they are in game. Thanks for the help and for your time