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; }
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;
}
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.9556, 14.0931, 0.0, 0, 0, 614.0005, -74.8299, 997.9922, 270.0. 2}, // Parking Taller LS 1
{1764.6918, -2048.8484, 14.1053, 0.0, 0, 0, 614.0005, -74.8299, 997.9922, 270.0. 2}, // Parking Taller LS 2
{1751.4443, -2053.9902, 14.1225, 0.0, 0, 0, 614.0005, -74.8299, 997.9922, 270.0. 2}, // Parking Taller LS 3
{1768.6816, -2019.7382, 14.1368, 0.0, 0, 0, 614.0005, -74.8299, 997.9922, 270.0. 2} // Parking Taller LS 4
};
stock PlayerIsNearParking(playerid)
{
for(new i; i != sizeof(ParkInfo); i++)
{
if(!IsPlayerInRangeOfPoint(playerid, 5.0, ParkInfo[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; i != sizeof(ParkInfo); i++)
{
if(!IsPlayerInRangeOfPoint(playerid, 5.0, ParkInfo[i][parkPosXX], ParkInfo[i][parkPosYY], ParkInfo[i][parkPosZZ]))
continue;
if(GetPlayerVirtualWorld(playerid) != i + 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(vehicleid, ParkInfo[id][parkPosXX], ParkInfo[id][parkPosYY], ParkInfo[id][parkPosZZ]);
SetVehicleZAngle(vehicleid, ParkInfo[id][parkPosAA]);
SetVehicleVirtualWorld(vehicleid, id + 20);
SetPlayerVirtualWorld(playerid, id + 20);
LinkVehicleToInteriorEx(vehicleid, ParkInfo[id][parkINTInt]);
SetPlayerInterior(playerid, ParkInfo[id][parkINTInt]);
}
else if((id = PlayerIsNearExitParking(playerid)) != -1){
SetVehiclePos(vehicleid, ParkInfo[id][parkPosX], ParkInfo[id][parkPosY], ParkInfo[id][parkPosZ]);
SetVehicleZAngle(vehicleid, ParkInfo[id][parkPosA]);
SetVehicleVirtualWorld(vehicleid, ParkInfo[id][parkVWExt]);
SetPlayerVirtualWorld(playerid, ParkInfo[id][parkVWExt]);
LinkVehicleToInteriorEx(vehicleid, ParkInfo[id][parkINTExt]);
SetPlayerInterior(playerid, ParkInfo[id][parkINTExt]);
}
else
{
SendClientMessage(playerid, Rojo, "* No estбs en la puerta de un parking.");
}
return 1;
}
Intenta con algo como esto:
PHP код:
|
creo que es la ъltima coma del enum, perdona que acб no me sale nada para compilar
|
No te parece que estas un poco retrasado usando strcmp?
No me refiero como insulto si no en cuanto a programaciуn. |