OnPlayerKeyStateChange help...
#1

**DELETE
Reply
#2

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

**DELETE
Reply
#4

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

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(playeridphealth);
if(
phealth >= 99)
{
SendClientMessage(playeridCOLOR"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
Reply
#6

Quote:
Originally Posted by CrusherCpt
Посмотреть сообщение
Or just try to put like:

PHP код:
 GetPlayerHealth(playeridphealth);
if(
phealth =< 99)
{
SendClientMessage(playeridCOLOR"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 >
Reply
#7

< means more than and > means less than. So if health is < (more than) 99 he will show the error message. The code is right
Reply
#8

Sorry... My mistake :P
Reply
#9

**DELETE
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)