[HELP]GetPlayerHealth
#1

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!
Reply
#2

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;
    }
Reply
#3

Thanks a lot!
Reply
#4

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;
}
Reply
#5

Код:
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"
Reply
#6

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)
Reply
#7

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

Thanks!
Reply
#8

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

Thanks a lot,best site ever!
Reply
#10

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)