SA-MP Forums Archive
[SUGGESTION]Drive-By Hiding - 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: [SUGGESTION]Drive-By Hiding (/showthread.php?tid=198316)



[SUGGESTION]Drive-By Hiding - Riddick94 - 11.12.2010

Hey..

What about a Hiding Passanger back from the Drive By mode? After press Key_Horn backs to normal position in the vehicle. It can be very useful and better than exit/enter car.


Re: [SUGGESTION]Drive-By Hiding - case 1337: - 11.12.2010

It's possible, detect if player is passenger then use GetPlayerSeat then PutPlayerInVehicle again when you press KEY_HORN.


Re: [SUGGESTION]Drive-By Hiding - Grim_ - 11.12.2010

Can't you re-press the button that sent you into drive-by mode to do this?


Re: [SUGGESTION]Drive-By Hiding - [03]Garsino - 11.12.2010

You can press enter, but then again you can't go into driveby mode again before re-entering the car :P


Re: [SUGGESTION]Drive-By Hiding - Riddick94 - 11.12.2010

Quote:
Originally Posted by case 1337:
Посмотреть сообщение
It's possible, detect if player is passenger then use GetPlayerSeat then PutPlayerInVehicle again when you press KEY_HORN.
A function to get Seat? is.. GetPlayerSeat?


Re: [SUGGESTION]Drive-By Hiding - case 1337: - 11.12.2010

Quote:
Originally Posted by Riddick94
Посмотреть сообщение
A function to get Seat? is.. GetPlayerSeat?
GetPlayerVehicleSeat, sorry.


Re: [SUGGESTION]Drive-By Hiding - Scenario - 11.12.2010

You could always do this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/remove", cmdtext, true, 10) == 0)
    {
        SetPVarInt(playerid, "CurrentVehicle", GetPlayerVehicleID(playerid));
        SetPVarInt(playerid, "CurrentVehSeat", GetPlayerVehicleSeat(playerid));
        RemovePlayerFromVehicle(playerid);
        PutPlayerInVehicle(playerid, GetPVarInt(playerid, "CurrentVehicle"), GetPVarInt(playerid, "CurrentVehSeat"));
        return 1;
    }
    return 0;
}



Re: [SUGGESTION]Drive-By Hiding - Riddick94 - 11.12.2010

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
You could always do this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/remove", cmdtext, true, 10) == 0)
    {
        SetPVarInt(playerid, "CurrentVehicle", GetPlayerVehicleID(playerid));
        SetPVarInt(playerid, "CurrentVehSeat", GetPlayerVehicleSeat(playerid));
        RemovePlayerFromVehicle(playerid);
        PutPlayerInVehicle(playerid, GetPVarInt(playerid, "CurrentVehicle"), GetPVarInt(playerid, "CurrentVehSeat"));
        return 1;
    }
    return 0;
}
Eh.. try to re-Drive By after do that.


Re: [SUGGESTION]Drive-By Hiding - Sergei - 12.12.2010

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
You could always do this:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/remove", cmdtext, true, 10) == 0)
    {
        SetPVarInt(playerid, "CurrentVehicle", GetPlayerVehicleID(playerid));
        SetPVarInt(playerid, "CurrentVehSeat", GetPlayerVehicleSeat(playerid));
        RemovePlayerFromVehicle(playerid);
        PutPlayerInVehicle(playerid, GetPVarInt(playerid, "CurrentVehicle"), GetPVarInt(playerid, "CurrentVehSeat"));
        return 1;
    }
    return 0;
}
Is it just me, or this is really bad example?


Re: [SUGGESTION]Drive-By Hiding - CaHbKo - 12.12.2010

Quote:
Originally Posted by Sergei
Посмотреть сообщение
Is it just me, or this is really bad example?
It is a bad example. This is a good example:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/remove", cmdtext, true, 10) == 0)
    {
        new veh =  GetPlayerVehicleID(playerid);
        new seat = GetPlayerVehicleSeat(playerid);
        new Float:pos[3];
        GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        SetPlayerPos(playerid, pos[0], pos[1], pos[2]);
        PutPlayerInVehicle(playerid, veh, seat);
        return 1;
    }
    return 0;
}