SA-MP Forums Archive
[HELP]GetPlayerHealth - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]GetPlayerHealth (/showthread.php?tid=129586)



[HELP]GetPlayerHealth - lpstvv - 22.02.2010

So I want that when a player says / menu1 receive life, not full life!
Код:
if (PlayerToPoint (2.0, playerid, 1215.5399, -906.5798,42.4896))
   if (strcmp ( "/ menu1" cmdtext, true, 10) == 0)
   (
    GivePlayerMoney (playerid, -100);
176 GetPlayerHealth (playerid, 30);
    SendClientMessage (playerid, 0xAA3333AA, "You bought a Coca-Cola, a sandwich and French fries.");
    return 1;
Код:
(176): error 035: argument type mismatch (argument 2)
And another thing,how to make when a player don't have $100 can not buy!


Re: [HELP]GetPlayerHealth - Razvann - 22.02.2010

pawn Код:
if (strcmp(cmd,"/menu1", true) == 0)
    {
        if (PlayerToPoint (2.0, playerid, 1215.5399, -906.5798,42.4896))
        {
          if(GetPlayerMoney(playerid < 100))
          {
            SendClientMessage(playerid,0xAA3333AA,"You don't have the cash!");
            return 1;
            }
            new Float:health;
            GetPlayerHealth(playerid, health);
            GivePlayerMoney (playerid, -100);
            SetPlayerHealth(playerid, health+30);
            SendClientMessage (playerid, 0xAA3333AA, "You bought a Coca-Cola, a sandwich and French fries.");
            return 1;
        }
        return 1;
    }



Re: [HELP]GetPlayerHealth - lpstvv - 22.02.2010

Thanks a lot!


Re: [HELP]GetPlayerHealth - dclaw - 22.02.2010

i lined them for you!

Код:
if (strcmp(cmd,"/menu1", true) == 0)
{
  if (PlayerToPoint (2.0, playerid, 1215.5399, -906.5798,42.4896)) {
    if(GetPlayerMoney(playerid < 100)) {
      SendClientMessage(playerid,0xAA3333AA,"You don't have the cash!");
      return 1;
    }
    new Float:health;
    GetPlayerHealth(playerid, health);
    GivePlayerMoney (playerid, -100);
    SetPlayerHealth(playerid, health+30);
    SendClientMessage (playerid, 0xAA3333AA, "You bought a Coca-Cola, a sandwich and French fries.");
    return 1;
  }
  return 1;
}



Re: [HELP]GetPlayerHealth - lpstvv - 22.02.2010

Код:
if (strcmp("/menus", cmdtext, true, 10) == 0)
for this no error
but for this:
Код:
if (strcmp(cmd,"/menu1", true) == 0)
(172) : error 017: undefined symbol "cmd"


Re: [HELP]GetPlayerHealth - dclaw - 22.02.2010

Quote:
Originally Posted by lpstvv
Код:
if (strcmp("/menus", cmdtext, true, 10) == 0)
for this no error
but for this:
Код:
if (strcmp(cmd,"/menu1", true) == 0)
(172) : error 017: undefined symbol "cmd"
i got that to
change
Код:
if (strcmp(cmd,"/menu1", true) == 0)
To:
Код:
if (strcmp(cmdtext,"/menu1", true) == 0)



Re: [HELP]GetPlayerHealth - lpstvv - 22.02.2010

Код:
if(GetPlayerMoney(playerid < 100))
{
SendClientMessage(playerid,0xAA3333AA,"You don't have the cash!");
 return 1;
}
Doen't work.

Thanks!


Re: [HELP]GetPlayerHealth - pyrodave - 22.02.2010

pawn Код:
if(GetPlayerMoney(playerid) < 100)
{
  SendClientMessage(playerid,0xAA3333AA,"You don't have the cash!");
  return 1;
}
Simple bracket in the wrong place.


Re: [HELP]GetPlayerHealth - lpstvv - 22.02.2010

Thanks a lot,best site ever!


Re: [HELP]GetPlayerHealth - HerronInd - 24.02.2011

Hi, I want that when Player do /para then he will get parachut and his 15 precent health will decease.

Here it's my command

dcmd_para(playerid, cmdtext[])
{
#pragma unused cmdtext


GivePlayerWeapon(playerid, 46, 9999);
GetPlayerHealth(playerid,15);
SendClientMessage(playerid,0x5BDB65FF, "you have lost 15 percent health as punishment");
return 1;
}


When i complie it say

: error 035: argument type mismatch (argument 2)