Changing money with a FS using server sided money
#1

Hi.

I need help with a Filterscript called PPC Housing. My gamemode is running server sided money and so I need to make the Filterscript also use the server sided money. I need the FS to share data with the Gamemode.

I dont know how to get it to share data but I tried using PVars

In Filterscript
Код:
SetPVarInt(playerid, "HouseMoney", House_CalcSellPrice(HouseID));
In Gamemode:
Код:
PlayerInfo[playerid][pCash] = GetPVarInt(playerid, "HouseSell");
But my money still goes back to what it was before I sold the house.

Is there any other way I can make it set the server sided money?

Here is a example of me setting the cash when someone finishes a job:
Код:
new cash = random(5850) + 150;
	PlayerInfo[playerid][pCash] += cash;
Reply
#2

Please Help Me!!!!!
Reply
#3

One way is making a function to give money similar to GivePlayerMoney then using CallRemoteFunction on your filterscript.
Reply
#4

Could you please give me an example of what I would make in the gamemode and the filterscript please
Reply
#5

Can someone give me an example please?
Reply
#6

Your variables are named differently. One of them is HouseMoney and the other is HouseSell.
Reply
#7

nope I changed the variable names to HouseSell and it still doesnt do anything

Can someone please explain how I would use the callremotefunction please?
Reply
#8

The only thing you need to do is to use PVar and only PVar if you want to use it for all scripts

Create your own include and call it ssmoney.inc (or something like that)
pawn Код:
#include <a_samp>

stock static
    SSM_PVar[] = "SSM_Money"
;

stock SSM_SetPlayerMoney(playerid, money) {
    return SetPVarInt(playerid, SSM_PVar, money);  
}

stock SSM_GivePlayerMoney(playerid, money) {
    return SetPVarInt(playerid, SSM_PVar, GetPVarInt(playerid, SSM_PVar) + money);
}

stock SSM_GetPlayerMoney(playerid) {
    return GetPVarInt(playerid, SSM_PVar);
}

#define SetPlayerMoney(   SSM_SetPlayerMoney(
#define GivePlayerMoney(  SSM_GivePlayerMoney(
#define GetPlayerMoney(   SSM_GetPlayerMoney(
#define ResetPlayerMoney( SSM_SetPlayerMoney(.money=0,.playerid=
Using CallRemoteFunction is more complicated because you need to add update callbacks and I doubt that it would be faster
Reply
#9

Wouldnt people be able to hack there money then?

And would I have to change all my PlayerInfo[playerid][pCash]?
or what would I have to change
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)