Strange problem with PutPlayerInVehicle
#1

Hey,

I have two different functions running the same command, the first one is a simple command script I made. Command that runs PutPlayerInVehicle(playerid,vehicle, 0); // vehicleid previously defined.
That works great!

The exact same command is created from a dialog, and it goes funny, the driver of the gets teleported on top of the car and then when he/she press's F or the exit vehicle button, it appears as though they are exiting.

Any ideas?

SCRIPT:

Command, works fine:
pawn Код:
for(new response = 0; response < sizeof(Tele); response++) {
        if(strcmp(cmdtext, Tele[response][TeleCmd], true) == 0) {
                new vehicleid = GetPlayerVehicleID(playerid);
                SetPlayerPos(playerid, Tele[response][TeleX], Tele[response][TeleY], Tele[response][TeleZ]);
                if(IsPlayerInAnyVehicle(playerid)) {
                    SetVehiclePos(vehicleid,Tele[response][TeleX], Tele[response][TeleY], Tele[response][TeleZ]);
                    PutPlayerInVehicle(playerid,vehicleid, 0);
                }
                new string[100];
                GetPlayerName(playerid, pname, sizeof(pname));
                format(string, sizeof(string), "[TELE] - [%s] %s has teleported to %s", Tele[response][TeleCmd], pname, Tele[response][TeleName]);
                SendClientMessageToAll(COLOR_SYSTEM, string);
                format(string, sizeof(string), "Welcome to %s", Tele[response][TeleName]);
                SendClientMessage(playerid, COLOR_SUCCESS, string);
                AntiTeleSpawn[playerid] = 1;
            //  SetTimerEx("SafetyDelay", 2500, false, "i", playerid);
                return 1;

           }
}
Dialog: (The one that doesn't work)
pawn Код:
if(dialogid == DIALOG_TELES)
    {
        if(!response) return SendClientMessage(playerid, COLOR_FAIL, "You closed the tele menu, press Y to open it at any time");
        else {
            if(Stunt_FirstSpawn[playerid] == 1) { SpawnPlayer(playerid); }
            new vehicleid = GetPlayerVehicleID(playerid);
            SetPlayerPos(playerid, Tele[listitem][TeleX], Tele[listitem][TeleY], Tele[listitem][TeleZ]);
            if(IsPlayerInAnyVehicle(playerid)) {
                SetVehiclePos(vehicleid,Tele[listitem][TeleX], Tele[listitem][TeleY], Tele[listitem][TeleZ]);
                PutPlayerInVehicle(playerid,vehicleid, 0); // Does not work.
            }
            new string[100];
            GetPlayerName(playerid, pname, sizeof(pname));
            format(string, sizeof(string), "[TELE] - [%s] %s has teleported to %s", Tele[listitem][TeleCmd], pname, Tele[listitem][TeleName]);
            SendClientMessageToAll(COLOR_SYSTEM, string);
            format(string, sizeof(string), "Welcome to %s", Tele[listitem][TeleName]);
            SendClientMessage(playerid, COLOR_SUCCESS, string);
        }
    }
Regards

Matthew
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)