Small help
#1

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.
Reply
#2

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
Reply
#3

This will not cause errors?
Reply
#4

What TheLegend1 said is false.
In your gamemodes and filterscripts you must put this:

PHP код:
GivePlayerCash(playeridmoney) return CallRemoteFunction("GiveCash""ii"playeridmoney);
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(playeridmoney);
forward GetCash(playerid);
forward ResetCash(playerid);
public 
GiveCash(playeridmoney)
{
    if(
IsPlayerConnected(playerid))
    {
        
MoneyVariable[playerid] += money;
        
GivePlayerMoney(playeridmoney);
        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;

Reply
#5

Aliassassin i resolved just by using
Код:
CallRemoteFunction("GiveCash", "ii", playerid, money);
And i have a different anti cheat code but it works tho. Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)