Jump to content

[ 0.3x ] Rezolvare problema Kick / Ban ( simplu )


Recommended Posts

Posted

[ 0.3x ] Rezolvare problema Kick / Ban

Probabil dupa ce ati actualizat server-ul la versiunea 0.3x ati observat o problema la functiile Kick / Ban.

Potrivit unui post al lui Kye de pe forumul SA:MP, aceasta problema se datoreaza inchiderii conexiunii dintre server si client inainte de a se transmite si mesajele din callback-ul cu pricina ( cel care contine functia Kick / Ban ).

Metoda de rezolvare este simpla: functia Kick / Ban trebuie trimisa dupa executarea callback-ului.

Cum facem asta? Folosind functia SetTimerEx. Potrivit lui Slice ( forum.sa-mp.com ), timer-ele sunt executate dupa finalizarea instructiunilor din callback .

Mai jos aveti codul pe care il folosesc eu :

forward Kick_Ban ( playerid, bool: kickban ); public Kick_Ban ( playerid, bool: kickban ) return ( !kickban ) ? Kick ( playerid ) : Ban ( playerid );

#define Kick(%1) 			SetTimerEx ( "Kick_Ban", 500, false, "ii", %1, false )
#define Ban(%1) 			SetTimerEx ( "Kick_Ban", 500, false, "ii", %1, true )

*NOTA: Daca tot nu va apare mesajul / mesajele de pe server-ul dvs, mariti intervalul timer-ului ( mariti acel nr. 500 ) .

Codurile scrie mai sus trebuie copiate EXACT in aceasta ordine !

Acum nu va mai trebui sa inlocuiti functiile Kick, respectiv Ban.

Y!M: [email protected] ( nu este ID pt. help-center )

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.