Jump to content

Recommended Posts

Posted

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.

Posted (edited)
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
Posted (edited)

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

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.