PDA

View Full Version : OnPlayerKeyStateChange help...


Pettersen
19/05/2013, 12:36 AM
**DELETE

HurtLocker
19/05/2013, 12:43 AM
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

Pettersen
19/05/2013, 01:02 AM
**DELETE

Don_Cage
19/05/2013, 01:10 AM
I just took a quick look on it and noticed that you have put like thisGetPlayerHealth(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 >

CrusherCpt
19/05/2013, 01:50 AM
I just took a quick look on it and noticed that you have put like thisGetPlayerHealth(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:

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

http://wiki.sa-mp.com/wiki/Keys

and read this so you can learn something basic and try it.

http://wiki.sa-mp.com/wiki/OnPlayerKeyStateChange

Don_Cage
19/05/2013, 03:47 AM
Or just try to put like:

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 >

[DX]Aru12345
19/05/2013, 05:56 AM
< means more than and > means less than. So if health is < (more than) 99 he will show the error message. The code is right

CrusherCpt
19/05/2013, 10:44 AM
Sorry... My mistake :P

Pettersen
19/05/2013, 11:21 AM
**DELETE

Littlehelper
19/05/2013, 11:34 AM
Aru12345;2532590']< 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?

TomatoRage
19/05/2013, 01:57 PM
Another thing

ShowPlayerDialog(playerid,etc....)


Playerid must be i to show the other player not you