GivePlayerMoney == > GivePlayerCash problem... -
Castle - 29.03.2009
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
Re: GivePlayerMoney == > GivePlayerCash problem... -
darkrider366 - 29.03.2009
enum playerinfo
{
pCash
}
Re: GivePlayerMoney == > GivePlayerCash problem... -
Castle - 29.03.2009
Well, I tried that.
Didn't Work..
If you maybe can suggest something else to make it work.... I would Appreciate it
Re: GivePlayerMoney == > GivePlayerCash problem... -
FUNExtreme - 29.03.2009
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.
Re: GivePlayerMoney == > GivePlayerCash problem... -
Castle - 29.03.2009
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
Re: GivePlayerMoney == > GivePlayerCash problem... -
MenaceX^ - 29.03.2009
I don't get it.
new pCash[MAX_PLAYERS]; ??
Re: GivePlayerMoney == > GivePlayerCash problem... -
Castle - 29.03.2009
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;
}
Re: GivePlayerMoney == > GivePlayerCash problem... -
FUNExtreme - 29.03.2009
pawn Код:
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
?
Re: GivePlayerMoney == > GivePlayerCash problem... -
Castle - 29.03.2009
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 !?
Re: GivePlayerMoney == > GivePlayerCash problem... -
FUNExtreme - 29.03.2009
Try under
OnPlayerSpawn