SA-MP Forums Archive
Samp Menu Question - 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: Samp Menu Question (/showthread.php?tid=186692)



Samp Menu Question - hadzx - 30.10.2010

whats the code for menus like this if(GetPlayerMoney(playerid) > 0)

but for health so it checks your health any1 know? thx


Re: Samp Menu Question - Cameltoe - 30.10.2010

Here:
pawn Код:
new Money = GetPlayerMoney(playerid);
new Float: Health;
GetPlayerHealth(playerid, Health);
What you also could do:

pawn Код:
stock GetPlayerMoneyEx(playerid)
{
     new Money = GetPlayerMoney(playerid);
     return Money;
}
Same for the health.

Now to check:

pawn Код:
if(GetPlayerMoneyEx(playerid) >= 5000) // doshit if player has / has more then 5k cash.

if(Health < 35) // Doshit if health is less then 35.



Re: Samp Menu Question - hadzx - 30.10.2010

just crashes my pawno compiler


Re: Samp Menu Question - Cameltoe - 30.10.2010

Quote:
Originally Posted by hadzx
Посмотреть сообщение
just crashes my pawno compiler
Updated my post, how did you use the code?


Re: Samp Menu Question - hadzx - 30.10.2010

new Money = GetPlayerMoney(playerid);
new Float: Health;

under include

and above pickup in the case


case 1:
{
if(GetPlayerHealth(playerid, Health); > 99.00)
{
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid,-50);
SendClientMessage(playerid,0xFFFFFFFF,"Healed For 50$");
GameTextForPlayer(playerid, "~g~Healed For 50$", 1000, 5); }
else
{
SendClientMessage(playerid,0xFFFFFFFF,"Your Health Is 100 -_-");
GameTextForPlayer(playerid, "~r~Your Health Is FINE", 1000, 5);
}
}


Re: Samp Menu Question - Cameltoe - 30.10.2010

More like this:

pawn Код:
case 1:
{
    if(Health > 0.0 && Health < 100)
    {
        SetPlayerHealth(playerid, 100);
        GivePlayerMoney(playerid,-50);
        SendClientMessage(playerid,0xFFFFFFFF,"Healed For 50$");
        GameTextForPlayer(playerid, "~g~Healed For 50$", 1000, 5);
    }
    else
    {
        SendClientMessage(playerid,0xFFFFFFFF,"Your Health Is 100 -_-");
        GameTextForPlayer(playerid, "~r~Your Health Is FINE", 1000, 5);
    }
}



Re: Samp Menu Question - hadzx - 30.10.2010

keeps crashing my pawno no matter what dont worry


Re: Samp Menu Question - Cameltoe - 30.10.2010

Quote:
Originally Posted by hadzx
Посмотреть сообщение
keeps crashing my pawno no matter what dont worry
I did just test the code, shouldn't give any errors / crash the compiler at all.


Re: Samp Menu Question - hadzx - 30.10.2010

damn it just crashes for me FML u got msn


Re: Samp Menu Question - Cameltoe - 30.10.2010

Quote:
Originally Posted by hadzx
Посмотреть сообщение
damn it just crashes for me FML u got msn
Yepp, though i'm only adding people when scripting for cash / people ordering services.