SA-MP Forums Archive
when u try to use teleports it wont let u intill get health? any one? - 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: when u try to use teleports it wont let u intill get health? any one? (/showthread.php?tid=64731)



when u try to use teleports it wont let u intill get health? any one? - Barrio - 07.02.2009

does any one know how to make a teleport make u get health before u use it? like so if ur fighting with someone and u whant to scape so u dont get killed and whant to use the teleport but it says u need to get health before using this command.. does anyone know how to do it like .....
ex: ifcommand..etc..etc../lv..etc..
IfPlayerHealth(playerid,50.0)etc...
senplayertext(playerid,)("your not aloud to use this get full health")


does any one know how to finish the command? or wat line to add so they cant tele if there health is low?


Re: when u try to use teleports it wont let u intill get health? any one? - Mikep - 07.02.2009

https://sampwiki.blast.hk/wiki/GetPlayerHealth


Re: when u try to use teleports it wont let u intill get health? any one? - Barrio - 07.02.2009

Quote:
Originally Posted by Mikeshake
thanks man!!! so if i what my cmd to not work if player health low how top make it?

if(strcmp(text, "/lv", true)
{
new Float:health;
GetPlayerHealth(playerid,health);
if (health < 50.0)
{
GameTextForPlayer(playerid,"GET HEALTH FIRST BEFORE USE OF TELEPORT",2500,3);}
}
else if SetPlayerPos(playerid,-697.7722,950.7226,12.0102);
return 1;}
}





i tried that but wont work :S


Re: when u try to use teleports it wont let u intill get health? any one? - ICECOLDKILLAK8 - 07.02.2009

pawn Код:
if(strcmp(text, "/lv", true)
{
  new Float:health;
  GetPlayerHealth(playerid,health);
  if(health >= 50)
  {
    SetPlayerPos(playerid,-697.7722,950.7226,12.0102);
  }
  else
  {
    SendClientMessage(playerid, w/e color, "You are not allowed to TP ATM");
  }
  return 1;
}



Re: when u try to use teleports it wont let u intill get health? any one? - Barrio - 07.02.2009

Quote:
Originally Posted by JeNkStAX
[pawn]
if(strcmp(text, "/lv", true)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health >= 50)
{
SetPlayerPos(playerid,-697.7722,950.7226,12.0102);
}
else
{
SendClientMessage(playerid, w/e color, "You are not allowed to TP ATM");
}
return 1;
}
dude thanks so much JeNkStaX i ow u one dude thanks it complied im going to try it thanks again!!


Re: when u try to use teleports it wont let u intill get health? any one? - Barrio - 07.02.2009

hey it worked, is there a way to make ALL of my teleports do thsi instead of adding the code to each of them?


Re: when u try to use teleports it wont let u intill get health? any one? - zappydude - 07.02.2009

Quote:
Originally Posted by [PD
GameR ]
hey it worked, is there a way to make ALL of my teleports do thsi instead of adding the code to each of them?
I don't think so


Re: when u try to use teleports it wont let u intill get health? any one? - ICECOLDKILLAK8 - 07.02.2009

You could create a new public function e.g. SetPlayerPosHP which checks thier HP then uses SetPlayerPos, Doing that would mean changing all of your SetPlayerPos in the teleports to SetPlayerPosHP, Its the easyest way of doing it without having to put that in every teleport


Re: when u try to use teleports it wont let u intill get health? any one? - Barrio - 07.02.2009

thanks!! i did everything manualy :P lol good thing i dint have alot of teleports