07.02.2009, 13:03
I'm working on a command for admins called /hptest. Once typed it will send a client message saying "Current HP: 100" then minus hp by 2, then wait 1 second, then "New Hp: 98"
Although it doesn't do that, it does this
Current HP: 100
(Waits one second)
New Hp: 100
But then I check my hp and it says I have 98, and my health bar had gone down but it thought my hp was 100.
Any ideas of why it's not working?
Although it doesn't do that, it does this
Current HP: 100
(Waits one second)
New Hp: 100
But then I check my hp and it says I have 98, and my health bar had gone down but it thought my hp was 100.
Код:
if(IsPlayerConnected(pid)) { new Float:Health; new Float:Health2; GetPlayerHealth(pid,Health); format(message,128,"Current HP: %f",Health); SendClientMessage(playerid,COLOR_YELLOW,message); SetPlayerHealth(pid,Health-2); wait(1000); GetPlayerHealth(pid,Health2); format(message2,128,"New HP: %f",Health2); SendClientMessage(playerid,COLOR_YELLOW,message2); return 1; }