Created by OhManMyBad
Description:
This pretty simple, but very cool in my opinion. I saw a video of some menu coming out and this feature caught my eye, but it was a "premium" menu...so I decided to recreate this illusion instead. Only one caveat which should be mentioned - if you wish to venture below sea level (tunnels/subway/etc) you need to disable it on your car using the button combo. I included notes in the source below to "fix" this if you choose, but I did not like the resulting effect (explained).
Features & Details:
- One vehicle at a time
- Enable/Disable: DPAD_DOWN + R1 + O (or the xbox equivalent)
- Get in a vehicle and use the button combo to enable
- Drive onto the water! (or let your friends drive, you don't have to be in the car after it's enabled)
- Disable and fall into the water, or allow tunnel/below sea level ground access
- Tested to work on all versions of GTA
Video:
Source:
Spoiler
#include <natives.h>
#include <strings.h>
#include <types.h>
#include <consts.h>
// credits
#define TITLE "~b~Drive on Water * Created by ~r~OhManMyBad"
#define BUTTONS "~b~Enable/Disable: ~PAD_DPAD_DOWN~ + ~PAD_RB~ + ~PAD_B~"
//PS3 Buttons
#define DPAD_UP 0x8
#define DPAD_DOWN 0x9
#define DPAD_LEFT 0xA
#define DPAD_RIGHT 0xB
#define L1 0x4
#define R1 0x6
#define L2 0x5
#define R2 0x7
#define L3 0x12
#define R3 0x13
#define START 0xC
#define SELECT 0xD
#define SQUARE 0xE
#define TRIANGLE 0xF
#define X 0x10
#define CIRCLE 0x11
float sealevel = -9.2; // if doing the 'fix', lower to -9.3ish
bool driveit = false;
int nvid, i, tick;
float x,y,z;
Player pPlayer;
Vehicle watercar;
Object tank;
void print(char* text){
CLEAR_PRINTS();
PRINT_STRING_WITH_LITERAL_STRING("string",text,3000,true);
}
Player GetPlayerIndex(void){
return GET_PLAYER_ID();
}
Ped GetPlayerPed(void){
Ped playerped = INVALID_HANDLE;
if(PLAYER_HAS_CHAR(GetPlayerIndex()))
GET_PLAYER_CHAR(GetPlayerIndex(), &playerped);
return playerped;
}
void main(void){
THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME();
print(TITLE); WAIT(3000);
print(BUTTONS);
do{
WAIT(0);
pPlayer = GetPlayerPed();
if(IS_BUTTON_PRESSED(0,DPAD_DOWN) && IS_BUTTON_PRESSED(0,R1) && IS_BUTTON_JUST_PRESSED(0,CIRCLE)){
if(!driveit){
if(IS_CHAR_IN_ANY_CAR(pPlayer)){
GET_CAR_CHAR_IS_USING(pPlayer,&watercar);
driveit = true;
print("~b~Water driving enabled on this vehicle");
}
else print("~r~You must be inside a vehicle to enable water driving");
}
else{
if(DOES_OBJECT_EXIST(tank)) DELETE_OBJECT(&tank);
driveit = false;
print("~b~Water driving disabled");
}
}
if(driveit){
if(!DOES_VEHICLE_EXIST(watercar)){
if(DOES_OBJECT_EXIST(tank)) DELETE_OBJECT(&tank);
driveit = false;
}
else{
/* fix: using 'else if(IS_CAR_IN_WATER(watercar))' above instead, allows for you
to drive in tunnels/below sea level even when drive on water is enabled, but causes
your car to skip through the water due to it waiting for the vehicle to touch the
water to update the tank's position */
GET_CAR_COORDINATES(watercar, &x, &y, &z);
if(!DOES_OBJECT_EXIST(tank)){
REQUEST_MODEL(0x4F9981BE);
while(!HAS_MODEL_LOADED(0x4F9981BE)) WAIT(0);
CREATE_OBJECT(0x4F9981BE, x, y, sealevel, &tank, true);
MARK_MODEL_AS_NO_LONGER_NEEDED(0x4F9981BE);
SET_OBJECT_VISIBLE(tank, false);
SET_OBJECT_INVINCIBLE(tank, true);
GET_NETWORK_ID_FROM_OBJECT(tank, &nvid);
SET_NETWORK_ID_CAN_MIGRATE(nvid, false);
}
else{
SET_OBJECT_COORDINATES(tank, x, y, sealevel);
FREEZE_OBJECT_POSITION(tank, true);
}
}
}
} while(true);
}
Thanks:
InTheSevens (video & testing)
Taco Bell (fourthmeal)
Download: drive_on_water.sco








Recent Threads

Recent Comments
vBulletin Message