14.05.2017, 22:16
Alguien podria por favor decirme por que con este siguiente codigo, me envia muchos mensajes, y no uno cada 10 segundos como yo queria /_/
Код:
#include <a_samp>
new FlyHack[MAX_PLAYERS];
forward anticheat(playerid);
public anticheat(playerid)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new Float:Vel[3], Float:Pos[3];
GetPlayerVelocity(playerid, Vel[0], Vel[1], Vel[2]);
new nombre[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, nombre, sizeof(nombre));
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
if(Vel[0] <= -0.800000 || Vel[1] <= -0.800000 || Vel[2] <= -0.800000)
{
SetPlayerPos(playerid, Pos[0], Pos[1]-10, Pos[2]);
format(string, sizeof(string), "El jugador (%s) esta a una velocidad de X: %f, Y: %f, Z: %f", nombre, Vel[0], Vel[1], Vel[2]);
SendClientMessage(playerid, 0xFFFFFFFF, string);
FlyHack[playerid] = SetTimerEx("anticheat",10000,0,"d",playerid);//10 segundos
return 1;
}
}
}
return 1;
}
public OnPlayerUpdate(playerid)
{
anticheat(playerid);
return 1;
}


