GivePlayerMoney == > GivePlayerCash problem...
#1

I got this AntiMoney Hack thingy:
pawn Код:
#define ResetMoneyBar ResetPlayerMoney
#define UpdateMoneyBar GivePlayerMoney

stock GivePlayerCash(playerid, money)
{
    PlayerInfo[playerid][pCash] += money;
    ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
    UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);//Sets the money in the moneybar to the serverside cash, Do not remove!
    return PlayerInfo[playerid][pCash];
}
stock SetPlayerCash(playerid, money)
{
    PlayerInfo[playerid][pCash] = money;
    ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
    UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);//Sets the money in the moneybar to the serverside cash, Do not remove!
    return PlayerInfo[playerid][pCash];
}
stock ResetPlayerCash(playerid)
{
    PlayerInfo[playerid][pCash] = 0;
    ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
    UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);//Sets the money in the moneybar to the serverside cash, Do not remove!
    return PlayerInfo[playerid][pCash];
}
stock GetPlayerCash(playerid)
{
    return PlayerInfo[playerid][pCash];
}
Pastebin: http://pastebin.com/f369c72d9
Now the problem is that I want to Implant this into a Car Ownership FS I got, But the thing is That I don't understand how to modify this:
Код:
PlayerInfo[playerid][pCash]
So it will work as GetPlayerMoney ......

Please can somebody help?

Forgot to add teh Defines in the paste bin added them here
Reply
#2

enum playerinfo
{
pCash
}
Reply
#3

Well, I tried that.
Didn't Work..
If you maybe can suggest something else to make it work.... I would Appreciate it
Reply
#4

Quote:
Originally Posted by darkrider366
enum playerinfo
{
pCash
}
My turn.

pawn Код:
enum antimoneycheat
{
pCash,
}
new PlayerInfo[MAX_PLAYERS][antimoneycheat];
//All on top!
Is that what you wanted or is the problem something else.
Reply
#5

Quote:
Originally Posted by FUNExtreme
Quote:
Originally Posted by darkrider366
enum playerinfo
{
pCash
}
My turn.

pawn Код:
enum antimoneycheat
{
pCash,
}
new PlayerInfo[MAX_PLAYERS][antimoneycheat];
//All on top!
Is that what you wanted or is the problem something else.
The thing is I tried the Way you Suggested already.
The problem is that I want REPLACE the PlayerInfo[playerid][pCash] so It will do the Function GETPLAYERMONEY
Reply
#6

I don't get it.
new pCash[MAX_PLAYERS]; ??
Reply
#7

Quote:
Originally Posted by MenaceX^
I don't get it.
new pCash[MAX_PLAYERS]; ??
Ok, Can you show me an Example how to use teh variable you suggested?
something like:
pawn Код:
//Top of script
new pCash[MAX_PLAYERS];

//the Stock Location
stock GivePlayerCash(playerid, money)
{
    pCash += money;
    ResetMoneyBar(playerid);//Resets the money in the original moneybar, Do not remove!
    UpdateMoneyBar(playerid,pCash);//Sets the money in the moneybar to the serverside cash, Do not remove!
    return pCash;
}
Reply
#8

pawn Код:
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
?
Reply
#9

Quote:
Originally Posted by FUNExtreme
pawn Код:
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
?
Tried that, But can you tell me where to put it?
When I tried i put it under OnPlayerConnect
Maybe under OnFilterScriptInit !?
Reply
#10

Try under
OnPlayerSpawn
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)