Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" SVehicle+ by System32");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys == KEY_SUBMISSION)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- RepairVehicle(GetPlayerVehicleID(playerid));
- }
- }
- }
- if (newkeys & KEY_ACTION)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new Float:x, Float:y, Float:z;
- GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z);
- SetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z + 0.3);
- }
- }
- if(newkeys & KEY_CROUCH)
- {
- new Float:X, Float:Y, Float:Z, Float:Angle; GetPlayerPos(playerid, X, Y, Z);
- GetVehicleZAngle(GetPlayerVehicleID(playerid), Angle); SetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z); SetVehicleZAngle(GetPlayerVehicleID(playerid), Angle);
- }
- if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER || !CheckNitro(GetPlayerVehicleID(playerid))) return false; else if ((((newkeys & (4)) == (4)) && ((oldkeys & (4)) != (4)))) AddVehicleComponent(GetPlayerVehicleID(playerid), 1010); else if ((((newkeys & (4)) != (4)) && ((oldkeys & (4)) == (4)))) RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
- return 1;
- }
- stock CheckNitro(vid)
- {
- new NoNitro[] = { 522,481,441,468,448,446,513,521,510,430,520,476,463 }; // unknown
- for(new e = 0; e < sizeof(NoNitro); e++) if(GetVehicleModel(vid) == NoNitro[e]) return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement