Samp Menu Question
#1

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

but for health so it checks your health any1 know? thx
Reply
#2

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.
Reply
#3

just crashes my pawno compiler
Reply
#4

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

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

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

keeps crashing my pawno no matter what dont worry
Reply
#8

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.
Reply
#9

damn it just crashes for me FML u got msn
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)