[Help] Checkpoint load
#1

Hey, I need help, so I did the driving school and we load checkpoint for taking the car, and the same way I did for the engine and truck, but will not load them, just for auto cp, others do not, what's the problem ..

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	for(new i = 0; i < 3; i ++)
	{
		if(vehicleid == auto[i])
		{
		    if(AutoCP[playerid] == 0)
		    {
		        if(Skola[playerid] == 1)
		        {
		        AutoCP[playerid] = 1;
		        SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}PAZI!! Ako ostetis auto vise od 20posto padas!!!.");
		        SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Krenimo do kruga,i okrenimo se.");
		        SetPlayerCheckpoint(playerid,2662.7395, -1959.4790, 12.5293,5);
		        }
			}
		}
		if(vehicleid == motor[i])
		{
		    if(MotorCP[playerid] == 0)
		    {
		        if(Skola[playerid] == 1)
		        {
		        MotorCP[playerid] = 1;
		        SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}PAZI!! Ako ostetis auto vise od 20posto padas!!!.");
		        SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Krenimo do kruga,i okrenimo se.");
		        SetPlayerCheckpoint(playerid,2662.7395, -1959.4790, 12.5293,5);
		        }
			}
		}
		if(vehicleid == kamion[i])
		{
		    if(KamionCP[playerid] == 0)
		    {
				if(Skola[playerid] == 3)
		        {
		        KamionCP[playerid] = 1;
		        
		        SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}PAZI!! Ako ostetis kamion vise od 20posto padas!!!.");
		        SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Krenite do kraja i okrenite se.");
		        SetPlayerCheckpoint(playerid,1443.1512, -1037.4873, 22.6366,3);
				}
			}
		}
	}
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	if(Skola[playerid] > 0)
	{
	switch(Skola[playerid])
	{
		case 1:
		{
		    switch(AutoCP[playerid])// POLAGANJE AUTA
		    {
		        case 1:
		        {
		            DisablePlayerCheckpoint(playerid);
		            AutoCP[playerid] = 2;
					SetPlayerCheckpoint(playerid,2684.8481, -1946.5454, 12.5373,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Sada se parkiraj unazad izmedju cunjeva.");
				}
		        case 2:
		        {
		            DisablePlayerCheckpoint(playerid);
		            AutoCP[playerid] = 3;
					SetPlayerCheckpoint(playerid,2711.7805, -1979.0607, 12.3723,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Sada idemo na cesti skrenite desno.");
				}
		        case 3:
		        {
		            DisablePlayerCheckpoint(playerid);
		            AutoCP[playerid] = 4;
					SetPlayerCheckpoint(playerid,2739.7996, -2167.9973, 9.9232,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Kod autoceste skreni ljevo.");
				}
				case 4:
		        {
		            DisablePlayerCheckpoint(playerid);
		            AutoCP[playerid] = 5;
					SetPlayerCheckpoint(playerid,2808.1125, -1887.8744, 9.9049,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Na drugom raskrizju,idemo ljevo.");
				}
				case 5:
		        {
		            DisablePlayerCheckpoint(playerid);
		            AutoCP[playerid] = 6;
					SetPlayerCheckpoint(playerid,2628.5012, -1730.5547, 9.9668,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Nastavite ravno,kod prvog semofora idemo ljevo.");
				}
				case 6:
		        {
		            DisablePlayerCheckpoint(playerid);
		            AutoCP[playerid] = 7;
					SetPlayerCheckpoint(playerid,2525.5491, -1746.0599, 12.3681,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Na prvom raskrizju skrecemo ljevo.");
				}
				case 7:
		        {
		            DisablePlayerCheckpoint(playerid);
		            AutoCP[playerid] = 8;
					SetPlayerCheckpoint(playerid,2530.3218, -1934.7788, 12.3451,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Na prvom raskrizju skrecemo ljevo.");
				}
				case 8:
		        {
		            DisablePlayerCheckpoint(playerid);
		            AutoCP[playerid] = 9;
					SetPlayerCheckpoint(playerid,2683.4348, -1963.6854, 12.5357,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Nastavite ravno,vracamo se u autoskolu.");
				}
  				case 9:
		        {
					new Float:health;
				    new veh = GetPlayerVehicleID(playerid);
				    GetVehicleHealth(veh, health);
				    if(health < 800) return SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Niste uspjeli poloziti,previse ste ostetili vozilo.");
				    AutoCP[playerid] = 0;
		            DisablePlayerCheckpoint(playerid);
		            Skola[playerid] = 0;
				    if(health > 801)/////////////////////////////////////////////
				    PlayerInfo[playerid][pVozacka] = 1;
	    			SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Cestitam,uspjesno ste polozili B kategoriju.");
		            AutoCP[playerid] = 0;
		            DisablePlayerCheckpoint(playerid);
		            Skola[playerid] = 0;
				}
			}
		}
		case 2:
		{
		    switch(MotorCP[playerid])//POLAGANJE MOTORA
		    {
		        case 1:
		        {
		            DisablePlayerCheckpoint(playerid);
		            MotorCP[playerid] = 2;
					SetPlayerCheckpoint(playerid,2684.8481, -1946.5454, 12.5373,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Sada se parkiraj unazad izmedju cunjeva.");
				}
		        case 2:
		        {
		            DisablePlayerCheckpoint(playerid);
		            MotorCP[playerid] = 3;
					SetPlayerCheckpoint(playerid,2711.7805, -1979.0607, 12.3723,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Sada idemo na cesti skrenite desno.");
				}
		        case 3:
		        {
		            DisablePlayerCheckpoint(playerid);
		            MotorCP[playerid] = 4;
					SetPlayerCheckpoint(playerid,2739.7996, -2167.9973, 9.9232,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Kod autoceste skreni ljevo.");
				}
				case 4:
		        {
		            DisablePlayerCheckpoint(playerid);
		            MotorCP[playerid] = 5;
					SetPlayerCheckpoint(playerid,2808.1125, -1887.8744, 9.9049,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Na drugom raskrizju,idemo ljevo.");
				}
				case 5:
		        {
		            DisablePlayerCheckpoint(playerid);
		            MotorCP[playerid] = 6;
					SetPlayerCheckpoint(playerid,2628.5012, -1730.5547, 9.9668,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Nastavite ravno,kod prvog semofora idemo ljevo.");
				}
				case 6:
		        {
		            DisablePlayerCheckpoint(playerid);
		            MotorCP[playerid] = 7;
					SetPlayerCheckpoint(playerid,2525.5491, -1746.0599, 12.3681,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Na prvom raskrizju skrecemo ljevo.");
				}
				case 7:
		        {
		            DisablePlayerCheckpoint(playerid);
		            MotorCP[playerid] = 8;
					SetPlayerCheckpoint(playerid,2530.3218, -1934.7788, 12.3451,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Na prvom raskrizju skrecemo ljevo.");
				}
				case 8:
		        {
		            DisablePlayerCheckpoint(playerid);
		            MotorCP[playerid] = 9;
					SetPlayerCheckpoint(playerid,2683.4348, -1963.6854, 12.5357,3);
					SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Nastavite ravno,vracamo se u autoskolu.");
				}
  				case 9:
		        {
		            new Float:health;
				    new veh = GetPlayerVehicleID(playerid);
				    GetVehicleHealth(veh, health);
				    if(health < 800) return SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Niste uspjeli poloziti,previse ste ostetili vozilo.");
				    MotorCP[playerid] = 0;
		            DisablePlayerCheckpoint(playerid);
		            Skola[playerid] = 0;
				    if(health > 801)/////////////////////////////////////////////
			 		PlayerInfo[playerid][pMotor] = 1;
	    			SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Cestitam,uspjesno ste polozili B kategoriju.");
		            MotorCP[playerid] = 0;
		            DisablePlayerCheckpoint(playerid);
		            Skola[playerid] = 0;
				}
			}
		}
		case 3://POLAGANJE KAMIONA
		{
		    switch(KamionCP[playerid])
		    {
		        case 1:
		        {
		            SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Cestitam,uspjesno ste polozili B kategoriju.");
		            DisablePlayerCheckpoint(playerid);
		            KamionCP[playerid] = 2;
					SetPlayerCheckpoint(playerid,1045.69617, -950.73816, 40.29365,3);
				}
		        case 2:
		        {
		            SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Cestitam,uspjesno ste polozili B kategoriju.");
		            DisablePlayerCheckpoint(playerid);
		            KamionCP[playerid] = 3;
					SetPlayerCheckpoint(playerid,1461.62610, -1734.29517, 11.46269,3);
				}
		        case 3:
		        {
		            SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Cestitam,uspjesno ste polozili B kategoriju.");
		            DisablePlayerCheckpoint(playerid);
		            KamionCP[playerid] = 4;
				}
  				case 4:
		        {
		            KamionCP[playerid] = 0;
		            SendClientMessage(playerid, COLOR_LIGHTRED, "INSTRUKTOR: {FFFFFF}Cestitam,uspjesno ste polozili B kategoriju.");
		            Skola[playerid] = 0;
		            DisablePlayerCheckpoint(playerid);
				}
			}
		}
	}
	return 1;
	}
	return 0;
}

////////////////////////////////////////////////////////////////////////////////

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_POLAGANJE1)
	{
	    if(listitem == 0)
	    {
			if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "Odustali ste od polaganja!");
			if(response)
			{
				if(PlayerInfo[playerid][pPolozioTestV] == 1)
				{
					SendClientMessage(playerid, 0xFFFFFFFF, "Vec ste polozili test!");
					return 1;
				}
				ShowPlayerDialog(playerid, DIALOG_POLAGANJE2, DIALOG_STYLE_MSGBOX, "Test", "Da li su potrebna svjetla dok vozite?", "Da", "Ne");
			}
		}
		if(listitem == 1)
		{
		    if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "Odustali ste od polaganja!");
		    if(response)
		    {
				if(PlayerInfo[playerid][pVozacka] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, " Vec ste polozili !");
				PlayerInfo[playerid][pPolazeV] = 1;
				SendClientMessage(playerid, 0xFFFFFFFF, " Idite u vozilo auto skole !");
			}
		}
	}
	if(dialogid == DIALOG_POLAGANJE2)// pitanja za auto
	{
	    if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "Pogrijesili ste pitanje te ste pali test!");
	    if(response)
	    {
	        SendClientMessage(playerid, 0xFFFFFFFF, "Tacan odgovor!");
	        ShowPlayerDialog(playerid, DIALOG_POLAGANJE3, DIALOG_STYLE_MSGBOX, "Test", "Da li smijete proci kroz semafor na crveno ako nema nikog u blizini?", "Da", "Ne");
	    }
	}
	if(dialogid == DIALOG_POLAGANJE3)
	{
	    if(response) return SendClientMessage(playerid, 0xFFFFFFFF, "Pogrijesili ste pitanje te ste pali test!");
	    if(!response)
	    {
	        SendClientMessage(playerid, 0xFFFFFFFF, "Tacan odgovor!");
	        ShowPlayerDialog(playerid, DIALOG_POLAGANJE4, DIALOG_STYLE_MSGBOX, "Test", "Kojom stranom se vozi u Los Santosu", "Ljevom", "Desnom");
	    }
	}
	if(dialogid == DIALOG_POLAGANJE4)
	{
	    if(response) return SendClientMessage(playerid, 0xFFFFFFFF, "Pogrijesili ste pitanje te ste pali test!");
	    if(!response)
	    {
	        SendClientMessage(playerid, 0xFFFFFFFF, "Tacan odgovor!");
	        ShowPlayerDialog(playerid, DIALOG_POLAGANJE5, DIALOG_STYLE_MSGBOX, "Test", "Maximalna brzina voznje po autocesti?", "120", "130");
	    }
	}
	if(dialogid == DIALOG_POLAGANJE5)
	{
	    if(response) return SendClientMessage(playerid, 0xFFFFFFFF, "Pogrijesili ste pitanje te ste pali test!");
	    if(!response)
	    {
	        SendClientMessage(playerid, 0xFFFFFFFF, "Polozili ste test ! (( /pautomobil pa odaberi Voznja da nastavis! ))");
	        PlayerInfo[playerid][pPolozioTestV] = 1;
	        Skola[playerid] = 1;
	    }
	}
	if(dialogid == DIALOG_POLAGANJEM1)// pitanja za motor
	{
	    if(listitem == 0)
	    {
			if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "Odustali ste od polaganja!");
			if(response)
			{
				if(PlayerInfo[playerid][pPolozioTestM] == 1)
				{
					SendClientMessage(playerid, 0xFFFFFFFF, "Vec ste polozili test!");
					return 1;
				}
				ShowPlayerDialog(playerid, DIALOG_POLAGANJEM2, DIALOG_STYLE_MSGBOX, "Test", "Da li su potrebna svjetla dok vozite motor?", "Da", "Ne");
			}
		}
		if(listitem == 1)
		{
		    if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "Odustali ste od polaganja!");
		    if(response)
		    {
				if(PlayerInfo[playerid][pMotor] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, " Vi vec imate vozacku !");
				PlayerInfo[playerid][pPolazeM] = 1;
				SendClientMessage(playerid, 0xFFFFFFFF, " Sjednite na jedan od motora !");
			}
		}
	}
	if(dialogid == DIALOG_POLAGANJEM2)
	{
	    if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "Pogrijesili ste pitanje te ste pali test!");
	    if(response)
	    {
	        SendClientMessage(playerid, 0xFFFFFFFF, "Tacan odgovor!");
	        ShowPlayerDialog(playerid, DIALOG_POLAGANJEM3, DIALOG_STYLE_MSGBOX, "Test", "Smije li se voziti bez kacige?", "Da", "Ne");
	    }
	}
	if(dialogid == DIALOG_POLAGANJEM3)
	{
	    if(response) return SendClientMessage(playerid, 0xFFFFFFFF, "Pogrijesili ste pitanje te ste pali test!");
	    if(!response)
	    {
	        SendClientMessage(playerid, 0xFFFFFFFF, "Tacan odgovor!");
	        ShowPlayerDialog(playerid, DIALOG_POLAGANJEM4, DIALOG_STYLE_MSGBOX, "Test", "Kojom stranom vozi motociklist", "Ljevom", "Desnom");
	    }
	}
	if(dialogid == DIALOG_POLAGANJEM4)
	{
	    if(response) return SendClientMessage(playerid, 0xFFFFFFFF, "Pogrijesili ste pitanje te ste pali test!");
	    if(!response)
	    {
	        SendClientMessage(playerid, 0xFFFFFFFF, "Tacan odgovor!");
	        ShowPlayerDialog(playerid, DIALOG_POLAGANJEM5, DIALOG_STYLE_MSGBOX, "Test", "Maximalna brzina voznje kroz naselje?", "40", "80");
	    }
	}
	if(dialogid == DIALOG_POLAGANJEM5)
	{
	    if(!response) return SendClientMessage(playerid, 0xFFFFFFFF, "Pogrijesili ste pitanje te ste pali test!");
	    if(response)
	    {
	        SendClientMessage(playerid, 0xFFFFFFFF, "Polozili ste test ! (( /pmotor pa odaberi Voznja da nastavis! ))");
	        PlayerInfo[playerid][pPolozioTestM] = 1;
	        Skola[playerid] = 2;
	    }
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)