SA-MP Forums Archive
Something about a derby... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Something about a derby... (/showthread.php?tid=143968)



Something about a derby... - Lorenc_ - 25.04.2010

I was making a derby today and then i was wondering if a player falls off the derby and on to the water. How do i make him suicide?

Im not sure if the function isplayerinarea would work



Re: Something about a derby... - Ibanez - 25.04.2010

pawn Код:
new Float:x, Float:y, Float:z;
for(new i = 0; i < MAX_PLAYERS; i++)
{
  GetPlayerPos(i, x, y, z);
  if(z < {COORD}) // change '{COORD}' to your Z co-ord of when they are in the water or just above the water
  {
    SetPlayerHealth(i, 0.0);
  }
}
Could do something like that in a timer?


Re: Something about a derby... - IamNotKoolllll - 25.04.2010

Quote:
Originally Posted by ((Lorenc))
I was making a derby today and then i was wondering if a player falls off the derby and on to the water. How do i make him suicide?

Im not sure if the function isplayerinarea would work
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(z = < -2)
{
SetPlayerHealth(playerid, 0.0);
}



Re: Something about a derby... - IamNotKoolllll - 25.04.2010

Quote:
Originally Posted by Geo_
pawn Код:
new Float:x, Float:y, Float:z;
for(new i = 0; i < MAX_PLAYERS; i++)
{
  GetPlayerPos(i, x, y, z);
  if(z < {COORD}) // change '{COORD}' to your Z co-ord of when they are in the water or just above the water
  {
    SetPlayerHealth(i, 0.0);
  }
}
Could do something like that in a timer?
dude i was posting D:


Re: Something about a derby... - Lorenc_ - 25.04.2010

ok cool ill check after


Re: Something about a derby... - Lorenc_ - 25.04.2010

Quote:
Originally Posted by Geo_
pawn Код:
new Float:x, Float:y, Float:z;
for(new i = 0; i < MAX_PLAYERS; i++)
{
  GetPlayerPos(i, x, y, z);
  if(z < {COORD}) // change '{COORD}' to your Z co-ord of when they are in the water or just above the water
  {
    SetPlayerHealth(i, 0.0);
  }
}
Could do something like that in a timer?
your code worked but

Quote:
Originally Posted by IamNotKoolllll
Quote:
Originally Posted by ((Lorenc))
I was making a derby today and then i was wondering if a player falls off the derby and on to the water. How do i make him suicide?

Im not sure if the function isplayerinarea would work
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(z = < -2)
{
SetPlayerHealth(playerid, 0.0);
}
your one didnt ...

and btw thanks for replying!