PDA

View Full Version : Detect player when fell at water off


leon44
03/10/2017, 03:14 AM
Hi, I have a mini derby game in my gamemode and and is missing that when a player throws other player off to water he will be as spectator, I just need that to complete it, but the player needs to be detected when is underwater and after that detection he will be auto killed.

DTV
03/10/2017, 03:21 AM
I've never made a detection script for something like that but something that I think can help is checking their position as whenever they're in the water, their z coord will be 0.0 or lower.

leon44
03/10/2017, 03:31 AM
I've never made a detection script for something like that but something that I think can help is checking their position as whenever they're in the water, their z coord will be 0.0 or lower.

I've thought in something like this but I don't know if it will work, check it out:

forward WaterDetection();
public WaterDetection()
{
new Float:Z;
for(new i; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
GetPlayerPos(i, Z, Z, Z);
if(Z < 0.0)
{
SetPlayerHealth(playerid, 0)
}
}
return 1;
}
What do you think? Any other better way to make it?

Dignity
03/10/2017, 03:46 AM
ColAndreas.


CA_IsPlayerNearWater(playerid)

leon44
03/10/2017, 04:07 AM
ColAndreas.


CA_IsPlayerNearWater(playerid)


But I don't wanna check if the player is near of water, I need it to check it when he's under water.

Dignity
03/10/2017, 04:10 AM
All water sources except the water behind the dam in Las Venturas are at 0.0, so you have to check below that.

The dam's water is at ~40.0, give or take a few.

Swankeh
03/10/2017, 04:14 AM
public OnPlayerUpdate(playerid){
new Float: PosX, Float: PosY, Float: PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
if(PosZ < 0.0){
SendClientMessage(playerid, -1, "You are in the water");
//Your Code.
}
return 1;
}

leon44
03/10/2017, 07:10 AM
public OnPlayerUpdate(playerid){
new Float: PosX, Float: PosY, Float: PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
if(PosZ < 0.0){
SendClientMessage(playerid, -1, "You are in the water");
//Your Code.
}
return 1;
}

It worked good, thank you mate :D +rep
By the way, just one more thing, can I create a timer to run the action I wanna take, for example: the player fell at the water off and after 5 seconds he will be automatically killed by setplayerhealth.

Dignity
03/10/2017, 07:11 AM
That won't work when you're behind the Las Venturas dam.

leon44
03/10/2017, 07:15 AM
That won't work when you're behind the Las Venturas dam.
So instead of 0.0 need I to put 40.0? Because I want this works in all waters.

Dignity
03/10/2017, 07:28 AM
Find a way to know when a player is behind the dam and then check for 40.0. The ColAndreas function I gave you is synced with the dam.

It has a range parameter, so doing will probably work:


CA_IsPlayerNearWater(playerid, 0.15 )

leon44
03/10/2017, 08:04 PM
I saw this searching and found this way (credits to Ballu Miaa):

stock IsVehicleInWater(vehicleid)
{
new Float:water_areas[][] =
{
{25.0, 2313.0, -1417.0, 23.0},
{15.0, 1280.0, -773.0, 1082.0},
{15.0, 1279.0, -804.0, 86.0},
{20.0, 1094.0, -674.0, 111.0},
{26.0, 194.0, -1232.0, 76.0},
{25.0, 2583.0, 2385.0, 15.0},
{25.0, 225.0, -1187.0, 73.0},
{50.0, 1973.0, -1198.0, 17.0}
};
for(new t=0; t < sizeof water_areas; t++)
if(GetVehicleDistanceFromPoint(vehicleid,water_are as[t][1],water_areas[t][2],water_areas[t][3]) <= water_areas[t][0]) return 1;
return 0;
}

and I made this in public OnVehicleDeath(vehicleid, killerid)
public OnVehicleDeath(vehicleid, killerid)
{
if(IsVehicleInWater(vehicleid))
{
SendClientMessageToAll(-1, "You fell");
SetPlayerHealth(playerid, 0.0);
}
return 1;
}

isnt it good? Because when I compile it shows me an error which is this:

error 017: undefined symbol "playerid"

Then I did this:

public OnVehicleDeath(playerid, vehicleid, killerid)

But got this error:

error 025: function heading differs from prototype

frouzen
03/10/2017, 10:18 PM
Can you share line number 17?

Swankeh
03/10/2017, 10:34 PM
I saw this searching and found this way (credits to Ballu Miaa):

stock IsVehicleInWater(vehicleid)
{
new Float:water_areas[][] =
{
{25.0, 2313.0, -1417.0, 23.0},
{15.0, 1280.0, -773.0, 1082.0},
{15.0, 1279.0, -804.0, 86.0},
{20.0, 1094.0, -674.0, 111.0},
{26.0, 194.0, -1232.0, 76.0},
{25.0, 2583.0, 2385.0, 15.0},
{25.0, 225.0, -1187.0, 73.0},
{50.0, 1973.0, -1198.0, 17.0}
};
for(new t=0; t < sizeof water_areas; t++)
if(GetVehicleDistanceFromPoint(vehicleid,water_are as[t][1],water_areas[t][2],water_areas[t][3]) <= water_areas[t][0]) return 1;
return 0;
}

and I made this in public OnVehicleDeath(vehicleid, killerid)
public OnVehicleDeath(vehicleid, killerid)
{
if(IsVehicleInWater(vehicleid))
{
SendClientMessageToAll(-1, "You fell");
SetPlayerHealth(playerid, 0.0);
}
return 1;
}

isnt it good? Because when I compile it shows me an error which is this:

error 017: undefined symbol "playerid"

Then I did this:

public OnVehicleDeath(playerid, vehicleid, killerid)

But got this error:

error 025: function heading differs from prototype


public OnVehicleDeath(vehicleid, killerid)
{
if(IsVehicleInWater(vehicleid))
{
SendClientMessageToAll(-1, "You fell");
SetPlayerHealth(killerid, 0.0);
}
return 1;
}

Dignity
03/10/2017, 11:06 PM
public OnVehicleDeath(vehicleid, killerid)
{
if(IsVehicleInWater(vehicleid))
{
SendClientMessageToAll(-1, "You fell");
SetPlayerHealth(killerid, 0.0);
}
return 1;
}


Lol are you okay

@OP:

public OnVehicleDeath(vehicleid, killerid)
{
if(IsVehicleInWater(vehicleid))
{
foreach(new playerid, Player) {
if ( GetPlayerVehicleID ( playerid ) == vehicleid ) {
SendClientMessage(playerid, -1, "You fell");
SetPlayerHealth(playerid, 0.0);
}
else continue ;
}
}
return 1;
}


Written on my phone, but should work. You’ll need foreach for this to work.

leon44
04/10/2017, 12:41 AM
Lol are you okay

@OP:

public OnVehicleDeath(vehicleid, killerid)
{
if(IsVehicleInWater(vehicleid))
{
foreach(new playerid, Player) {
if ( GetPlayerVehicleID ( playerid ) == vehicleid ) {
SendClientMessage(playerid, -1, "You fell");
SetPlayerHealth(playerid, 0.0);
}
else continue ;
}
}
return 1;
}


Written on my phone, but should work. You’ll need foreach for this to work.
Errors:
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(353) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(353) : error 017: undefined symbol "Iterator@new"
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(353) : error 036: empty statement
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(353) : warning 221: label name "_" shadows tag name
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(353) : error 017: undefined symbol "Player"
line:
foreach(new playerid, Player) { (And ye, I got the foreach include added on top but still those errores are there).

And by the way, I just remember something, I have races too and they work the same way as derby but the problem is that in certain parts you will need to go with boats, vortex and so on with vehicles that are used in water and I don't want that those vehicles to be detected by the antiwater, How can I exclude them?

Swankeh
04/10/2017, 12:46 AM
Errors:
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(353) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(353) : error 017: undefined symbol "Iterator@new"
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(353) : error 036: empty statement
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(353) : warning 221: label name "_" shadows tag name
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(353) : error 017: undefined symbol "Player"
line:
foreach(new playerid, Player) { (And ye, I got the foreach include added on top but still those errores are there).

And by the way, I just remember something, I have races too and they work the same way as derby but the problem is that in certain parts you will need to go with boats, vortex and so on with vehicles that are used in water and I don't want that those vehicles to be detected by the antiwater, How can I exclude them?


foreach(new playerid : Player) // :Go two dots and not a comma.

leon44
04/10/2017, 12:57 AM
foreach(new playerid : Player) // :Go two dots and not a comma.
error fixed but nothing happens when falling at water, I think I have everything well done, this is under everything:
stock IsVehicleInWater(vehicleid)
{
new Float:water_areas[][] =
{
{25.0, 2313.0, -1417.0, 23.0},
{15.0, 1280.0, -773.0, 1082.0},
{15.0, 1279.0, -804.0, 86.0},
{20.0, 1094.0, -674.0, 111.0},
{26.0, 194.0, -1232.0, 76.0},
{25.0, 2583.0, 2385.0, 15.0},
{25.0, 225.0, -1187.0, 73.0},
{50.0, 1973.0, -1198.0, 17.0}
};
for(new t=0; t < sizeof water_areas; t++)
if(GetVehicleDistanceFromPoint(vehicleid,water_are as[t][1],water_areas[t][2],water_areas[t][3]) <= water_areas[t][0]) return 1;
return 0;
}


In OnVehicleDeath:
public OnVehicleDeath(vehicleid, killerid)
{
if(IsVehicleInWater(vehicleid))
{
foreach(new playerid : Player)
{
if ( GetPlayerVehicleID ( playerid ) == vehicleid )
{
SendClientMessage(playerid, -1, "You fell");
SetPlayerHealth(playerid, 0.0);
}
else continue ;
}
}
return 1;
}
Am I missing something? Because when I put the first Swankeh's code in OnPlayerUpdate it worked but with this not, I mean this code:
public OnPlayerUpdate(playerid){
new Float: PosX, Float: PosY, Float: PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
if(PosZ < 0.0){
SendClientMessage(playerid, -1, "You are in the water");
//Your Code.
}
return 1;
}
But Dignity said isn't well made, so I put that other code but it doesn't want to work.

Swankeh
04/10/2017, 01:19 AM
error fixed but nothing happens when falling at water, I think I have everything well done, this is under everything:
stock IsVehicleInWater(vehicleid)
{
new Float:water_areas[][] =
{
{25.0, 2313.0, -1417.0, 23.0},
{15.0, 1280.0, -773.0, 1082.0},
{15.0, 1279.0, -804.0, 86.0},
{20.0, 1094.0, -674.0, 111.0},
{26.0, 194.0, -1232.0, 76.0},
{25.0, 2583.0, 2385.0, 15.0},
{25.0, 225.0, -1187.0, 73.0},
{50.0, 1973.0, -1198.0, 17.0}
};
for(new t=0; t < sizeof water_areas; t++)
if(GetVehicleDistanceFromPoint(vehicleid,water_are as[t][1],water_areas[t][2],water_areas[t][3]) <= water_areas[t][0]) return 1;
return 0;
}


In OnVehicleDeath:
public OnVehicleDeath(vehicleid, killerid)
{
if(IsVehicleInWater(vehicleid))
{
foreach(new playerid : Player)
{
if ( GetPlayerVehicleID ( playerid ) == vehicleid )
{
SendClientMessage(playerid, -1, "You fell");
SetPlayerHealth(playerid, 0.0);
}
else continue ;
}
}
return 1;
}
Am I missing something? Because when I put the first Swankeh's code in OnPlayerUpdate it worked but with this not, I mean this code:
public OnPlayerUpdate(playerid){
new Float: PosX, Float: PosY, Float: PosZ;
GetPlayerPos(playerid, PosX, PosY, PosZ);
if(PosZ < 0.0){
SendClientMessage(playerid, -1, "You are in the water");
//Your Code.
}
return 1;
}
But Dignity said isn't well made, so I put that other code but it doesn't want to work.

I think he mentioned that it did not work 100% because in the dam the water is higher, I know how to fix it.
I'll do the code again but I hope you want to detect if the player is in the water with a vehicle. Another thing is that for your Derby Demolition you do not believe the mappings for LV by the dam and use the first code that passes you so it would work 100%.

But if you used the position of the dam I recreate the code and let me know if it works okay?

Swankeh
04/10/2017, 01:25 AM
stock IsPlayerInWater(playerid)
{
new Float:water_areas[][] =
{
{25.0, 2313.0, -1417.0, 23.0},
{15.0, 1280.0, -773.0, 1082.0},
{15.0, 1279.0, -804.0, 86.0},
{20.0, 1094.0, -674.0, 111.0},
{26.0, 194.0, -1232.0, 76.0},
{25.0, 2583.0, 2385.0, 15.0},
{25.0, 225.0, -1187.0, 73.0},
{50.0, 1973.0, -1198.0, 17.0}
};
for(new t=0; t < sizeof water_areas; t++)
if(GetPlayerDistanceFromPoint(playerid,water_areas[t][1],water_areas[t][2],water_areas[t][3]) <= water_areas[t][0]) return 1;
return 0;
}

public OnPlayerUpdate(playerid){
if(IsPlayerInWater(playerid))
{
SendClientMessage(playerid, -1, "You are in the water");
}
return 1;
}



Use the same code as the other creator but I did it for player and not for vehicle test it and let me know if it works for you

leon44
04/10/2017, 01:51 AM
stock IsPlayerInWater(playerid)
{
new Float:water_areas[][] =
{
{25.0, 2313.0, -1417.0, 23.0},
{15.0, 1280.0, -773.0, 1082.0},
{15.0, 1279.0, -804.0, 86.0},
{20.0, 1094.0, -674.0, 111.0},
{26.0, 194.0, -1232.0, 76.0},
{25.0, 2583.0, 2385.0, 15.0},
{25.0, 225.0, -1187.0, 73.0},
{50.0, 1973.0, -1198.0, 17.0}
};
for(new t=0; t < sizeof water_areas; t++)
if(GetPlayerDistanceFromPoint(playerid,water_areas[t][1],water_areas[t][2],water_areas[t][3]) <= water_areas[t][0]) return 1;
return 0;
}

public OnPlayerUpdate(playerid){
if(IsPlayerInWater(playerid))
{
SendClientMessage(playerid, -1, "You are in the water");
}
return 1;
}



Use the same code as the other creator but I did it for player and not for vehicle test it and let me know if it works for you

It didn't work yet.

Swankeh
04/10/2017, 02:17 AM
It didn't work yet.

Then I recommend using the first code that happens to you, when you map the derby do it in Los Santos where there is water

leon44
04/10/2017, 03:25 AM
Then I recommend using the first code that happens to you, when you map the derby do it in Los Santos where there is water
Yeah I let it like that better, but as I said above, how can I do it only detects and kills vehicles of land and dont non water vehicles as in this case are the vortext, Squallo, predator, tropic, etc.? By doing it with the same code you gave to me.

frouzen
04/10/2017, 08:57 AM
Yeah I let it like that better, but as I said above, how can I do it only detects and kills vehicles of land and dont non water vehicles as in this case are the vortext, Squallo, predator, tropic, etc.? By doing it with the same code you gave to me.

public OnPlayerUpdate(playerid){
new Float: PosX, Float: PosY, Float: PosZ, vehicle;
GetPlayerPos(playerid, PosX, PosY, PosZ);
vehicle = GetPlayerVehicleID(playerid);
if(PosZ < 0.0){
if(GetVehicleModel(vehicle) == (539 || 446 || 430)) break; // add every vehicle id you wish to not destroy when you get in water
DestroyVehicle(vehicle);
SendClientMessage(playerid, -1, "You are in the water");
}
return 1;
}

kAn3
04/10/2017, 01:19 PM
You can use check for the player animation too

Mohaaaaaaaaaaa
04/10/2017, 05:34 PM
You can detect with swimming animation

leon44
04/10/2017, 06:12 PM
public OnPlayerUpdate(playerid){
new Float: PosX, Float: PosY, Float: PosZ, vehicle;
GetPlayerPos(playerid, PosX, PosY, PosZ);
vehicle = GetPlayerVehicleID(playerid);
if(PosZ < 0.0){
if(GetVehicleModel(vehicle) == (539 || 446 || 430)) break; // add every vehicle id you wish to not destroy when you get in water
DestroyVehicle(vehicle);
SendClientMessage(playerid, -1, "You are in the water");
}
return 1;
}
got this warning and error:
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(452) : warning 213: tag mismatch
D:\Escritorio\Carpetas Personales\Server\dm\gamemodes\dmrace.pwn(452) : error 024: "break" or "continue" is out of context
line:
if(GetVehicleModel(vehicle) == (539 || 446 || 430)) break;

leon44
04/10/2017, 10:11 PM
Bump!

frouzen
05/10/2017, 04:19 PM
Add this near the top of you script and add every boat.
new boats[] = {
539, 446, 430
};
And change the one I gave you to this.
public OnPlayerUpdate(playerid){
new Float: PosX, Float: PosY, Float: PosZ, vehicle;
GetPlayerPos(playerid, PosX, PosY, PosZ);
vehicle = GetPlayerVehicleID(playerid);
if(PosZ < 0.0){
for(new i; i<sizeof(boats); i++)
if(GetVehicleModel(vehicle) == boats[i]) return 1;
DestroyVehicle(vehicle);
SendClientMessage(playerid, -1, "You are in the water");
}
return 1;
}

frouzen
05/10/2017, 04:54 PM
I guess he can find a fix around that.

leon44
06/10/2017, 06:49 AM
Add this near the top of you script and add every boat.
new boats[] = {
539, 446, 430
};
And change the one I gave you to this.
public OnPlayerUpdate(playerid){
new Float: PosX, Float: PosY, Float: PosZ, vehicle;
GetPlayerPos(playerid, PosX, PosY, PosZ);
vehicle = GetPlayerVehicleID(playerid);
if(PosZ < 0.0){
for(new i; i<sizeof(boats); i++)
if(GetVehicleModel(vehicle) == boats[i]) return 1;
DestroyVehicle(vehicle);
SendClientMessage(playerid, -1, "You are in the water");
}
return 1;
}
Oh yeah it worked very well +REP
And ye, the problem is that the message kept spamming all the time, I mean, like an infinite loop it doesn't stop, why does it happen? I want an explication to understand and learn, if someone has a solution for that post it please :D

ToiletDuck
06/10/2017, 07:07 AM
Tempo fix.
public OnPlayerUpdate(playerid){
new Float: PosX, Float: PosY, Float: PosZ, vehicle;
GetPlayerPos(playerid, PosX, PosY, PosZ);
vehicle = GetPlayerVehicleID(playerid);
if(PosZ < 0.0){
for(new i; i<sizeof(boats); i++)
if(GetVehicleModel(vehicle) == boats[i]) return 1;
if(!GetPVarType(playerid, "InWater"))
{
DestroyVehicle(vehicle);
SendClientMessage(playerid, -1, "You are in the water");
SetPVarInt(playerid, "InWater", 1);
}
}
return 1;
}

then

SetPVarInt(playerid, "InWater", 0); // or
DeletePVarInt(playerid, "InWater");


Use this right after the game has started again.

leon44
06/10/2017, 08:22 AM
Tempo fix.
public OnPlayerUpdate(playerid){
new Float: PosX, Float: PosY, Float: PosZ, vehicle;
GetPlayerPos(playerid, PosX, PosY, PosZ);
vehicle = GetPlayerVehicleID(playerid);
if(PosZ < 0.0){
for(new i; i<sizeof(boats); i++)
if(GetVehicleModel(vehicle) == boats[i]) return 1;
if(!GetPVarType(playerid, "InWater"))
{
DestroyVehicle(vehicle);
SendClientMessage(playerid, -1, "You are in the water");
SetPVarInt(playerid, "InWater", 1);
}
}
return 1;
}

then

SetPVarInt(playerid, "InWater", 0); // or
DeletePVarInt(playerid, "InWater");


Use this right after the game has started again.
Hi mate, I put this:
SetPVarInt(playerid, "InWater", 0);
in:
forward StartMap(mapName[]);
public StartMap(mapName[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerPos(i, mapValues[pMX],mapValues[pMY],mapValues[pMZ]+3);
TogglePlayerControllable(i, false);
}
}
new string[156], mapN[256],mapN_4[156];
format(mapN,256,"DMRace/%s/objects.map",mapName);
if(LoadMap(mapN))
{
format(mapN2,156,"DMRace/%s/toptimes.txt",mapName);
SetPVarInt(playerid, "InWater", 0);
format(ServerData[Mapname],156,"%s",mapName);
StartRace(5000);
format(mapN_4,156,"DMRace/%s/meta.xml",mapName);
new XML:xml = xml_open(mapN_4);
if (xml)
{
new buf[100];
xml_get_string(xml, "meta/info", buf);
xml_get_string(xml, "meta/info/@name", buf);
format(string, sizeof string, "MAP: ~w~~h~%s", trcar(buf));
TextDrawSetString(MapText, string);
format(ServerData[mapXML],156,"%s",buf);
xml_close(xml);
}
}
return true;
}

This public function indicates that is starting a new map as you told me to put it right after the game has started again but got this error:
D:\Escritorio\Carpetas Personales\Server\dmserver\gamemodes\dmrace.pwn(30 0) : error 017: undefined symbol "playerid"
So to fix it I defined the public and forward like this:
forward StartMap(playerid, mapName[]);
public StartMap(playerid, mapName[])
but then I got this warning:
warning 202: number of arguments does not match definition

ToiletDuck
06/10/2017, 08:40 AM
forward StartMap(mapName[]);
public StartMap(mapName[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{

look at this one, you don't define playerid here instead you're looping players with using 'i' variable therefore you must change playerid to 'i'

SetPVarInt(playerid, "InWater", 0);

to

SetPVarInt(i, "InWater", 0);


you should put that in this code

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerPos(i, mapValues[pMX],mapValues[pMY],mapValues[pMZ]+3);
TogglePlayerControllable(i, false);
SetPVarInt(i, "InWater", 0);
}
}

Mohaaaaaaaaaaa
06/10/2017, 11:17 AM
stock IsPlayerInWater(playerid)
{
new anim = GetPlayerAnimationIndex(playerid);
if (((anim >= 1538) && (anim <= 1542)) || (anim == 1544) || (anim == 1250) || (anim == 1062)) return 1;
return 0;
}

OsmanMalagic
06/10/2017, 02:08 PM
stock IsPlayerInWater(playerid)
{
new anim = GetPlayerAnimationIndex(playerid);
if(anim >= 1538 && anim <= 1542 || anim == 1544 || anim == 1250 || anim == 1062)
{
return 1;
}
return 0;
}

if(IsPlayerInWater(playerid)) return SCM(playerid, COLOR_WHITE, "You are in water!");

leon44
06/10/2017, 09:17 PM
forward StartMap(mapName[]);
public StartMap(mapName[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{

look at this one, you don't define playerid here instead you're looping players with using 'i' variable therefore you must change playerid to 'i'

SetPVarInt(playerid, "InWater", 0);

to

SetPVarInt(i, "InWater", 0);


you should put that in this code

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SetPlayerPos(i, mapValues[pMX],mapValues[pMY],mapValues[pMZ]+3);
TogglePlayerControllable(i, false);
SetPVarInt(i, "InWater", 0);
}
}

Alright fixed that but nothing happens when I fell at water off.