Giving weapons at player spawn - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Giving weapons at player spawn (
/showthread.php?tid=178313)
Weird problem -
Matej_ - 21.09.2010
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;
}
Re: Giving weapons at player spawn -
Rachael - 21.09.2010
try changing the ammo to 32767
Re: Giving weapons at player spawn -
Matej_ - 21.09.2010
Quote:
Originally Posted by Rachael
try changing the ammo to 32767
|
Doesn't work.
Re: Giving weapons at player spawn -
nejc001 - 21.09.2010
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.
Re: Giving weapons at player spawn -
Conroy - 21.09.2010
Have you added the player to a team?
Re: Giving weapons at player spawn -
Matej_ - 21.09.2010
Quote:
Originally Posted by nejc001
do you have a ResetPlayerWeapons(); script anywhere in script?
|
No I don't have.
Re: Giving weapons at player spawn -
Rachael - 21.09.2010
debugging tip: put a printf("anything"); after the GiveplayerWeapon, and check the logs to make sure that the script is passing that point.
Re: Giving weapons at player spawn -
Mike_Peterson - 21.09.2010
May i ask why u use SetPlayerTeam 4x? TEAM_SWAT TEAM_T and twice 1...?