09.10.2011, 00:52
Hello, im creating a simple garage system but im having some problems because of the virtual worlds/cars
Here is my commands
Im using virtual worlds so i can use the same interior to diferent garages.
Garage Entering
Well its working but when i /park my car inside it dissapears like its going to another virtual world. i have a parking command that sets the virtual world and saves it.
Here it is.
The problem is that the car persists to dissapear when i /estacionar (same as parking the car)
Can someone help me figuring this out please ?
Here is my commands
Im using virtual worlds so i can use the same interior to diferent garages.
Garage Entering
Quote:
if(strcmp(cmd, "/garagementrar", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsPlayerInRangeOfPoint(playerid, 2,2517.5398,-1672.8455,14.0902))//Entrada Fora da Garagem { if(PlayerInfo[playerid][pPhousekey] == 85 || HouseInfo[85][hLock] == 0)//Id Da Casa { new tmpcar = GetPlayerVehicleID(playerid); SetVehiclePos(tmpcar, 613.2441,-77.9010,997.8310);//Dentro Da Garagem TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0; LinkVehicleToInterior(tmpcar, 2); SetPlayerVirtualWorld(playerid, 1); SetVehicleVirtualWorld(tmpcar, 1); SetPlayerInterior(playerid,2);//Interior GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* O Portгo da Garagem Abre-se. (( %s ))", sendername); } if (GetPlayerState(playerid) == 1)//Entrada Sem Carro { SetPlayerPos(playerid, 613.2441,-77.9010,997.8310); SetPlayerVirtualWorld(playerid, 1);//Virtual World Da Garagem SetPlayerInterior(playerid,2);//Interior } //SafeSetPlayerInterior(playerid,0); //DisablePlayerCheckpoint(playerid); } else { SendClientMessage(playerid, COLOR_YELLOW, "** Nгo Te Encontras Perto De Uma Garagem Ou Nгo Possuis Uma !"); return 1; } } return 1; } |
Here it is.
Quote:
if(strcmp(cmd, "/estacionar", true) == 0 || strcmp(cmd, "/estacionar", true) == 0) // By LordMan { if(IsPlayerConnected(playerid)) { if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, " You need to login first ! "); return 1; } new Float,Float:y,Float:z; new Float:a; new carid; new getcarid; if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; } else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; } else { return 1; } getcarid = GetPlayerVehicleID(playerid); //GetPlayerVirtualWorld(playerid)); GetPlayerName(playerid, playername, sizeof(playername)); GetVehiclePos(carid, x, y, z); //GetPlayerFacingAngle(playerid, a); GetVehicleZAngle(carid, a); if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1) { if(PlayerInfo[playerid][pPcarkey] == 999 && PlayerInfo[playerid][pPcarkey2] == 999) { SendClientMessage(playerid, COLOR_GREY, "Este veнculo nгo estб registado em teu nome."); return 1; } if(getcarid == carid) { CarInfo[carid][cLocationx] = x; CarInfo[carid][cLocationy] = y; CarInfo[carid][cLocationz] = z; CarInfo[carid][cAngle] = a; format(string, sizeof(string), "~n~ Estacionas-te o teu veiculo aqui. ~n~"); GameTextForPlayer(playerid, "Estacionas-te o teu veiculo aqui.", 10000, 3); OnPropUpdate(4); OnPlayerUpdateEx(playerid); DestroyVehicle(carid); CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000); if(CarInfo[carid][cPaintjob] != 999) { ChangeVehiclePaintjob(carid, CarInfo[carid][cPaintjob]); } SetVehicleVirtualWorld(carid, CarInfo[carid][cVirWorld]); SetVehicleModifications(carid); TogglePlayerControllable(playerid, 1); PutPlayerInVehicle(playerid, carid, 0); return 1; } } } } |
Can someone help me figuring this out please ?