SA-MP Forums Archive
Help with garage and virtualworld - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with garage and virtualworld (/showthread.php?tid=263100)



Help with garage and virtualworld - Kenka - 20.06.2011

Hello, today i made a new system that allows me to buy a garage and enter there with car. I made every garage have it own virtualworld so it's easier to find something. Now i got it also working with "/v park" which saves my car virtualworld what is very good. Now when something happens with my car, i mean "/dropcar" or car explode which make car to "SetVehicleToRespawn" i want it also to save my virtualworld. I hope you can help me.


Re: Help with garage and virtualworld - Kenka - 20.06.2011

Bump! Can someone help me with respawning a car in a different virtualworld , not as usual it spawn to virtualworld 0


Re: Help with garage and virtualworld - =WoR=Varth - 20.06.2011

SetVehicleVirtualWorld(vehicleid, worldid);
GetVehicleVirtualWorld(vehicleid);


Re: Help with garage and virtualworld - Kenka - 21.06.2011

i tried many ways but nothing. I also made new system that saves vehicle Virtualworld into cars.cfg when i use /v park.
This is my code :
pawn Код:
if(strcmp(cmd, "/respawnthiscar", true) == 0 || strcmp(cmd, "/rtc", true) == 0) //by Ellis
    {
        new carid;
        if(IsPlayerConnected(playerid))
        if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
        else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
        else { return 1; }
        {
            if(PlayerInfo[playerid][pAdmin] < 2 )
            {
                SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
                return 1;
            }
            if(IsPlayerInAnyVehicle(playerid))
            {
                GetPlayerName(playerid, sendername, sizeof(sendername));
                format(string, 256, "[ADMIN] %s has just respawned vehicle id %d.",sendername,GetPlayerVehicleID(playerid));
                ABroadCast(COLOR_YELLOW,string,1);
                SetVehicleToRespawn(GetPlayerVehicleID(playerid));
                RemovePlayerFromVehicle(playerid);
                SendClientMessage(playerid, COLOR_GREY, "   Vehicle Respawned !");
                SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), CarInfo[carid][cVw]);
            }
        }
        return 1;
    }
CarInfo[carid][cVw]); is saved virtualworld for car in cars.cfg. When i type /rtc i want it to getvehiclevirtualworld from [cVw] and SetVehicleToRespawn with this virtualworld but it spawns my car in virtualworld that i'm currently in.