Como hago para que funcione como quiero..
#1

Hola! les pongo en situaciуn, mi servidor tendrб varios garajes pъblicos con el mismo interior que es un garaje un poco grande del mismo GTA, para cada garaje tiene un virtual world diferente, cuando pongo el comando para salir del garaje en vez de ponerme en el garaje que entrй me manda a otro cualquiera, el error es claro porque tiene el mismos interior y posiciуn de salida, como lo soluciono... asн es el comando

Код:
if(strcmp(cmd, "/parking", true) == 0) //Entrar a un parking pъblico o privado
{
	new coche = GetPlayerVehicleID(playerid);
	if(IsPlayerInRangeOfPoint(playerid, 4.0, 1764.6896,-2031.9556,14.0931)) //Parking Taller LS 1
	{
		SetVehiclePos(coche, 614.0005, -74.8299, 997.9922);
		SetVehicleZAngle(coche, 270);
	    SetVehicleVirtualWorld(coche, 0);
	    LinkVehicleToInteriorEx(coche, 2);
	    SetPlayerVirtualWorld(playerid, 0);
	    SetPlayerInterior(playerid, 2);
	}
	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1614.0005, -74.8299, 997.99221)) //Parking Taller LS 1 SALIDA
	{
		SetVehiclePos(coche, 1768.8580,-2031.7891,13.5896);
		SetVehicleZAngle(coche, 270);
	    SetVehicleVirtualWorld(coche, 0);
	    LinkVehicleToInteriorEx(coche, 0);
	    SetPlayerVirtualWorld(playerid, 0);
	    SetPlayerInterior(playerid, 0);
	}
	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1764.6918,-2048.8484,14.1053)) //Parking Taller LS 2
	{
		SetVehiclePos(coche, 614.0005, -74.8299, 997.9922);
		SetVehicleZAngle(coche, 270);
	    SetVehicleVirtualWorld(coche, 1);
	    LinkVehicleToInteriorEx(coche, 2);
	    SetPlayerVirtualWorld(playerid, 1);
	    SetPlayerInterior(playerid, 2);
	}

	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 614.0005, -74.8299, 997.9922)) //Parking Taller LS 2 Salida
	{
		SetVehiclePos(coche, 1764.6918,-2048.8484,14.1053);
		SetVehicleZAngle(coche, 270);
	    SetVehicleVirtualWorld(coche, 0);
	    LinkVehicleToInteriorEx(coche, 0);
	    SetPlayerVirtualWorld(playerid, 0);
	    SetPlayerInterior(playerid, 0);
	}
	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1751.4443,-2053.9902,14.1225)) //Parking Taller LS 3
	{
		SetVehiclePos(coche, 614.0005, -74.8299, 997.9922);
		SetVehicleZAngle(coche, 270);
	    SetVehicleVirtualWorld(coche, 2);
	    LinkVehicleToInteriorEx(coche, 2);
	    SetPlayerVirtualWorld(playerid, 2);
	    SetPlayerInterior(playerid, 2);
	}
	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 614.0005, -74.8299, 997.9922)) //Parking Taller LS 3 SALIDA
	{
		SetVehiclePos(coche, 1751.4443,-2053.9902,14.1225);
		SetVehicleZAngle(coche, 270);
	    SetVehicleVirtualWorld(coche, 0);
	    LinkVehicleToInteriorEx(coche, 0);
	    SetPlayerVirtualWorld(playerid, 0);
	    SetPlayerInterior(playerid, 0);
	}
	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1768.6816,-2019.7382,14.1368)) //Parking Taller LS 4
	{
		SetVehiclePos(coche, 614.0005, -74.8299, 997.9922);
		SetVehicleZAngle(coche, 270);
	    SetVehicleVirtualWorld(coche, 3);
	    LinkVehicleToInteriorEx(coche, 2);
	    SetPlayerVirtualWorld(playerid, 3);
	    SetPlayerInterior(playerid, 2);
	}
	else if(IsPlayerInRangeOfPoint(playerid, 4.0, 614.0005, -74.8299, 997.9922)) //Parking Taller LS 4 SALIDA
	{
		SetVehiclePos(coche, 1768.6816,-2019.7382,14.1368);
		SetVehicleZAngle(coche, 270);
	    SetVehicleVirtualWorld(coche, 0);
	    LinkVehicleToInteriorEx(coche, 0);
	    SetPlayerVirtualWorld(playerid, 0);
	    SetPlayerInterior(playerid, 0);
	}
	else
	{
		SendClientMessage(playerid, Rojo, "* No estбs en la puerta de un parking.");
	    return 1;
	}
	return 1;
}
Reply
#2

Deberнas comprobar en quй VW estб el jugador, quedando algo asн.
pawn Код:
if(strcmp(cmd, "/parking", true) == 0) //Entrar a un parking pъblico o privado
{
    new coche = GetPlayerVehicleID(playerid);
    if(IsPlayerInRangeOfPoint(playerid, 4.0, 1764.6896,-2031.9556,14.0931)) //Parking Taller LS 1
    {
        SetVehiclePos(coche, 614.0005, -74.8299, 997.9922);
        SetVehicleZAngle(coche, 270);
        SetVehicleVirtualWorld(coche, 0);
        LinkVehicleToInteriorEx(coche, 2);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 2);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1614.0005, -74.8299, 997.99221) && GetPlayerVirtualWorld(playerid) == 0) //Parking Taller LS 1 SALIDA
    {
        SetVehiclePos(coche, 1768.8580,-2031.7891,13.5896);
        SetVehicleZAngle(coche, 270);
        SetVehicleVirtualWorld(coche, 0);
        LinkVehicleToInteriorEx(coche, 0);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1764.6918,-2048.8484,14.1053)) //Parking Taller LS 2
    {
        SetVehiclePos(coche, 614.0005, -74.8299, 997.9922);
        SetVehicleZAngle(coche, 270);
        SetVehicleVirtualWorld(coche, 1);
        LinkVehicleToInteriorEx(coche, 2);
        SetPlayerVirtualWorld(playerid, 1);
        SetPlayerInterior(playerid, 2);
    }

    else if(IsPlayerInRangeOfPoint(playerid, 4.0, 614.0005, -74.8299, 997.9922) && GetPlayerVirtualWorld(playerid) == 1) //Parking Taller LS 2 Salida
    {
        SetVehiclePos(coche, 1764.6918,-2048.8484,14.1053);
        SetVehicleZAngle(coche, 270);
        SetVehicleVirtualWorld(coche, 0);
        LinkVehicleToInteriorEx(coche, 0);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1751.4443,-2053.9902,14.1225)) //Parking Taller LS 3
    {
        SetVehiclePos(coche, 614.0005, -74.8299, 997.9922);
        SetVehicleZAngle(coche, 270);
        SetVehicleVirtualWorld(coche, 2);
        LinkVehicleToInteriorEx(coche, 2);
        SetPlayerVirtualWorld(playerid, 2);
        SetPlayerInterior(playerid, 2);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 4.0, 614.0005, -74.8299, 997.9922) && GetPlayerVirtualWorld(playerid) == 2) //Parking Taller LS 3 SALIDA
    {
        SetVehiclePos(coche, 1751.4443,-2053.9902,14.1225);
        SetVehicleZAngle(coche, 270);
        SetVehicleVirtualWorld(coche, 0);
        LinkVehicleToInteriorEx(coche, 0);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 4.0, 1768.6816,-2019.7382,14.1368)) //Parking Taller LS 4
    {
        SetVehiclePos(coche, 614.0005, -74.8299, 997.9922);
        SetVehicleZAngle(coche, 270);
        SetVehicleVirtualWorld(coche, 3);
        LinkVehicleToInteriorEx(coche, 2);
        SetPlayerVirtualWorld(playerid, 3);
        SetPlayerInterior(playerid, 2);
    }
    else if(IsPlayerInRangeOfPoint(playerid, 4.0, 614.0005, -74.8299, 997.9922) && GetPlayerVirtualWorld(playerid) == 3) //Parking Taller LS 4 SALIDA
    {
        SetVehiclePos(coche, 1768.6816,-2019.7382,14.1368);
        SetVehicleZAngle(coche, 270);
        SetVehicleVirtualWorld(coche, 0);
        LinkVehicleToInteriorEx(coche, 0);
        SetPlayerVirtualWorld(playerid, 0);
        SetPlayerInterior(playerid, 0);
    }
    else
    {
        SendClientMessage(playerid, Rojo, "* No estбs en la puerta de un parking.");
        return 1;
    }
    return 1;
}
Reply
#3

Intenta con algo como esto:

PHP код:
enum Parking{
    
Float:parkPosX,
    
Float:parkPosY,
    
Float:parkPosZ,
    
Float:parkPosA,
    
parkINTExt,
    
parkVWExt,
    
Float:parkPosXX,
    
Float:parkPosYY,
    
Float:parkPosZZ,
    
Float:parkPosAA,
    
parkINTInt,
};
static 
ParkInfo[][Parking] = {
    
// EXTERIOR                                - INTERIOR
    // X        Y           Z        A  INT VW  XX        YY        ZZ        A      INT
    
{1764.6896, -2031.955614.09310.000614.0005, -74.8299997.9922270.02},     // Parking Taller LS 1
    
{1764.6918, -2048.848414.10530.000614.0005, -74.8299997.9922270.02},     // Parking Taller LS 2
    
{1751.4443, -2053.990214.12250.000614.0005, -74.8299997.9922270.02},     // Parking Taller LS 3
    
{1768.6816, -2019.738214.13680.000614.0005, -74.8299997.9922270.02}     // Parking Taller LS 4
};
stock PlayerIsNearParking(playerid)
{
    for(new 
i!= sizeof(ParkInfo); i++)
    {
        if(!
IsPlayerInRangeOfPoint(playerid5.0ParkInfo[i][parkPosX], ParkInfo[i][parkPosY], ParkInfo[i][parkPosZ]))
            continue;
        if(
GetPlayerVirtualWorld(playerid) != ParkInfo[i][parkVWExt])
            continue;
        if(
GetPlayerInterior(playerid) != ParkInfo[i][parkINTExt])
            continue;
        return 
i;
    }
    return -
1;
}
stock PlayerIsNearExitParking(playerid)
{
    for(new 
i!= sizeof(ParkInfo); i++)
    {
        if(!
IsPlayerInRangeOfPoint(playerid5.0ParkInfo[i][parkPosXX], ParkInfo[i][parkPosYY], ParkInfo[i][parkPosZZ]))
            continue;
        if(
GetPlayerVirtualWorld(playerid) != 20)
            continue;
        if(
GetPlayerInterior(playerid) != ParkInfo[i][parkINTInt])
            continue;
        return 
i;
    }
    return -
1;
}
if(
strcmp(cmd"/parking"true) == 0//Entrar a un parking pъblico o privado
{
    new
        
vehicleid GetPlayerVehicleID(playerid),
        
id = -1;
    if((
id PlayerIsNearParking(playerid)) != -1)
    {
        
SetVehiclePos(vehicleidParkInfo[id][parkPosXX], ParkInfo[id][parkPosYY], ParkInfo[id][parkPosZZ]);
        
SetVehicleZAngle(vehicleidParkInfo[id][parkPosAA]);
        
SetVehicleVirtualWorld(vehicleidid 20);
        
SetPlayerVirtualWorld(playeridid 20);
        
LinkVehicleToInteriorEx(vehicleidParkInfo[id][parkINTInt]);
        
SetPlayerInterior(playeridParkInfo[id][parkINTInt]);
    }
    else if((
id PlayerIsNearExitParking(playerid)) != -1){
        
SetVehiclePos(vehicleidParkInfo[id][parkPosX], ParkInfo[id][parkPosY], ParkInfo[id][parkPosZ]);
        
SetVehicleZAngle(vehicleidParkInfo[id][parkPosA]);
        
SetVehicleVirtualWorld(vehicleidParkInfo[id][parkVWExt]);
        
SetPlayerVirtualWorld(playeridParkInfo[id][parkVWExt]);
        
LinkVehicleToInteriorEx(vehicleidParkInfo[id][parkINTExt]);
        
SetPlayerInterior(playeridParkInfo[id][parkINTExt]);
    }
    else
    {
        
SendClientMessage(playeridRojo"* No estбs en la puerta de un parking.");
    }
    return 
1;

Reply
#4

Quote:
Originally Posted by _Zume
Посмотреть сообщение
Intenta con algo como esto:

PHP код:
enum Parking{
    
Float:parkPosX,
    
Float:parkPosY,
    
Float:parkPosZ,
    
Float:parkPosA,
    
parkINTExt,
    
parkVWExt,
    
Float:parkPosXX,
    
Float:parkPosYY,
    
Float:parkPosZZ,
    
Float:parkPosAA,
    
parkINTInt,
};
static 
ParkInfo[][Parking] = {
    
// EXTERIOR                                - INTERIOR
    // X        Y           Z        A  INT VW  XX        YY        ZZ        A      INT
    
{1764.6896, -2031.955614.09310.000614.0005, -74.8299997.9922270.02},     // Parking Taller LS 1
    
{1764.6918, -2048.848414.10530.000614.0005, -74.8299997.9922270.02},     // Parking Taller LS 2
    
{1751.4443, -2053.990214.12250.000614.0005, -74.8299997.9922270.02},     // Parking Taller LS 3
    
{1768.6816, -2019.738214.13680.000614.0005, -74.8299997.9922270.02}     // Parking Taller LS 4
};
stock PlayerIsNearParking(playerid)
{
    for(new 
i!= sizeof(ParkInfo); i++)
    {
        if(!
IsPlayerInRangeOfPoint(playerid5.0ParkInfo[i][parkPosX], ParkInfo[i][parkPosY], ParkInfo[i][parkPosZ]))
            continue;
        if(
GetPlayerVirtualWorld(playerid) != ParkInfo[i][parkVWExt])
            continue;
        if(
GetPlayerInterior(playerid) != ParkInfo[i][parkINTExt])
            continue;
        return 
i;
    }
    return -
1;
}
stock PlayerIsNearExitParking(playerid)
{
    for(new 
i!= sizeof(ParkInfo); i++)
    {
        if(!
IsPlayerInRangeOfPoint(playerid5.0ParkInfo[i][parkPosXX], ParkInfo[i][parkPosYY], ParkInfo[i][parkPosZZ]))
            continue;
        if(
GetPlayerVirtualWorld(playerid) != 20)
            continue;
        if(
GetPlayerInterior(playerid) != ParkInfo[i][parkINTInt])
            continue;
        return 
i;
    }
    return -
1;
}
if(
strcmp(cmd"/parking"true) == 0//Entrar a un parking pъblico o privado
{
    new
        
vehicleid GetPlayerVehicleID(playerid),
        
id = -1;
    if((
id PlayerIsNearParking(playerid)) != -1)
    {
        
SetVehiclePos(vehicleidParkInfo[id][parkPosXX], ParkInfo[id][parkPosYY], ParkInfo[id][parkPosZZ]);
        
SetVehicleZAngle(vehicleidParkInfo[id][parkPosAA]);
        
SetVehicleVirtualWorld(vehicleidid 20);
        
SetPlayerVirtualWorld(playeridid 20);
        
LinkVehicleToInteriorEx(vehicleidParkInfo[id][parkINTInt]);
        
SetPlayerInterior(playeridParkInfo[id][parkINTInt]);
    }
    else if((
id PlayerIsNearExitParking(playerid)) != -1){
        
SetVehiclePos(vehicleidParkInfo[id][parkPosX], ParkInfo[id][parkPosY], ParkInfo[id][parkPosZ]);
        
SetVehicleZAngle(vehicleidParkInfo[id][parkPosA]);
        
SetVehicleVirtualWorld(vehicleidParkInfo[id][parkVWExt]);
        
SetPlayerVirtualWorld(playeridParkInfo[id][parkVWExt]);
        
LinkVehicleToInteriorEx(vehicleidParkInfo[id][parkINTExt]);
        
SetPlayerInterior(playeridParkInfo[id][parkINTExt]);
    }
    else
    {
        
SendClientMessage(playeridRojo"* No estбs en la puerta de un parking.");
    }
    return 
1;

error 001: expected token: "}", but found "."
error 010: invalid function or declaration
Reply
#5

creo que es la ъltima coma del enum, perdona que acб no me sale nada para compilar
Reply
#6

Quote:
Originally Posted by _Zume
Посмотреть сообщение
creo que es la ъltima coma del enum, perdona que acб no me sale nada para compilar
Ya lo habнa solucionado, muchas gracias! reputaciуn.
Reply
#7

No te parece que estas un poco retrasado usando strcmp?

No me refiero como insulto si no en cuanto a programaciуn.
Reply
#8

Quote:
Originally Posted by Toolkit
Посмотреть сообщение
No te parece que estas un poco retrasado usando strcmp?

No me refiero como insulto si no en cuanto a programaciуn.
їcambio todo a CMD: o quй me recomiendas y porque?
Reply
#9

Quote:
Originally Posted by Fagrinht
Посмотреть сообщение
їcambio todo a CMD: o quй me recomiendas y porque?
Si, usa CMD es mucho mejor y mas rapido jaja aparte es mas facil.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)