a question
#1

k i made a command /heal but i wanted to make if the player which should be healed has 100 health the healer gets an error but it doesnt work , if player like has 13 hp it says the error , so anyone know why??

Код:
new Float:Health;
GetPlayerHealth(id,Health);
if(Health >= 100) return SendClientMessage(playerid, COLOR_RED, "Server: That player does not need to be healed by a medic.");
Reply
#2

Show whole command
Reply
#3

why u even want it , its sscanf
Код:
if(gTeam[playerid] != TEAM_MEDIC) return SendClientMessage(playerid, COLOR_RED, "You're not a Medic!");
 	if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Correct Usage: /heal [playerid]");
 	else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "Server: Player ID not found, please check it and try again.");
  	// else if(Health >= 100) return SendClientMessage(playerid, COLOR_RED, "Server: That player does not need to be healed by a medic.");
	else if(!IsPlayerInRangeOfPoint(playerid, 5.0, gX, gY, gZ)) return SendClientMessage(playerid, COLOR_RED, "Server: You must be within 5 ft. of the person to heal them.");
	else if(healedrec[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "Server: You can only heal a player ever 15 seconds, please wait.");
	else
  {
Reply
#4

SO what is the problem?
Reply
#5

You tried

if(Health >= 100.0) ?

Idk if it makes any difference
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)