When reach check point...server freeze me!
#1

Hi to all i have problem. I make 3 jobs, all work ok, 2 of them are work with check points, firs work ok but second job who work on CP have bug...total 20 CP when i reach first cp with truck, server freeze me ( becouse i test it that is the reason to freeze only me ) so what can be problem? any help thx alot )
Reply
#2

no codes?
Reply
#3

Here is cmd wich "run" first check point
Код:
if(strcmp(cmd, "/collect", true) == 0)//garbagejob
  {
    if(IsPlayerConnected(playerid))
    {
      if(PlayerInfo[playerid][pJob] != 19)
      {
      	SendClientMessage(playerid, COLOR_GREY, "  Dont have rubish job. ");
       	return 1;
      }
  			new tmpcar = GetPlayerVehicleID(playerid);
   		if(IsAGarbageTruck(tmpcar))
      {
        if(PlayerInfo[playerid][pGarbageTime] == 0)
        {
	        if(IsCollectingRubbish[playerid] == 0)
	        {
	         	SendClientMessage(playerid, COLOR_LIGHTBLUE, "  INFO: Go trought CP to collect rubish and money");
			      	SetPlayerCheckpoint(playerid, 2124.073,-2111.594,13.043, 5.0);
	         	IsCollectingRubbish[playerid] = 1;
						PlayerInfo[playerid][pGarbageTime] += 0;
	        }
	        else
	        {
	          SendClientMessage(playerid, COLOR_GRAD2, "  You already have this job");
	        }
				}
				else
				{
				  SendClientMessage(playerid, COLOR_GRAD2, "  Must wait for collect rubbish again");
				  return 1;
				}
      }
      else
      {
        SendClientMessage(playerid, COLOR_GRAD2, "  Not in rubbish truck.");
        return 1;
      }
    	}
    return 1;
  }
Here is check points
Код:
else if(IsCollectingRubbish[playerid] > 0)//garbagejob
	{
	  new tmpcar = GetPlayerVehicleID(playerid);
	  if(IsAGarbageTruck(tmpcar))
	  {
			if(IsCollectingRubbish[playerid] == 1)
			{
			  GarbageTime[playerid] += 1;
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2124.073,-2111.594,13.043,5.0);
	    	IsCollectingRubbish[playerid] = 2;
			}
			else if(IsCollectingRubbish[playerid] == 2)
			{
			  BinTime[playerid] += 1;
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2210.153,-2153.617,13.043,5.0);
	    	IsCollectingRubbish[playerid] = 3;
			}
			else if(IsCollectingRubbish[playerid] == 3)
			{
			  GarbageTime[playerid] += 1;//1
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2483.380,-2049.187,24.352,5.0);
	    	IsCollectingRubbish[playerid] = 4;
			}
			else if(IsCollectingRubbish[playerid] == 4)
			{
			  GarbageTime[playerid] += 1;//2
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2713.627,-2029.699,13.024,5.0);
	    	IsCollectingRubbish[playerid] = 5;
			}
			else if(IsCollectingRubbish[playerid] == 5)
			{
			  GarbageTime[playerid] += 1;//3
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2769.198,-1962.828,13.038,5.0);
	    	IsCollectingRubbish[playerid] = 6;
			}
			else if(IsCollectingRubbish[playerid] == 6)
			{
			  GarbageTime[playerid] += 1;//4
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2795.741,-1890.893,10.571,5.0);
	    	IsCollectingRubbish[playerid] = 7;
			}
			else if(IsCollectingRubbish[playerid] == 7)
			{
        GarbageTime[playerid] += 1;//5
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2844.950,-1805.224,10.535,5.0);
	    	IsCollectingRubbish[playerid] = 8;
			}
			else if(IsCollectingRubbish[playerid] == 8)
			{
			  GarbageTime[playerid] += 1;//6
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2796.747,-1657.537,10.356,5.0);
	    	IsCollectingRubbish[playerid] = 9;
			}
			else if(IsCollectingRubbish[playerid] == 9)
			{
			  GarbageTime[playerid] += 1;//7
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2738.056,-1567.945,19.501,5.0);
	    	IsCollectingRubbish[playerid] = 10;
			}
			else if(IsCollectingRubbish[playerid] == 10)
			{
			  BinTime[playerid] += 1;//1
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2685.429,-1496.409,30.086,5.0);
	    	IsCollectingRubbish[playerid] = 11;
			}
			else if(IsCollectingRubbish[playerid] == 11)
			{
			  BinTime[playerid] += 1;//2
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2643.116,-1365.144,31.617,5.0);
	    	IsCollectingRubbish[playerid] = 12;
			}
			else if(IsCollectingRubbish[playerid] == 12)
			{
			  BinTime[playerid] += 1;//3
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2613.856,-1257.371,48.093,5.0);
	    	IsCollectingRubbish[playerid] = 13;
			}
			else if(IsCollectingRubbish[playerid] == 13)
			{
			  GarbageTime[playerid] += 1;//1
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2450.889,-1222.783,29.005,5.0);
	    	IsCollectingRubbish[playerid] = 14;
			}
			else if(IsCollectingRubbish[playerid] == 14)
			{
			  GarbageTime[playerid] += 1;//2
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2504.281,-1185.113,48.263,5.0);
	    	IsCollectingRubbish[playerid] = 15;
			}
			else if(IsCollectingRubbish[playerid] == 15)
			{
			  GarbageTime[playerid] += 1;//3
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2697.930,-1071.436,68.825,5.0);
	    	IsCollectingRubbish[playerid] = 16;
			}
			else if(IsCollectingRubbish[playerid] == 16)
			{
			  BinTime[playerid] += 1;//1
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2508.614,-1045.058,68.833,5.0);
	    	IsCollectingRubbish[playerid] = 17;
			}
			else if(IsCollectingRubbish[playerid] == 17)
			{
			  BinTime[playerid] += 1;//2
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2259.882,-1054.865,49.928,5.0);
	    	IsCollectingRubbish[playerid] = 18;
			}
			else if(IsCollectingRubbish[playerid] == 18)
			{
			  BinTime[playerid] += 1;//3
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2189.882,-1122.970,24.454,0.0,5.0);
	    	IsCollectingRubbish[playerid] = 19;
			}
			else if(IsCollectingRubbish[playerid] == 19)
			{
			  BinTime[playerid] += 1;//4
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 2026.681,-1135.298,24.243,5.0);
	    	IsCollectingRubbish[playerid] = 20;
			}
			else if(IsCollectingRubbish[playerid] == 20)
			{
			  BinTime[playerid] += 1;//5
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 1887.128,-1087.191,23.592,5.0);
	    	IsCollectingRubbish[playerid] = 21;
			}
			else if(IsCollectingRubbish[playerid] == 21)
			{
			  GarbageEndTime[playerid] += 1;
				TogglePlayerControllable(playerid, 0);
	    	DisablePlayerCheckpoint(playerid);
	    	SetPlayerCheckpoint(playerid, 1889.128,-1087.191,23.592,5.0);
	    	IsCollectingRubbish[playerid] = 22;
			}
			else if(IsCollectingRubbish[playerid] == 22)
	  		{
	    	DisablePlayerCheckpoint(playerid);
	    	SendClientMessage(playerid, COLOR_LIGHTBLUE, "  Odlicno, evo vase plate od 3000 dinara");
	    	IsCollectingRubbish[playerid] = 0;
	    	GivePlayerMoney(playerid, 3000);
	    	Gas[tmpcar] = GasMax;
	    	SetVehicleToRespawn(GetPlayerVehicleID(playerid));
			}
		}
	}
Reply
#4

Код:
TogglePlayerControllable(playerid, 0);
that will freezz the player -_- theres your error get rid off that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)