Timer help
#1

The problem i got is these timer work when im testing the on my own find but soon as i load them into my Server they dont work any ideas why? I think they are only working for one person at atime is there away for me to change this?

Код:
forward Sfraceclock(playerid);
public Sfraceclock(playerid) {
	if(iSfraceclock == -1) {
		iSfraceclock = 81;
	}

	new
	szMessage[10];

	iSfraceclock--;
	format(szMessage, sizeof(szMessage), "~r~%d",iSfraceclock); // Add more in if you wish.

	GameTextForPlayer(playerid, szMessage, 950, 6);

	if(iSfraceclock == 0) {
		KillTimer(Sfracetimer);
		DisablePlayerRaceCheckpoint(playerid);
		P_DATA[ playerid ][ P_OnStyle ] = false;
	}
	return 1;
}
forward Eastraceclock(playerid); // Also make a new SetTimerEx function in which you just add the number 1 in the funciton name.
public Eastraceclock(playerid) {
	if(iEastraceclock == -1) {
		iEastraceclock = 71;
	}

	new
	szMessage[10];

	iEastraceclock--; //  v down there, I have put ~n~ because that makes a new row, you don't want the timers to be in the same row and get one over an other.
	format(szMessage, sizeof(szMessage), "~r~%d",iEastraceclock); // Add more in if you wish.

	GameTextForPlayer(playerid, szMessage, 950, 6);

	if(iEastraceclock == 0) {
		KillTimer(Eastracetimer);
		DisablePlayerRaceCheckpoint(playerid);
		P_DATA[ playerid ][ P_OnStyle ] = false;
	}
	return 1;
}
forward Hillraceclock(playerid); // Also make a new SetTimerEx function in which you just add the number 1 in the funciton name.
public Hillraceclock(playerid) {
	if(iHillraceclock == -1) {
		iHillraceclock = 71;
	}

	new
	szMessage[10];

	iHillraceclock--; //  v down there, I have put ~n~ because that makes a new row, you don't want the timers to be in the same row and get one over an other.
	format(szMessage, sizeof(szMessage), "~r~%d",iHillraceclock); // Add more in if you wish.

	GameTextForPlayer(playerid, szMessage, 950, 6);

	if(iHillraceclock == 0) {
		KillTimer(Hillracetimer);
		DisablePlayerRaceCheckpoint(playerid);
		P_DATA[ playerid ][ P_OnStyle ] = false;
	}
	return 1;
}
forward Downraceclock(playerid); // Also make a new SetTimerEx function in which you just add the number 1 in the funciton name.
public Downraceclock(playerid) {
	if(iDownraceclock == -1) {
		iDownraceclock = 56;
	}

	new
	szMessage[10];

	iDownraceclock--; //  v down there, I have put ~n~ because that makes a new row, you don't want the timers to be in the same row and get one over an other.
	format(szMessage, sizeof(szMessage), "~r~%d",iDownraceclock); // Add more in if you wish.

	GameTextForPlayer(playerid, szMessage, 950, 6);

	if(iDownraceclock == 0) {
		KillTimer(Downracetimer);
		DisablePlayerRaceCheckpoint(playerid);
		P_DATA[ playerid ][ P_OnStyle ] = false;
	}
	return 1;
}
forward Westraceclock(playerid); // Also make a new SetTimerEx function in which you just add the number 1 in the funciton name.
public Westraceclock(playerid) {
	if(iWestraceclock == -1) {
		iWestraceclock = 61;
	}

	new
	szMessage[10];

	iWestraceclock--; //  v down there, I have put ~n~ because that makes a new row, you don't want the timers to be in the same row and get one over an other.
	format(szMessage, sizeof(szMessage), "~r~%d",iWestraceclock); // Add more in if you wish.

	GameTextForPlayer(playerid, szMessage, 950, 6);

	if(iWestraceclock == 0) {
		KillTimer(Westracetimer);
		DisablePlayerRaceCheckpoint(playerid);
		P_DATA[ playerid ][ P_OnStyle ] = false;
	}
	return 1;
}
forward Chinaraceclock(playerid); // Also make a new SetTimerEx function in which you just add the number 1 in the funciton name.
public Chinaraceclock(playerid) {
	if(iChinaraceclock == -1) {
		iChinaraceclock = 75;
	}

	new
	szMessage[10];

	iChinaraceclock--; //  v down there, I have put ~n~ because that makes a new row, you don't want the timers to be in the same row and get one over an other.
	format(szMessage, sizeof(szMessage), "~r~%d",iChinaraceclock); // Add more in if you wish.

	GameTextForPlayer(playerid, szMessage, 950, 6);

	if(iChinaraceclock == 0) {
		KillTimer(Chinaracetimer);
		DisablePlayerRaceCheckpoint(playerid);
		P_DATA[ playerid ][ P_OnStyle ] = false;
	}
	return 1;
}
forward Dockraceclock(playerid); // Also make a new SetTimerEx function in which you just add the number 1 in the funciton name.
public Dockraceclock(playerid) {
	if(iDockraceclock == -1) {
		iDockraceclock = 91;
	}

	new
	szMessage[10];

	iDockraceclock--; //  v down there, I have put ~n~ because that makes a new row, you don't want the timers to be in the same row and get one over an other.
	format(szMessage, sizeof(szMessage), "~r~%d",iDockraceclock); // Add more in if you wish.

	GameTextForPlayer(playerid, szMessage, 950, 6);

	if(iDockraceclock == 0) {
		KillTimer(Dockracetimer);
		DisablePlayerRaceCheckpoint(playerid);
		P_DATA[ playerid ][ P_OnStyle ] = false;
	}
	return 1;
}
forward Waterraceclock(playerid); // Also make a new SetTimerEx function in which you just add the number 1 in the funciton name.
public Waterraceclock(playerid) {
	if(iWaterraceclock == -1) {
		iWaterraceclock = 61;
	}

	new
	szMessage[10];

	iWaterraceclock--; //  v down there, I have put ~n~ because that makes a new row, you don't want the timers to be in the same row and get one over an other.
	format(szMessage, sizeof(szMessage), "~r~%d",iWaterraceclock); // Add more in if you wish.

	GameTextForPlayer(playerid, szMessage, 950, 6);

	if(iWaterraceclock == 0) {
		KillTimer(Waterracetimer);
		DisablePlayerRaceCheckpoint(playerid);
		P_DATA[ playerid ][ P_OnStyle ] = false;
	}
	return 1;
}
forward Offroadraceclock(playerid); // Also make a new SetTimerEx function in which you just add the number 1 in the funciton name.
public Offroadraceclock(playerid) {
	if(iOffroadraceclock == -1) {
		iOffroadraceclock = 200;
	}

	new
	szMessage[10];

	iOffroadraceclock--; //  v down there, I have put ~n~ because that makes a new row, you don't want the timers to be in the same row and get one over an other.
	format(szMessage, sizeof(szMessage), "~r~%d",iOffroadraceclock); // Add more in if you wish.

	GameTextForPlayer(playerid, szMessage, 950, 6);

	if(iOffroadraceclock == 0) {
		KillTimer(Offroadracetimer);
		DisablePlayerRaceCheckpoint(playerid);
		P_DATA[ playerid ][ P_OnStyle ] = false;
	}
	return 1;
}
Many thanks
Reply
#2

You should change the variables to check the remaining time left for each player, example: iOffroadraceclock change it to iOffroadraceclock[MAX_PLAYERS], also showing where this timers are started would be useful.
Reply
#3

This is where all the timers start

Код:
if(listitem == 0)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -1795.0421, 1103.3732, 45.0752, -1930.9707, 1076.5671, 50.9935, 10);
			Sfrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -1715.7688,1103.5144,45.2969);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 93.1171);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The San Ferrio Street Race Challange. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Sfracetimer = SetTimer("Sfraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
		if(listitem == 1)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -1544.8650,852.2205,6.9215, -1714.5927,832.6873,24.6169, 10);
			Eastrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -1531.3136,951.9580,6.7719);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 177.5547);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The East Coast Street Race Challange. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Eastracetimer = SetTimer("Eastraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
		if(listitem == 2)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -2768.2717,-499.6606,7.1873, -2674.2393,-516.3976,18.1585, 10);
			Hillrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -2803.2246,-473.7555,6.8922);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 236.4861);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The Hill Climb Challange. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Hillracetimer = SetTimer("Hillraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
  		if(listitem == 3)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -2277.1809,1176.6937,55.5781, -2474.0054,1219.0786,35.0667, 10);
			Downrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -2276.0747,1174.7512,55.3515);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 92.8058);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The DownTown Street Race. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Downracetimer = SetTimer("Downraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
  		if(listitem == 4)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -1763.769287,123.470710,3.672383, -1763.483764,-33.125278,10.852465, 10);
			Westrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -1765.4993,174.8689,6.7540);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 182.1981);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The West Coast Street Race. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Westracetimer = SetTimer("Westraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
  	}
	 if(listitem == 5)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -2215.006591,731.450439,49.361488,-2260.848144,717.839538,49.392246, 10);
			Chinarace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -2125.3948,730.1760,69.1387);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 90.1973);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The China Town Street Race. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Chinaracetimer = SetTimer("Chinaraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
  if(listitem == 6)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, 2504.3120,-2224.4526,13.0566,2332.1841,-2346.6284,13.1099, 10);
			Dockrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), 2621.8010,-2225.3718,13.0854);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 92.2505);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The Docklands Street Race. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Dockracetimer = SetTimer("Dockraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
  if(listitem == 7)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, 1377.8418,-1533.4606,8.3991,1377.3309,-1710.3802,8.5864, 10);
			Waterrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), 1407.6420,-1315.7773,8.4437);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 185.0637);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The Waterway Race. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Waterracetimer = SetTimer("Waterraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
  		if(listitem == 8)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -431.2669,-1918.3784,6.4773,-464.5111,-2012.7426,44.5042, 10);
			Offroadrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -431.2669,-1918.3784,6.4773);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 157.0667);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start Hardcore OffRoading. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Offroadracetimer = SetTimer("Offroadraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
Thanks for helping
Reply
#4

Quote:
Originally Posted by manchestera
Посмотреть сообщение
This is where all the timers start

Код:
if(listitem == 0)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -1795.0421, 1103.3732, 45.0752, -1930.9707, 1076.5671, 50.9935, 10);
			Sfrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -1715.7688,1103.5144,45.2969);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 93.1171);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The San Ferrio Street Race Challange. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Sfracetimer = SetTimer("Sfraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
		if(listitem == 1)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -1544.8650,852.2205,6.9215, -1714.5927,832.6873,24.6169, 10);
			Eastrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -1531.3136,951.9580,6.7719);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 177.5547);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The East Coast Street Race Challange. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Eastracetimer = SetTimer("Eastraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
		if(listitem == 2)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -2768.2717,-499.6606,7.1873, -2674.2393,-516.3976,18.1585, 10);
			Hillrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -2803.2246,-473.7555,6.8922);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 236.4861);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The Hill Climb Challange. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Hillracetimer = SetTimer("Hillraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
  		if(listitem == 3)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -2277.1809,1176.6937,55.5781, -2474.0054,1219.0786,35.0667, 10);
			Downrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -2276.0747,1174.7512,55.3515);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 92.8058);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The DownTown Street Race. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Downracetimer = SetTimer("Downraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
  		if(listitem == 4)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -1763.769287,123.470710,3.672383, -1763.483764,-33.125278,10.852465, 10);
			Westrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -1765.4993,174.8689,6.7540);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 182.1981);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The West Coast Street Race. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Westracetimer = SetTimer("Westraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
  	}
	 if(listitem == 5)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -2215.006591,731.450439,49.361488,-2260.848144,717.839538,49.392246, 10);
			Chinarace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -2125.3948,730.1760,69.1387);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 90.1973);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The China Town Street Race. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Chinaracetimer = SetTimer("Chinaraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
  if(listitem == 6)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, 2504.3120,-2224.4526,13.0566,2332.1841,-2346.6284,13.1099, 10);
			Dockrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), 2621.8010,-2225.3718,13.0854);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 92.2505);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The Docklands Street Race. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Dockracetimer = SetTimer("Dockraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
  if(listitem == 7)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, 1377.8418,-1533.4606,8.3991,1377.3309,-1710.3802,8.5864, 10);
			Waterrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), 1407.6420,-1315.7773,8.4437);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 185.0637);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start The Waterway Race. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Waterracetimer = SetTimer("Waterraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
  		if(listitem == 8)
			{
			if(!IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "You have to be in a vehicle!", 4000, 6 );
			SetPlayerRaceCheckpoint(playerid, 0, -431.2669,-1918.3784,6.4773,-464.5111,-2012.7426,44.5042, 10);
			Offroadrace[playerid] = 1; // This will change the variable, so we can use it later on with OnPlayerEnterCheckpoint
			SetVehiclePos( GetPlayerVehicleID( playerid ), -431.2669,-1918.3784,6.4773);
			currentveh = GetPlayerVehicleID(playerid);
			SetVehicleZAngle(currentveh, 157.0667);
			SetCameraBehindPlayer( playerid );
			SendClientMessage(playerid, 0xFFFFFFFF, "You Start Hardcore OffRoading. Please follow the checkpoints");
			SendClientMessage(playerid, 0xFF0000FF, "Boost has been deactivated!");
			SendClientMessage(playerid, 0xFF0000FF, "VUP has been deactivated!");
			Offroadracetimer = SetTimer("Offroadraceclock", 1000, true);
			P_DATA[ playerid ][ P_OnStyle ] = true;
			P_DATA[ playerid ][ P_CarGod ] = 1;
			P_DATA[ playerid ][ P_Vup ] = 0;
			P_DATA[ playerid ][ P_Boost ] = 0;
			return 1;
		}
Thanks for helping
This is wrong, you should use SetTimerEx instead of SetTimer, you are missing the playerid so by default is going to give playerid 0 always.
Change all settimers to SetTimerEx(Also refer to https://sampwiki.blast.hk/wiki/SetTimerEx), example:
pawn Код:
Waterracetimer = SetTimer("Waterraceclock", 1000, true);
pawn Код:
Waterracetimer[playerid] = SetTimerEx("Waterraceclock", 1000, true, "i", playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)