[Off] [їChecktimer?] Requiero ayuda.
#1

Buenas a todos, me preguntaba, їcуmo chequear el tiempo en el que el usuario llegу a tal sitio?..., es decir, un tipo anti Speed Hack, que cuando el usuario llegue a tocar un PickUp en menos tiempo del asignado del Timer, provoque una funciуn que vendrнa siendo kickear..., agradezco su tiempo de lectura y espero recibir ayuda por parte de ustedes.
Reply
#2

Es simple, aquн tienes.

Quote:

new Speed[MAX_PLAYERS];
new Speed_timer[MAX_PLAYERS];
forward AntiSpeedHack(playerid);

Speed_timer[playerid] = SetTimerEx("AntiSpeedHack", 5000, false, "i", playerid); //cambia 5000 por el tiempo minimo para la entrega 5000 = 5 segundos. el timer lo tienes que poner cuando empiece la ruta


public AntiSpeedHack(playerid)
{
Speed[playerid] = 1;
return 1;
}



// YA SOLO TIENES QUE PONER UN IF CUANDO ENTREN AL PICKUP


if(Speed[playerid] == 0){
Kick(playerid);
KillTimer(Speed_timer[playerid]);
}else{
Speed[playerid] = 0;
KillTimer(Speed_timer[playerid]);
}

Reply
#3

Muchas gracias, anda de maravilla, te agradezco por tu tiempo.
Reply
#4

Mejor asi:

PHP код:
new Tiempo[MAX_PLAYERS];
//cuando quieres que comience a contarse los segundos:
Tiempo[playerid] = gettime();
y cuando toque el pickupcomprobar con esto:
if((
gettime() - Tiempo[playerid]) < 60//si llegу en menos de 60 segundos
{
    
Ban(playerid);
    return 
1;

Reply
#5

Quote:
Originally Posted by FelipeAndres
Посмотреть сообщение
Mejor asi:

PHP код:
new Tiempo[MAX_PLAYERS];
//cuando quieres que comience a contarse los segundos:
Tiempo[playerid] = gettime();
y cuando toque el pickupcomprobar con esto:
if((
gettime() - Tiempo[playerid]) < 60//si llegу en menos de 60 segundos
{
    
Ban(playerid);
    return 
1;

Vaya, script optimizado y de muy buen uso, te agradezco, no sabнa cуmo usar esa funciуn.
Reply
#6

Te recomiendo usar gettime() para contar el tiempo.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)