some help with Player Vars and IF here. - 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: some help with Player Vars and IF here. (
/showthread.php?tid=279201)
some help with Player Vars and IF here. -
henry jiggy - 25.08.2011
trying to make a hp anticheat and i got it but it bans ppl on spawn, so i did this:
Код:
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid);
SetPVarInt(playerid,"Hp Exception", 1);
SetTimer("SetPVarInt(playerid,XD, 0)", 1000, false);
return 1;
}
and then this under OnPlayerUpdate
Код:
if 1=(GetPVarInt(playerid, "HP exception"));
{
//something
}
but i get these errors at the If 1= Bla bla bla line:
Код:
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(461) : warning 211: possibly unintended assignment
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Testmode.pwn(461) : error 022: must be lvalue (non-constant)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
P.S: im using the Anticheat code from the Wiki(OnPlayerUpdate page)
Re: some help with Player Vars and IF here. -
henry jiggy - 25.08.2011
The timer wasnt a problem... the OnPlayerUpdate part is. this is just for the exception,and its working, but i get errors at the If line
Re: some help with Player Vars and IF here. -
henry jiggy - 25.08.2011
Actually at least i think its working....didnt give me any errors
Re: some help with Player Vars and IF here. -
henry jiggy - 25.08.2011
Nevermind i fixed it.