Jump to content

[Tutorial] Ai lag cand cineva spameaza o tasta?


nobilzeusAdv

Recommended Posts

Serverul are spike-uri,tick-urile zboara sau are lag cand spamezi o anumita tasta?

aceasta problema este pe gm-ul burned, daca spamezi tasta F ajungand sa scada si 100 tick-uri

rezolvarea este extrem de simpla

if(newkeys&GetPVarInt(playerid, "AntiKeyLagger") && GetPVarInt(playerid, "AntiKeyLaggerTime") > gettime()) return 1;
if(newkeys) {
  SetPVarInt(playerid, "AntiKeyLagger", newkeys);
  SetPVarInt(playerid, "AntiKeyLaggerTime", gettime()+1);
}

adaugati la OnPlayerKeyStateChange sus de tot pe primul rand

 

Acest cod detecteaza daca spamezi o anumita tasta, daca apesi de mai multe ori aceiasi tasta in mai putin de o secunda o sa iti interzica sa mai apesi

termenul este de o secunda, puteti pune mai mult daca doriti

Edited by nobilzeusAdv
  • Like 2
  • Upvote 1

aqpUjAc.png

 

 

 

 

Link to comment
Share on other sites

Acum 6 ore, nobilzeusAdv a spus:

Serverul are spike-uri,tick-urile zboara sau are lag cand spamezi o anumita tasta?

aceasta problema este pe gm-ul burned, daca spamezi tasta F ajungand sa scada si 100 tick-uri

rezolvarea este extrem de simpla


if(newkeys&GetPVarInt(playerid, "AntiKeyLagger") && GetPVarInt(playerid, "AntiKeyLaggerTime") > gettime()) return 1;
if(newkeys) {
  SetPVarInt(playerid, "AntiKeyLagger", newkeys);
  SetPVarInt(playerid, "AntiKeyLaggerTime", gettime()+1);
}

adaugati la OnPlayerKeyStateChange sus de tot pe primul rand

 

Acest cod detecteaza daca spamezi o anumita tasta, daca apesi de mai multe ori aceiasi tasta in mai putin de o secunda o sa iti interzica sa mai apesi

termenul este de o secunda, puteti pune mai mult daca doriti

Super, felicitari.

Multe persoane folosesc gm-ul acela si o sa le fie de ajutor.

  • Like 1

Ce inseamna cuvantul "Unic" este atunci cand Chestia / Obiectul / Idea / etc... nu exista in alta parte.

Copii, nu mai veniti cu vorbe de "Am gamemode unic", nu exista asa ceva, la ora actuala totul este pe net.

Aveti grija pe cine ajutati, majoritatea sunt caini.

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.