0.3c Timer, 1 = 1 second?
#7

Quote:
Originally Posted by VirSpectorX
Посмотреть сообщение
And it runs every 1 second if my ID ingame is 0.
But if my ID in game is not 0, it runs every 1 milisecond.
Me too, in my server if i am the id 0 some functions works, else it doesn't works.

Код:
public LimiteSuperato(playerid)
{
  new Velocita[MAX_PLAYERS];
  Velocita[playerid] = GetPlayerSpeed(playerid,true);
  for(new i=0;i<MAX_PLAYERS;i++)
  {
    if(GetPlayerTeam(playerid) != 8 && Velocita[playerid] > 100 && IsPlayerNearPlayer(50,playerid,i))
    {
      ReportCrime(playerid,COLOR_YELLOW,1,"Eccesso di velocitа.",MODE_COPS_IN_AREA);
    }
  }

  if(Velocita[playerid] > 800 && !IsPlayerNPC(playerid))
  {
	new string[256];
	new name[24];
	GetPlayerName(playerid,name,sizeof(name));
	format(string,sizeof(string),"%s(ID %d) и stato bannato per speed-hack %d km/h.", name, playerid, Velocita[playerid]);
    BanEx(playerid,"SpeedHack");
  }
  return 1;
}

stock ReportCrime(playerid,colore,stelle,motivo[],modo)
{
  new string[256];
  new string2[256];
  new string3[256];
  new name[24];
  GetPlayerName(playerid,name,sizeof(name));
  format(string,sizeof(string),"Hai commesso un crimine: %s",motivo);
  SendClientMessage(playerid,colore,string);
  format(string2,sizeof(string2),"A tutte le unitа: Sospetto: %s - Crimine: %s", name, motivo);
  format(string3,sizeof(string3),"A le unitа piu vicine: Sospetto: %s - Crimine: %s", name, motivo);
  SetPlayerWantedLevel(playerid,GetPlayerWantedLevel(playerid) + stelle);
  SetPlayerColor(playerid,colore);
  for(new i=0;i<MAX_PLAYERS;i++)
  {
	if(GetPlayerTeam(i) == 8)
	{
	  if(modo == MODE_ALL_COPS) SendClientMessage(i,COLOR_BLUE,string2);
	  if(modo == MODE_COPS_IN_AREA)
	  {
		if(IsPlayerNearPlayer(50,playerid,i))
		{
	      SendClientMessage(i,COLOR_BLUE,string3);
		}

	  }

    }

  }
  return 1;
}

GetPlayerSpeed(playerid,bool:kmh) // by misco
{
    new Float:Vx,Float:Vy,Float:Vz,Float:rtn;
    if(IsPlayerInAnyVehicle(playerid)) 	GetVehicleVelocity(GetPlayerVehicleID(playerid),Vx,Vy,Vz);
	else 								GetPlayerVelocity(playerid,Vx,Vy,Vz);
    rtn = floatsqroot(floatabs(floatpower(Vx + Vy + Vz,2)));
    return kmh?floatround(rtn * 100 * 1.61):floatround(rtn * 100);
}
PS: The client MSGs are in Italian...
What's wrong in this script
Reply


Messages In This Thread
0.3c Timer, 1 = 1 second? - by VirSpectorX - 30.12.2010, 13:45
Re: 0.3c Timer, 1 = 1 second? - by GaGlets(R) - 30.12.2010, 15:26
Re: 0.3c Timer, 1 = 1 second? - by Toreno - 30.12.2010, 16:09
Re: 0.3c Timer, 1 = 1 second? - by VirSpectorX - 31.12.2010, 11:52
Re: 0.3c Timer, 1 = 1 second? - by Finn - 31.12.2010, 12:02
Re: 0.3c Timer, 1 = 1 second? - by wups - 31.12.2010, 12:17
Re: 0.3c Timer, 1 = 1 second? - by Sasino97 - 31.12.2010, 13:42

Forum Jump:


Users browsing this thread: 3 Guest(s)