SA-MP Forums Archive
Kill a player if he is in an area? - 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: Kill a player if he is in an area? (/showthread.php?tid=157962)



Kill a player if he is in an area? - Jantjuh - 08.07.2010

Hello,

I've got some little problems with my admin house.
I've made a simple map (a admin house) but i want that normal players get killed if they try to enter it ( so if they get in an area (IsPlayerInArea)).

I know that you need to do somethnig with if (isplayerinarea(playerid)) if isplayeradmin(playerid) else Setplayerhealth
etc, etc, etc.., but i can't get a working script. i hope someone could post some lines which i can edit to my co-ords
thankxxxx

offtopic: why is this: picture as an smiley in the new forum o_O xD


Re: Kill a player if he is in an area? - Lorenc_ - 08.07.2010

Do

pawn Код:
if(/* Playerinareafunction */)
{
       if(/* IsplayeradminCode */)
      {
       /* your code here*/
      }
}
else
{
SetPlayerHealth(playerid,0.0);
}
}
Just typed it from scratch now... Tell me if you get any errors for that..

Edit: soz for indention


Re: Kill a player if he is in an area? - Jantjuh - 08.07.2010

Quote:
Originally Posted by ((Lorenc))
Посмотреть сообщение
Do

pawn Код:
if(/* Playerinareafunction */)
{
       if(/* IsplayeradminCode */)
      {
       /* your code here*/
      }
}
else
{
SetPlayerHealth(playerid,0.0);
}
}
Just typed it from scratch now... Tell me if you get any errors for that..

Edit: soz for indention
oo thanx :S gonna try it out soon, but atm i cant get at my other pc with the scripts, >< i will pm you if it works


Re: Kill a player if he is in an area? - Lorenc_ - 08.07.2010

Alright, If it dosent Ill fix it for you