TP'ing vehicle problem.
#1

Hey there, i made a feature for vip in my server in which they can tp their vehicle to their position after chosen from a dialog box, but it is not working it all says you have tped vehicle with id 0 to your position and not tping the car at all. Here is my code.
pawn Код:
else if(dialogid == 30)
    {
        if(response)
        {
            switch(listitem)
            {
                case 0:
                {
                    new veh, string[128];
                    if(!PlayerInfo[playerid][pVeh]) return SendClientMessage(playerid, COLOR_GREY, "You dont have a car in this slot.");
                    veh = PlayerInfo[playerid][pVeh];
                    new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
                    SetVehiclePos(veh, pos[0], pos[1], pos[2]);
                    LinkVehicleToInterior(veh, GetPlayerInterior(playerid));
                    format(string, sizeof(string), "You have teleported your %d id vehicle to you.", veh);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    return 1;
                }
                case 1:
                {
                    new veh, string[128];
                    if(!PlayerInfo[playerid][pVVeh]) return SendClientMessage(playerid, COLOR_GREY, "You dont have a car in this slot.");
                    veh = PlayerInfo[playerid][pVVeh];
                    new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
                    SetVehiclePos(veh, pos[0], pos[1], pos[2]);
                    LinkVehicleToInterior(veh, GetPlayerInterior(playerid));
                    format(string, sizeof(string), "You have teleported your %d id vehicle to you.", veh);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                    return 1;
                }
            }
           
        }
    }
Reply
#2

hmm, perhaps the worlds are still different.

add this to your code:

pawn Код:
SetVehicleVirtualWorld( veh, GetPlayerVirtualWorld( playerid ) );
Reply
#3

worked thanks. repped
Reply
#4

anytime.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)