Help to use serverside money in FS too. -
gnoomen2 - 09.08.2013
Hey, my GM uses a serverside money system, and i need that to work with my FS. Right now what happens is:
The player presses buy, the money goes down, and then up again ( the player dosent loose any money ). This is after i have done this:
I found this from the GM and putted it in my FS:
pawn Код:
enum pInfo
{
pCash
};
new PlayerInfo[MAX_PLAYERS][pInfo];
stock GiveMoney(playerid, money)
{
PlayerInfo[playerid][pCash] += money;
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
return 1;
}
And then i replaced all
in the FS to
Compiles with no errors or warnings. I don't know if it was like that before i edited the FS and tried to make it work or not. Please help.
Re: Help to use serverside money in FS too. -
gnoomen2 - 10.08.2013
Please someone?
Re: Help to use serverside money in FS too. -
Pottus - 10.08.2013
You need to make sure your money functions are called in the gamemode script make an include file to call those functions with CallRemoteFunction.
pawn Код:
#define GiveMoney(%0,%1) CallRemoteFunction("GiveMoney","ii",%0,%1)
Re: Help to use serverside money in FS too. -
gnoomen2 - 10.08.2013
I have read around a bit, and tried to understand what you meant here, because it was a bit hard for me to understand exactly what to do. Could you please explain what i need to do where? Should i create a include file? with what in it? and should i include it in the GM? I dont understand.
Re: Help to use serverside money in FS too. -
Pottus - 11.08.2013
You just make an include with your gamemode functions then include it with your filterscripts
example
#include <gamemodefunctions>
Then you can call your gamemode functions. Keep in mind your gamemode functions require a forward / public
Re: Help to use serverside money in FS too. -
[ABK]Antonio - 11.08.2013
You can use a stock if you want it just in the gamemode or an include.. However, I'd recommend switching it to a public and forwarding it for use with
pawn Код:
CallRemoteFunction("GiveMoney","ii", playerid, valuehere);
There's plenty of ways to do it.
Re: Help to use serverside money in FS too. -
gnoomen2 - 11.08.2013
Ok, I added this in the include:
pawn Код:
#include <a_samp>
enum pInfo
{
pCash
};
new PlayerInfo[MAX_PLAYERS][pInfo];
forward GiveMoney(playerid, money);
public GiveMoney(playerid, money)
{
PlayerInfo[playerid][pCash] += money;
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
return 1;
}
Did
in the FS, and added
pawn Код:
#define GiveMoney(%0,%1) CallRemoteFunction("GiveMoney","ii",%0,%1) where the other defines where, no errors when i compiled.
Restarted the server and went to test it out, bought a car that costed 10k.. and my money went up 12346..
I really need this to work with the GM, its a car dealership system. Please help me out guys!
Here is the code for the FS, just in case it is needed:
http://pastebin.com/4Yzpnhvj
I have no idea how to fix this.
Re: Help to use serverside money in FS too. -
gnoomen2 - 11.08.2013
Please help me guys! It's urgent!