SA-MP Forums Archive
OnPlayerUpdate not working? - 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: OnPlayerUpdate not working? (/showthread.php?tid=355422)



OnPlayerUpdate not working? - MarinacMrcina - 29.06.2012

I have a strange problem.
I wanted to make an anti weapon hack by this(http://forum.sa-mp.com/showthread.ph...ti+weapon+hack) tutorial and it didn't work.
After I tested if OnPlayerUpdate is working and it didnt work

I used this in my script

pawn Код:
public OnPlayerUpdate(playerid)
{
    SendClientMessage(playerid,-1,"Test 123...");
    return 1;
}
and after that I used it in Grand Larceny that i found in gamemodes,of course the chat was spamming 123 but in my gamemode it didn't.

Why?


Re: OnPlayerUpdate not working? - MP2 - 29.06.2012

I'm not 100% sure, but you have have to return 1 in OnPlayerUpdate in every loaded filterscript. I had a similar problem and I think that's how I fixed it - IIRC filterscript callbacks get called first. I'm not 100% certain though.


Re: OnPlayerUpdate not working? - MarinacMrcina - 29.06.2012

I'm not using any FS.Maybe because I deleted all the public funcions when i started the gamemode and added only the one I need?

This is realy srange,the same code in 2 gamemodes,in one its working in one not...


Re: OnPlayerUpdate not working? - MP2 - 30.06.2012

Are you sure you compiled it and loaded the correct gamemode on your server?


Re: OnPlayerUpdate not working? - MarinacMrcina - 30.06.2012

I finaly got it,after removing plugins and includes i found out that after removing the include <fixes> it works,so putting the include back on it didn't work,put it off it worked.

Conclusion:using includes to help you script makes you more problems that you should have normaly


Re: OnPlayerUpdate not working? - Makaveli93 - 30.06.2012

Don't use OnPlayerUpdate for anti-cheat, use timers instead. OnPlayerUpdate gets called too often, it may cause lag for you. I may be wrong tho...


Re: OnPlayerUpdate not working? - adithegman - 09.11.2012

Guys.... You saved my HOLE LIFE!!! I've been strugling for months to fix this problem and now i realise that was that god damn FIXES! THKS