RELIFE
#1

Код:
			if(strcmp(cmdtext, "/heal", true)==0)
	{
		new hp = GetPlayerHealth(GetPlayerHealth(playerid));
		if (hp == 100.0)
		{
			SendClientMessage(playerid, 0xEFEFF7AA, "[!] FULL HP.");
		}
	else
	{
		new var0[150];
		SetPlayerHealth(playerid, 100.0);
		GetPlayerName(playerid, var0, 25);
		format(var1, 256, "[HEAL]: Player %s FULLED HP (/heal) .", var0);
		SendClientMessageToAll(0xFF0000AA, var1);
		TogglePlayerControllable(playerid,1);
      }
		return 1;
If i type /heal server shut down (restart gmx)

pls help
Reply
#2

pawn Код:
new zivot = GetPlayerHealth(GetPlayerHealth(playerid));
?

It should be like this:
pawn Код:
new zivot = GetPlayerHealth(playerid);
Reply
#3

Quote:
Originally Posted by Don Correlli
pawn Код:
new zivot = GetPlayerHealth(GetPlayerHealth(playerid));
?

It should be like this:
pawn Код:
new zivot = GetPlayerHealth(playerid);
Код:
			if(strcmp(cmdtext, "/zivot", true)==0)
	{
		new zivot = GetPlayerHealth((playerid));
		if (zivot == 100.0)
		{
			SendClientMessage(playerid, 0xEFEFF7AA, "[!] FULL.");
		}

		new var0[150];
		SetPlayerHealth(playerid, 100.0);
		GetPlayerName(playerid, var0, 25);
		format(var1, 256, "[HEAL]: Hrac %s fulled hp (/zivot) .", var0);
		SendClientMessageToAll(0xFF0000AA, var1);
		TogglePlayerControllable(playerid,1);
      
		return 1;
	}
Server Shut down if i type /heal (/zivot)
Reply
#4

pawn Код:
if(strcmp(cmd, "/zivot", true) == 0)    {
        if (GetPlayerHealth(playerid) >= 100)
        {
            SendClientMessage(playerid, 0xEFEFF7AA, "[!] FULL.");
return 1;
        }

        new var0[255], var1[255];
        SetPlayerHealth(playerid, 100);
        GetPlayerName(playerid, var0, sizeof(var0));
        format(var1, 256, "[HEAL]: Hrac %s fulled hp (/zivot) .", var0);
        SendClientMessageToAll(0xFF0000AA, var1);
        TogglePlayerControllable(playerid,1);
     
        return 1;
    }
Reply
#5

You can also use
pawn Код:
format(var1, sizeof(var1), "[HEAL]: Hrac %s fulled hp (/zivot) .", var0);
instead of
pawn Код:
format(var1, 256, "[HEAL]: Hrac %s fulled hp (/zivot) .", var0);
It will get var1's full size and use it
Reply
#6

@dice7: http://forum.sa-mp.com/index.php?topic=78026.0
Reply
#7

Quote:
Originally Posted by ►☺◄©ookie►☺◄
pawn Код:
if(strcmp(cmd, "/zivot", true) == 0)    {
        if (GetPlayerHealth(playerid) >= 100)
        {
            SendClientMessage(playerid, 0xEFEFF7AA, "[!] FULL.");
return 1;
        }

        new var0[255], var1[255];
        SetPlayerHealth(playerid, 100);
        GetPlayerName(playerid, var0, sizeof(var0));
        format(var1, 256, "[HEAL]: Hrac %s fulled hp (/zivot) .", var0);
        SendClientMessageToAll(0xFF0000AA, var1);
        TogglePlayerControllable(playerid,1);
     
        return 1;
    }
dont work .......... on the server type UNKNOW COMMAND
Reply
#8

I thought health was always a float?

Try this :P
pawn Код:
new Float:health;
GetPlayerHealth(playerid, health);
Reply
#9

Quote:
Originally Posted by Swift_
I thought health was always a float?

Try this :P
pawn Код:
new Float:health;
GetPlayerHealth(playerid, health);
dont work i have 100.0 hp and SERVER type Hrac Majkl full hp (/zivot)
Код:
if (GetPlayerHealth(playerid, health) >= 100)
{
SendClientMessage.....................
return 1;
}
......
......
SetPlayerHealth(playerid, 100);
Reply
#10

pawn Код:
if(strcmp(cmdtext, "/heal", true) == 0)
{
  new Float:health;
  GetPlayerHealth(playerid, health);
  if(health >= 100)
  {
   return SendClientMessage(playerid, 0x000000FF, "You alredy have full health!");
  }
  else
  {
    new str[128], name[24];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(str, sizeof str, "%s has just set health to 100!", name);
    SendClientMessageToAll(0x000000FF, str);
    TogglePlayerControllable(playerid, 1);
    return 1;
  }
  return 1;
}
Reply


Forum Jump:


Users browsing this thread: