Small help -
Face9000 - 18.09.2015
Hello, i have a small problem.
I'm creating a mini missions servers and is structured in this way:
The main core such as login, register, anticheat etc is a filterscript file.
The missions are placed in gamemodes folder.
Now the problem is, i've added a server side money system in the main core filterscript file, so i replaced every callback to custom (Ex: GivePlayerMoney became GivePlayerCash).
I've tried to replace the default money callbacks in gamemodes too, from GPM to GPC but having the "Undefined symbol GivePlayerCash".
Since i can't copy the code in 50 gamemodes, is there a way to read it from the main core filterscript?
In short words, i've the server side money placed in filterscripts but i need to replace the default callbacks in gamemodes too, without redefining everything.
Re: Small help - TheLegend1 - 18.09.2015
Hey.
Well as far as i know yes there is possible to include an FS inside ur gm - only include it like .inc but only with .pwn example
#include test.pwn
or try
#include filterscripts/test.pwn
Re: Small help -
Face9000 - 18.09.2015
This will not cause errors?
Re: Small help -
Aliassassin123456 - 18.09.2015
What TheLegend1 said is false.
In your gamemodes and filterscripts you must put this:
PHP код:
GivePlayerCash(playerid, money) return CallRemoteFunction("GiveCash", "ii", playerid, money);
GetPlayerCash(playerid) return CallRemoteFunction("GetCash", "i", playerid);
ResetPlayerCash(playerid) return CallRemoteFunction("ResetCash", "i", playerid);
And put this code on your AntiCheat script (that contain the money variable):
PHP код:
forward GiveCash(playerid, money);
forward GetCash(playerid);
forward ResetCash(playerid);
public GiveCash(playerid, money)
{
if(IsPlayerConnected(playerid))
{
MoneyVariable[playerid] += money;
GivePlayerMoney(playerid, money);
return 1;
}
return 0;
}
public GetCash(playerid)
{
if(IsPlayerConnected(playerid)) return MoneyVariable[playerid];
return 1;
}
public ResetCash(playerid)
{
if(IsPlayerConnected(playerid))
{
MoneyVariable[playerid] = 0;
ResetPlayerMoney(playerid);
return 1;
}
return 0;
}
Re: Small help -
Face9000 - 18.09.2015
Aliassassin i resolved just by using
Код:
CallRemoteFunction("GiveCash", "ii", playerid, money);
And i have a different anti cheat code but it works tho. Thanks