Crear una ruta de checkpoints
#1

Buenas, estoy creando una ruta de CheckPoints para crear un job, los cmds van bien y etc... Pero fallo en la ruta.

Mi ruta esta echa asн
Код:
if(PlayerInfo[playerid][pJob] != JOB_LIMPIACALLES && Barrendero_Route[playerid] > 0)
	{
	    if(!IsPlayerInAnyVehicle(playerid)) { Message(playerid, COLOR_GRAD2, "No estбs en un Sweep!"); Barrendero_Route[playerid] = 0; return 1; }
	    if(Barrendero_Route[playerid] == 1)
	    {
	        SetTimerEx("SeCargoAgua", 10000,0, "dd", playerid);
	        GameTextForPlayer(playerid, "~w~Llenando limpiacalles con agua...", 10000, 3);
	        Barrendero_Route[playerid] = 2;
	        TogglePlayerControllable(playerid, 0);
    		SetPlayerCheckpoint(playerid, 2083.6611,-1810.1134,13.1079, 5.0);
	    }
	    else if(Barrendero_Route[playerid] == 2)
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 3;
	        SetPlayerCheckpoint(playerid, 1737.3975,-1444.1079,13.0850, 5.0);
	    }
	    else if(Barrendero_Route[playerid] == 3)
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 4;
	        SetPlayerCheckpoint(playerid, 1194.1522,-1320.9558,13.1232, 5.0); //
	    }
	    else if(Barrendero_Route[playerid] == 4)
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 5;
	        SetPlayerCheckpoint(playerid, 778.5972,-1319.2585,13.1283, 5.0);
	    }
	    else if(Barrendero_Route[playerid] == 5)
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 6;
	        SetPlayerCheckpoint(playerid, 1313.0157,-920.8329,37.9474, 5.0);
	    }
	    else if(Barrendero_Route[playerid] == 6)
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 7;
	        SetPlayerCheckpoint(playerid, 1345.8302,-1739.5684,13.1080, 5.0); //
	    }
	    else if(Barrendero_Route[playerid] == 7)
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 8;
	        SetPlayerCheckpoint(playerid, 1819.1550,-1844.9619,13.1392, 5.0);
	    }
	    else if(Barrendero_Route[playerid] == 8)
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 9;
	        SetPlayerCheckpoint(playerid, 2375.4473,-1905.2598,13.1080, 5.0);
	    }
	    else if(Barrendero_Route[playerid] == 9)
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 10;
	        SetPlayerCheckpoint(playerid, 1482.1899,-1729.7869,13.3828, 5.0); //
	    }
	    else if(Barrendero_Route[playerid] == 10)
	    {
	        Message(playerid, COLOR_ORANGE, "ЎHas terminado tu ruta, {FFFFFF}8/8{FF7F00}!");
            Message(playerid, COLOR_ORANGE, "ЎDirigete al lugar de trabajo a por la {FFFFFF}paga{FF7F00}!");
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 11;
	        SetPlayerCheckpoint(playerid, 1301.1799,-1867.0018,13.2720, 5.0);
	    }
	    else if(Barrendero_Route[playerid] == 11)
	    {
            Message(playerid, COLOR_ORANGE, "ЎTe pagaron {FFFFFF}$430 {FF7F00}por limpiar las calles.!");
            Message(playerid, COLOR_ORANGE, "ЎEstas cansado, vuelve a trabajar en {FFFFFF}30 {FF7F00}minutos!");
	        Barrendero_Route[playerid] = 0;
	        PlayerIsBarrendero[playerid] = 0;
	        YahicisteRuta[playerid] = 1;
	        //SetTimerEx("PuedesTrabajarDeNew",Yapuedestrabajar,playerid);
	        SetTimerEx("PuedesTrabajarDeNew", Yapuedestrabajar,0, "dd", playerid);
	        GivePlayerMoney(playerid, 430);
	        new carid = GetPlayerVehicleID(playerid);
			SetVehicleToRespawn(carid);
	    }
	}
Llego hasta el primer checkpoint en el cual "me tendrнa que congelar y salir un texto", lo pongo entre comillas por que lo que realmente hace no es ni eso, desaparece, supuestamente sigues haciendo la ruta, pero no te muestra mбs check points, intente crearlo asн...
Код:
	    if(IsPlayerInRangeOfPoint(playerid,5,2040.7101,-1930.1340,13.4667)) //Comienzo
	      if(Barrendero_Route[playerid] == 1)
		{
            SetTimerEx("SeCargoAgua", 10000,0, "dd", playerid);
	        GameTextForPlayer(playerid, "~w~Llenando limpiacalles con agua...", 10000, 3);
	        Barrendero_Route[playerid] = 2;
	        TogglePlayerControllable(playerid, 0);
    		SetPlayerCheckpoint(playerid, 2083.6611,-1810.1134,13.1079, 5.0);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,2083.6611,-1810.1134,13.1079)) // Segundo
		if(Barrendero_Route[playerid] == 2)
		{
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 3;
		    SetPlayerCheckpoint(playerid,1737.3975,-1444.1079,13.0850,5);
		}
Y sucesivamente, no se si seria la manera correcta, pero igualmente me da un huevo de errores, el otro por lo menos "hace algo".. Haber si alguien me puede echar un cable, se lo agradeceria
Reply
#2

Haber, si alguien me puede ayudar, e puesto el cуdigo asн.

El comando con el que empiezo la ruta.
Код:
CMD:barrer(playerid, params[])
{
   	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Tienes que estar logueado para usar el comando.");
   	if(PlayerInfo[playerid][pJob] != JOB_LIMPIACALLES && PlayerInfo[playerid][pVIPJob] != JOB_LIMPIACALLES) return SendClientMessage(playerid, COLOR_GREY, "No eres Limpia Calles.");
//    if(!IsPlayerInRangeOfPoint(playerid, 5, 1616.0538,-1896.8922,13.5490)) return SendClientMessage(playerid, COLOR_GREY, "No estбs en el lugar correcto para ponerte el uniforme.");
    if(PlayerIsBarrendero[playerid] == 1) return Message(playerid, COLOR_GRAD2, "Ya estбs limpiando las calles!");
    if(YahicisteRuta[playerid] > 0) return Message(playerid, COLOR_ORANGE, "Estas cansado, vuelve a {FFFFFF}trabajar {FF7F00}cuando hayas descansado.!");
    {
    PlayerIsBarrendero[playerid] = 1;
   	Barrendero_Route[playerid] = 1;
   	SetPlayerCheckpoint(playerid, 1918.6720,-1789.1630,13.1157, 5.0);
    SetPlayerSkin(playerid, 16);
    PlayerInfo[playerid][pModel] = 16;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sube al camiуn, llenalo de agua y comienza tu ruta");
	}
    return 1;
}
Despuйs la rita en su callback.
Код:
    if(PlayerInfo[playerid][pJob] != JOB_LIMPIACALLES && Barrendero_Route[playerid] > 0)
	{
        //if(CocheLimpiaCalles(vehicleid) && PlayerInfo[playerid][pJob] != JOB_LIMPIACALLES && Barrendero_Route[playerid] = 0; return 1; }
	    if(!IsPlayerInAnyVehicle(playerid)) { Message(playerid, COLOR_GRAD2, "No estбs en un limpiacalles!"); Barrendero_Route[playerid] = 0; return 1; }
	    {
	    if(IsPlayerInRangeOfPoint(playerid,5,2040.7101,-1930.1340,13.4667)) //Comienzo
		{
                SetTimerEx("SeCargoAgua", 10000,0, "dd", playerid);
	        GameTextForPlayer(playerid, "~w~Llenando limpiacalles con agua...", 10000, 3);
	        Barrendero_Route[playerid] = 2;
	        TogglePlayerControllable(playerid, 0);
    		SetPlayerCheckpoint(playerid, 2083.6611,-1810.1134,13.1079, 5.0);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,2083.6611,-1810.1134,13.1079)) // Segundo
		{
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 3;
		    SetPlayerCheckpoint(playerid,1737.3975,-1444.1079,13.0850,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1737.3975,-1444.1079,13.0850)) // Tercero
		{
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 4;
		    SetPlayerCheckpoint(playerid,1194.1522,-1320.9558,13.1232,5);
		}
		else if(IsPlayerInRangeOfPoint(playerid,5,1194.1522,-1320.9558,13.1232)) // Cuarto
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 5;
	        SetPlayerCheckpoint(playerid, 778.5972,-1319.2585,13.1283, 5.0);
	    }
		else if(IsPlayerInRangeOfPoint(playerid,5,778.5972,-1319.2585,13.1283)) // Quinto
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 6;
	        SetPlayerCheckpoint(playerid, 1313.0157,-920.8329,37.9474, 5.0);
	    }
		else if(IsPlayerInRangeOfPoint(playerid,5,1313.0157,-920.8329,37.9474)) // Sexto
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 7;
	        SetPlayerCheckpoint(playerid, 1345.8302,-1739.5684,13.1080, 5.0); //
	    }
		else if(IsPlayerInRangeOfPoint(playerid,5,1345.8302,-1739.5684,13.1080)) // Septimo
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 8;
	        SetPlayerCheckpoint(playerid, 1819.1550,-1844.9619,13.1392, 5.0);
	    }
		else if(IsPlayerInRangeOfPoint(playerid,5,1819.1550,-1844.9619,13.1392)) // Octavo
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 9;
	        SetPlayerCheckpoint(playerid, 2375.4473,-1905.2598,13.1080, 5.0);
	    }
		else if(IsPlayerInRangeOfPoint(playerid,5,2375.4473,-1905.2598,13.1080)) // Noveno
	    {
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 10;
	        SetPlayerCheckpoint(playerid, 1482.1899,-1729.7869,13.3828, 5.0);
	    }
	    else if(IsPlayerInRangeOfPoint(playerid,5,1482.1899,-1729.7869,13.3828)) // 10
	    {
	        Message(playerid, COLOR_ORANGE, "ЎHas terminado tu ruta, {FFFFFF}8/8{FF7F00}!");
            Message(playerid, COLOR_ORANGE, "ЎDirigete al lugar de trabajo a por la {FFFFFF}paga{FF7F00}!");
            PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0);
	        Barrendero_Route[playerid] = 11;
	        SetPlayerCheckpoint(playerid, 1301.1799,-1867.0018,13.2720, 5.0);
	    }
		else if(IsPlayerInRangeOfPoint(playerid,5,1301.1799,-1867.0018,13.2720)) // Septimo
	    {
            Message(playerid, COLOR_ORANGE, "ЎTe pagaron {FFFFFF}$430 {FF7F00}por limpiar las calles.!");
            Message(playerid, COLOR_ORANGE, "ЎEstas cansado, vuelve a trabajar en {FFFFFF}30 {FF7F00}minutos!");
	        Barrendero_Route[playerid] = 0;
	        PlayerIsBarrendero[playerid] = 0;
	        YahicisteRuta[playerid] = 1;
	        //SetTimerEx("PuedesTrabajarDeNew",Yapuedestrabajar,playerid);
	        SetTimerEx("PuedesTrabajarDeNew", Yapuedestrabajar,0, "dd", playerid);
	        GivePlayerMoney(playerid, 430);
			SetVehicleToRespawn(GetPlayerVehicleID(playerid));
			}
		}
	}
	else DisablePlayerCheckpoint(playerid);
	return 1;
}
Y despuйs, el public que haria congelarte para cargar el Sweep.
Код:
forward SeCargoAgua(playerid);
public SeCargoAgua(playerid)
{
TogglePlayerControllable(playerid, 1);
GameTextForPlayer(playerid, "~w~Limpiacalles Cargado", 3000, 3);
SendClientMessage(playerid, COLOR_GRAD2, "ЎЎSigue la ruta de Checkpoint!!");
return 1;
}
forward PuedesTrabajarDeNew(playerid);
public PuedesTrabajarDeNew(playerid)
{
YahicisteRuta[playerid] = 0;
Message(playerid, COLOR_ORANGE, "ЎYa puedes volver a {FFFFFF}trabajar {FF7F00}!");
return 1;
}
Funcionar... Bueno, se activa el primer check point, ni me congela ni nada de nada, solo desaparece, "supuestamente sigo haciendo la ruta", pero no salen los demбs check points haber si alguien me puede ayudar.
Reply
#3

A ver si alguien me puede ayudar... Por favor, gracias. :3
Reply
#4

pawn Код:
#include <a_samp>
#include <zcmd>
new RutaCP[MAX_PLAYERS],
bool:EstaEnRuta[MAX_PLAYERS];

COMMAND:comenzar(playerid, params[]){
    if(EstaEnRuta[playerid]) return SendClientMessage(playerid,-1,"INFO: Usted ya se encuentra en la ruta de CP!.");
    EstaEnRuta[playerid]=true;
    RutaCP[playerid]++;
    DisablePlayerCheckpoint(playerid);
    SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
    SendClientMessage(playerid,-1,"INFO: Usted ha comenzado la ruta de CP!.");
    return true;
}
COMMAND:terminar(playerid, params[]){
    if(!EstaEnRuta[playerid]) return SendClientMessage(playerid,-1,"INFO: Usted no se encuentra en la ruta de CP!.");
    EstaEnRuta[playerid]=false;
    RutaCP[playerid]=0;
    DisablePlayerCheckpoint(playerid);
    SendClientMessage(playerid,-1,"INFO: Usted ha terminado la ruta de CP!.");
    return true;
}

public OnPlayerEnterCheckpoint(playerid){
    switch(RutaCP[playerid]){
        case 1:{
            RutaCP[playerid]++;
            DisablePlayerCheckpoint(playerid);
            SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
            //TU FUNCION
        }
        case 2:{
            RutaCP[playerid]++;
            DisablePlayerCheckpoint(playerid);
            SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
            //TU FUNCION
        }
        case 3:{
            RutaCP[playerid]++;
            DisablePlayerCheckpoint(playerid);
            SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
            //TU FUNCION
        }
        case 4:{
            RutaCP[playerid]++;
            DisablePlayerCheckpoint(playerid);
            SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
            //TU FUNCION
        }
        case 5:{
            RutaCP[playerid]++;
            DisablePlayerCheckpoint(playerid);
            SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
            //TU FUNCION
        }
        case 6:{
            RutaCP[playerid]++;
            DisablePlayerCheckpoint(playerid);
            SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
            //TU FUNCION
        }
        case 7:{
            RutaCP[playerid]++;
            SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
            DisablePlayerCheckpoint(playerid);
            //TU FUNCION
        }
        case 8:{
            RutaCP[playerid]++;
            DisablePlayerCheckpoint(playerid);
            SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
            //TU FUNCION
        }
        case 9:{
            RutaCP[playerid]++;
            DisablePlayerCheckpoint(playerid);
            SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
            //TU FUNCION
        }
        case 10:{
            CallLocalFunction("OnPlayerCommandText", "is", playerid, "/terminar");
            //TU FUNCION
        }
    }
    return true;
}
https://sampwiki.blast.hk/wiki/SetPlayerCheckpoint
https://sampwiki.blast.hk/wiki/DisablePlayerCheckpoint
https://sampwiki.blast.hk/wiki/OnPlayerEnterCheckpoint
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)