SA-MP Forums Archive
CMD crash server? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: CMD crash server? (/showthread.php?tid=146895)



CMD crash server? - friped93 - 09.05.2010

Hello, I got a problem with my command when i uses it it crashes the server for me and i can't find the reason why it crashes:P


CMD:
Код:
dcmd_vhotwire(playerid, params[])
{
	SetTimerEx("wiretimer", 2000, false, "%d", playerid);
  	new text[256];
  	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid,x,y,z);
  for(new i; i < MAX_PLAYERS; i++)
  {
  	format(text,sizeof(text),"*%s tries to hotwire the vehicle.",PlayerName(playerid));
  	if(IsPlayerInRangeOfPoint(i,7.0,x,y,z))
	{
	SendClientMessage(i, Purple, text);
	}
	}
	return 1;
}
forward wiretimer(playerid);
public wiretimer(playerid)
{
	new text[256];
	new Float:x, Float:y, Float:z;
	GetPlayerPos(playerid,x,y,z);
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
  if(random(3) != 1)
  {
	format(text,sizeof(text),"*%s fails to hotwire the vehicle.",PlayerName(playerid));
	if(IsPlayerInRangeOfPoint(i,7.0,x,y,z))
	{
	SendClientMessage(i, Red, text);
	}
	return 1;
  }
  	format(text,sizeof(text),"*%s success to hotwire the vehicle.",PlayerName(playerid));
	iVehicle[GetPlayerVehicleID(playerid)][1][1] = 1;
	TogglePlayerControllable(playerid,1);
	if(IsPlayerInRangeOfPoint(i,7.0,x,y,z))
	{
	SendClientMessage(i, Green, text);
	}
	}
	return 1;
}



Re: CMD crash server? - Conroy - 09.05.2010

pawn Код:
SetTimerEx("wiretimer", 2000, false, "i", playerid);