[help]Variables
#1

Hi! I got a problem with an variable.

I was wonderinf if you can do
Код:
GivePlayerMoney(playerid,GetPlayerMoney(playerid)-1);
I have this variable:
Код:
new antidote[MAX_PLAYERS];
and wonder if it's possible to do something like above with that variable?
Reply
#2

You should consider using PVars, however I'll provide two examples:

pawn Код:
public OnPlayerSpawn( playerid )
{
GivePlayerMoney( playerid, antidote[ playerid ] - 1 );
}
...or, ideally:

pawn Код:
public OnPlayerSpawn( playerid )
{
GivePlayerMoney( playerid, GetPVarInt( playerid, "antidote" ) - 1 );
}
Reply
#3

Quote:
Originally Posted by FreddoX [BINMAN
]
You should consider using PVars, however I'll provide two examples:

pawn Код:
public OnPlayerSpawn( playerid )
{
GivePlayerMoney( playerid, antidote[ playerid ] - 1 );
}
...or, ideally:

pawn Код:
public OnPlayerSpawn( playerid )
{
GivePlayerMoney( playerid, GetPVarInt( playerid, "antidote" ) - 1 );
}
Hmm.. I never used PVars, i don't even know how it works :b

And it was not that i meant, i mean something like
Код:
antidote[playerid] -1, but not were you set it to -1 but just take one.
Reply
#4

antidote[playerid]--;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)