[Help]IsPlayerInWater for Vehicles?
#1

Hi guys , so I've tried so much time to make IsPlayerInWater function for vehicles , when Someone touches the water (with vehicle) he dies (I'm scripting it for Destruction Derby gamemode) . I used This , but it doesn't work.

It's not sucessful. Can someone help ?
Reply
#2

If it's a destruction derby then your going to be confined to a specific area so why not just make a dynamic area where the water is and call it a day.
Reply
#3

just record the Z position of the water below the derby then check If They fell below that .. if your derby is above water i suppose
Reply
#4

Quote:
Originally Posted by whatthefuck123
Посмотреть сообщение
just record the Z position of the water below the derby then check If They fell below that .. if your derby is above water i suppose
Well , I just need to know how to make it right , like when he touches the water he dies. That's all what I want , but it's big problem for me.
Btw I am still not professional scripter , what's really impossible xD.
Reply
#5

Quote:
Originally Posted by luis_mendoza
Посмотреть сообщение
Well , I just need to know how to make it right , like when he touches the water he dies. That's all what I want , but it's big problem for me.
Btw I am still not professional scripter , what's really impossible xD.
Try to make it by using :
https://sampwiki.blast.hk/wiki/IsPlayerInAnyVehicle
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/SetPlayerHealth
Water floats
Код:
{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}
Reply
#6

go to the water and type /save
then go to your file last line (savedpositions.txt) and get your 3rd coord
pawn Код:
public OnPlayerUpdate(playerid)
{
new Float:z;
GetPlayerPos(playerid, z,z,z);
if(z<=/* ur coord*/)
{
   SendClientMessage(playerid, -1, "your in water");
}
return 1;
}
i hope you understand i cant make it clearer..
Reply
#7

Quote:
Originally Posted by whatthefuck123
Посмотреть сообщение
go to the water and type /save
then go to your file last line (savedpositions.txt) and get your 3rd coord
pawn Код:
public OnPlayerUpdate(playerid)
{
new Float:z;
GetPlayerPos(playerid, z,z,z);
if(z<=/* ur coord*/)
{
   SendClientMessage(playerid, -1, "your in water");
}
return 1;
}
i hope you understand i cant make it clearer..
Now it works fully ... Thank you
Reply
#8

Why do you even need OnPlayerUpdate or a timer for that?

When a vehicle enters the water, OnVehicleDeath is called so you will know that the vehicle either exploded or is in water. You also get the player's id through killerid!
Reply
#9

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Why do you even need OnPlayerUpdate or a timer for that?

When a vehicle enters the water, OnVehicleDeath is called so you will know that the vehicle either exploded or is in water. You also get the player's id through killerid!
not always... it doesnt always work when it goes in water i remember i was trying it once
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)