SA-MP Forums Archive
little problem - 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)
+--- Thread: little problem (/showthread.php?tid=368211)



little problem - BigBaws - 12.08.2012

hello guys whats the problem on this command when i dont have a bandage kit it says : You dont have a bandage kit when i do /stats i see 0/1 Bandage ( works fine ) but when i do /buy & i choose a bandage kit theni do /stats i see Bandage 1/1 works the stats fine but when i do /healme it says i dont have bandage check this


Код:
if (strcmp("/healme", cmdtext, true, 10) == 0)
     {
     	 if(PlayerInfo[playerid][pBandagekit] < 1)
         {
                PlayerInfo[playerid][pBandagekit] = 0;
                ClearAnimations(playerid);
                return 1;
          }
	  else
         {
                SendClientMessage(playerid, 0x00FF00AA, "You dont have a Bandage kit.");
	        return 1;

          }
     }



Re: little problem - FalconX - 12.08.2012

Quote:
Originally Posted by BigBaws
Посмотреть сообщение
hello guys whats the problem on this command when i dont have a bandage kit it says : You dont have a bandage kit when i do /stats i see 0/1 Bandage ( works fine ) but when i do /buy & i choose a bandage kit theni do /stats i see Bandage 1/1 works the stats fine but when i do /healme it says i dont have bandage check this

pawn Код:
if (strcmp("/healme", cmdtext, true, 10) == 0)
     {
         if(PlayerInfo[playerid][pBandagekit] > 0) // if the bandage is more then 0
         {
                PlayerInfo[playerid][pBandagekit]--;// bandage gets minus by one number
                ClearAnimations(playerid);
                return 1;
          }
      else
         {
                SendClientMessage(playerid, 0x00FF00AA, "You dont have a Bandage kit.");
            return 1;

          }
     }



Re: little problem - Weaselpwns - 12.08.2012

if(PlayerInfo[playerid][pBandagekit] < 1)

Doesnt this mean you need more than one kit? u might try

if (strcmp("/healme", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pBandagekit] == 1)
{
PlayerInfo[playerid][pBandagekit] = 0;
ClearAnimations(playerid);
return 1;
}
else
{
SendClientMessage(playerid, 0x00FF00AA, "You dont have a Bandage kit.");
return 1;

}
}