Health in cash bar
#1

How can i make that health is showing in the cash bar like in WorldCup mode?

example:
got 58 hp, -58 dollars
got 12 hp, -12 dollars
got 100hp, -100 dollars

Is there a filterscript for this or should I do it by myself? ;f
Reply
#2

Код:
public OnPlayerUpdate(playerid)
{
     new HP = GetPlayerMoney(playerid);
     GetPlayerMoney(playerid)
     {
        SetPlayerHealth(playerid, HP);
     }
}
Something like this i'm guessing

*Untested
Reply
#3

It doesnt work
Reply
#4

Quote:
Originally Posted by ScottCFR
Код:
public OnPlayerUpdate(playerid)
{
     new HP = GetPlayerMoney(playerid);
     GetPlayerMoney(playerid)
     {
        SetPlayerHealth(playerid, HP);
     }
}
Something like this i'm guessing

*Untested
why you use
pawn Код:
GetPlayerMoney(playerid);
twice and health is a float money is a variable <- that aint really important since it worked for me
Reply
#5

So, anyone knows how to do it?
Reply
#6

pawn Код:
new Float:hp = GetPlayerHealth(playerid, hp);
SetPlayerMoney(playerid, hp);
Reply
#7

I was making the same but
Код:
C:\Documents and Settings\xxxx\xxx\x\xxx\xxx\xxx.pwn(385) : error 017: undefined symbol "SetPlayerMoney"
Reply
#8

Quote:
Originally Posted by Finn
pawn Код:
#define SetPlayerMoney(%0,%1) \
  GivePlayerMoney(%0, (%1 - GetPlayerMoney(%0)))
Reply
#9

it doesn't work ;/
It's changing the cash that after 10 seconds i've got about 303030$ -.-
Reply
#10

This will set your health to the amount of money you have.
pawn Код:
public OnPlayerUpdate(playerid)
{
  new Money = GetPlayerMoney(playerid);
  SetPlayerHealth(playerid, Money);
}
This will set your money to the amount of health you have.
pawn Код:
public OnPlayerUpdate(playerid)
{
  new Float:Health = GetPlayerHealth(playerid);
  SetPlayerMoney(playerid, Health);
}

//Somewhere in script
stock SetPlayerMoney(playerid, money)
{
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, money);
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)