Jump to content

Afisarea mesajului inainte de Kick


ARTIST

Recommended Posts

Dupa cum stiti, in clientul 0.3x functia Kick incheie conexiunea cu jucatorul,fara trimiterea mesajului cu pachetul de date. Acest lucru a fost facut cu scopul de a proteja serverele.

Mai jos va voi arata cel mai convenabil mod prin care vom efectua trimiterea datelor necesare jucatorului inainte de Kick.

    La toate forward:

[pawn]forward KickTimer(playerid); [/pawn]

    La inceputul public OnPlayerDisconnect:

[pawn]if(GetPVarInt(playerid, "Kick") != 0) KillTimer(GetPVarInt(playerid, "Kick"));[/pawn]

    La inceputul public OnPlayerUpdate:

[pawn]if(GetPVarInt(playerid, "Kick") != 0) GKick(playerid);  [/pawn]

    La sfarsitul modului sau in alt loc potrivit:

[pawn]public KickTimer(playerid) return GKick(playerid);

stock GKick(playerid, time = 5000)

{

    if(GetPVarInt(playerid, "Kick") == -1) Kick(playerid);

    else if(!GetPVarInt(playerid, "Kick")) SetPVarInt(playerid, "Kick", SetTimerEx("KickTimer", time, 0, "d", playerid));

    else

    {

        KillTimer(GetPVarInt(playerid, "Kick"));

        SetPVarInt(playerid, "Kick", -1);

        GKick(playerid);

    }

    return 1;

}  [/pawn]

Acum daca veti dori sa acordati kick unui jucator,va trebui sa folositi functia GKick(playerid, time).

playerid - e ID-ul jucatorului,caruia doriti sa ii acordati kick.

time (nu e necesar) - timpul, peste care jucatorul  va primi kick,daca acesta va fi AFK (in cazul dat 5 secunde).

Daca jucatorul nu va fi AFK atunci acesta va primi kick deaodata dupa trimiterea tuturor pachetelor cu date necesare (adica a mesajului cu Kick).

ep41yhufqpagka5wfoornw1wjfjie.png

HTjr_G.png
12975.png
 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.