when u try to use teleports it wont let u intill get health? any one?
#1

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?
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerHealth
Reply
#3

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
Reply
#4

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;
}
Reply
#5

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!!
Reply
#6

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

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
Reply
#8

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
Reply
#9

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


Forum Jump:


Users browsing this thread: 1 Guest(s)