Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dontfalloff>
- new PlayerVehicle[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Don't Fall Off from bikes");
- print("---------------------------------------");
- print(" You can't teleport out players from vehicle");
- print(" and you can't use RemovePlayerFromVehicle");
- print("--------------------------------------");
- print(" But you can teleport players with vehicles");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- PlayerVehicle[playerid] = -1;
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
- {
- PlayerVehicle[playerid] = GetPlayerVehicleID(playerid);
- }
- if(oldstate == PLAYER_STATE_DRIVER)
- {
- if(PlayerVehicle[playerid] != -1)
- {
- PutPlayerInVehicle(playerid, PlayerVehicle[playerid], 0);
- }
- }
- if(oldstate == PLAYER_STATE_PASSENGER)
- {
- if(PlayerVehicle[playerid] != -1)
- {
- PutPlayerInVehicle(playerid, PlayerVehicle[playerid], 1);
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/removecar", cmdtext, true, 10) == 0)
- {
- PlayerVehicle[playerid] = -1;
- RemovePlayerFromVehicle(playerid);
- return 1;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment