OnPlayerKeyStateChange help... - 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)
+--- Thread: OnPlayerKeyStateChange help... (
/showthread.php?tid=438172)
**DELETE** -
Pettersen - 18.05.2013
**DELETE
AW: OnPlayerKeyStateChange help... -
HurtLocker - 18.05.2013
Here are all the tools you will need:
OnPlayerKeyStateChange
GetPlayerPos(to be healed player / to get his vehicle fixed)
IsPlayerInAnyVehicle
IsPlayerInRangeOfPoint(here put the above coordinates)
ShowPlayerDialog
OnDialogResponse
**DELETE** -
Pettersen - 19.05.2013
**DELETE
Re: OnPlayerKeyStateChange help... -
Don_Cage - 19.05.2013
I just took a quick look on it and noticed that you have put like this
pawn Код:
GetPlayerHealth(playerid, Health);
if(Health < 100.0)
{
SendClientMessage(playerid, -1, "Player have full health.");
}
That will send the message if the player have UNDER 100.0 but it will still say that the player have full health. change it from < to >
Re: OnPlayerKeyStateChange help... -
CrusherCpt - 19.05.2013
Quote:
Originally Posted by Don_Cage
I just took a quick look on it and noticed that you have put like this
pawn Код:
GetPlayerHealth(playerid, Health); if(Health < 100.0) { SendClientMessage(playerid, -1, "Player have full health."); }
That will send the message if the player have UNDER 100.0 but it will still say that the player have full health. change it from < to >
|
Or just try to put like:
PHP код:
GetPlayerHealth(playerid, phealth);
if(phealth >= 99)
{
SendClientMessage(playerid, COLOR, "The player next to you have full health and don't need cares.");
return 1;
}
So it don't bug, call it a safety system.. If the player has more than 99 life points its like have 100..
Next you need this
https://sampwiki.blast.hk/wiki/Keys
and read this so you can learn something basic and try it.
https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
Re: OnPlayerKeyStateChange help... -
Don_Cage - 19.05.2013
Quote:
Originally Posted by CrusherCpt
Or just try to put like:
PHP код:
GetPlayerHealth(playerid, phealth);
if(phealth =< 99)
{
SendClientMessage(playerid, COLOR, "The player next to you have full health and don't need cares.");
return 1;
}
So it don't bug, call it a safety system.. If the player has more than 99 life points its like have 100..
|
That will still show the message if the player have under full hp. In other words, the medic will only be able to heal him if he already have full health. you need to switch < to >
Re: OnPlayerKeyStateChange help... -
[DX]Aru12345 - 19.05.2013
< means more than and > means less than. So if health is < (more than) 99 he will show the error message. The code is right
Re: OnPlayerKeyStateChange help... -
CrusherCpt - 19.05.2013
Sorry... My mistake :P
**DELETE** -
Pettersen - 19.05.2013
**DELETE
Re: OnPlayerKeyStateChange help... -
Littlehelper - 19.05.2013
Quote:
Originally Posted by [DX]Aru12345
< means more than and > means less than. So if health is < (more than) 99 he will show the error message. The code is right
|
http://en.wikipedia.org/wiki/Greater-than_sign
I'm sorry?