Jump to content

Ajutor sistem anti-abuz


bogdaNNNNN

Recommended Posts

Acum 16 ore, bogdaNNNNN a spus:

Salut! Are cineva o functie gen cum e pe Ruby? Cand un player iese din casa, sa nu mai poata intra pentru un numar X de secunde.

Multumesc frumos.

Pai cand iese din casa apasand o tasta sau folosind o comanda pui o variabila pe 1, gen antiabuz[playerid]=1; setezi un timer de X secunde care va pune variabila de mai sus pe 0;

o secunda =1000ms cand setezi timerul. de exeplu pt 5 secunde pui 5000 s.a.m.d

Si cand jucatorul apasa tasta pt intrare sau foloseste comanda faci o verificare if(antiabuz[playerid]==1) return SCM(playerid,culoare,"Nu poti intra intr-un interior decat odata la X secunde");

 

Edited by valivaly96
Link to comment
Share on other sites

pui in variabilele playerului, pinfo cred ca ai sau cv de genu, AntiSpam.

Cand iese din casa, PInfo[playerid][AntiSpam] = gettime();

 

la comanda sau buton pui
 

new _SpamTime, _string[64];

if(gettime() - PInfo[playerid][AntiSpam] < 5)
{
  if(gettime() - Pinfo[playerid][AntiSpam] == 0) _SpamTime = 5;

  else  if(gettime() - Pinfo[playerid][AntiSpam] == 1) _SpamTime = 4;

  else  if(gettime() - Pinfo[playerid][AntiSpam] == 2) _SpamTime = 3;

  else  if(gettime() - Pinfo[playerid][AntiSpam] == 3) _SpamTime = 2;

  else  if(gettime() - Pinfo[playerid][AntiSpam] == 4) _SpamTime = 1;

  //---------------------------------------------------------------------------------------------------

  format(_string, sizeof(_string), "Poti sa intri intr-o casa in %d secunde!", _SpamTime), SendClientMessage(playerid, 0xFF0000AA, _string);
}

configurezi tu cum ai, eu ti-am dat un model

Edited by cristiviteza
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.