SA-MP Forums Archive
Zombie have Weapons o.O - 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: Zombie have Weapons o.O (/showthread.php?tid=375531)



Zombie have Weapons o.O - Blackazur - 07.09.2012

Sometimes, when on my Server, a Zombie killed a Human, the Human is then a Zombie, but sometimes he spawn with Weapons. It is a SAMP Bug or a Bug in the Script?


Re: Zombie have Weapons o.O - [DOG]irinel1996 - 07.09.2012

Bug in the script. Make sure you don't give them any weapons in AddPlayerClass,
and you set the zome variable before spawn.


Re: Zombie have Weapons o.O - HuSs3n - 07.09.2012

no ,its a Bug in your script


AW: Zombie have Weapons o.O - Blackazur - 07.09.2012

@irinel I am sure that i have the Zombie dont give a Weapon in AddPlayerClass. And the Bug is only sometimes. And on OnPlayerSpawn i have remove the Weapons with "ResetPlayerWeapons".


AddPlayerClass(230,0.0,0.0,0.0,0.0,0,0,0,0,0,0);
AddPlayerClass(137,0.0,0.0,0.0,0.0,0,0,0,0,0,0);
AddPlayerClass(162,0.0,0.0,0.0,0.0,0,0,0,0,0,0);


Re: Zombie have Weapons o.O - nmader - 07.09.2012

Well, if it is a bug in your script which you believe it is, you could create a timer for every 3-5 seconds that if a player is a zombie it will remove their weapon(s) rather than battling with your script to find such a bug.


Re: Zombie have Weapons o.O - [DOG]irinel1996 - 07.09.2012

May I see your OnPlayerSpawn, please?


AW: Zombie have Weapons o.O - Blackazur - 07.09.2012

He the OnPlayerSpawn for Zombies:

case TEAM_ZOMBIE:
{
new rand = random(sizeof(RandomZombie));
SetPlayerPos(playerid,RandomZombie[rand][0],RandomZombie[rand][1],RandomZombie[rand][2]);
SetPlayerCheckpoint(playerid,RandomArmy[0][0],RandomArmy[0][1],RandomArmy[0][2],5.0);
SetPlayerColor(playerid,hellgrьn);
SetPlayerHealth(playerid,200.0);
SetPlayerTeam(playerid,1);
SetPlayerWeather(playerid,-19);
if(GetPVarInt(playerid,"DEAD") == 1)
{
ResetPlayerWeapons(playerid);
SetPlayerSkin(playerid,159);
TogglePlayerControllable(playerid,0);
TogglePlayerControllable(playerid,1);
SetPVarInt(playerid,"DEAD",0);
}


Re: Zombie have Weapons o.O - nmader - 07.09.2012

Well, perhaps you should try putting your ResetPlayerWeapons up above the if statement for "DEAD."


AW: Re: Zombie have Weapons o.O - Blackazur - 07.09.2012

Quote:
Originally Posted by nmader
Посмотреть сообщение
Well, perhaps you should try putting your ResetPlayerWeapons up above the if statement for "DEAD."
So i have it now make, i hope the Bug is now away.


AW: Re: Zombie have Weapons o.O - Blackazur - 07.09.2012

Quote:
Originally Posted by nmader
Посмотреть сообщение
Well, perhaps you should try putting your ResetPlayerWeapons up above the if statement for "DEAD."
I have it now tested, and it works, thank you.