Public Function ?
#1

i started makin this really simple MONEY AntuCheat into a #include
all works fine is just that when the server saves the players money in the gamemode into pMoney lests say $5600 are saved into the pMoney
but then in my DriftCounter System i give the player lets say +$500 and the that will caunt as a cheat
even though i did use a custume function.
pawn Код:
new pMoney[MAX_PLAYERS];//I want to make this Global

stock mGivePlayerMoney(playerid, AMOUNT)//if use this in the FS it will only make the "pMoney" variable to its own
{
    pMoney[playerid] += AMOUNT;
    GivePlayerMoney(playerid,AMOUNT);
    return 1;
}
stock mSetPlayerMoney(playerid, AMOUNT)
{
    pMoney[playerid] = 0;
    pMoney[playerid] = AMOUNT;
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, AMOUNT);
}
stock mRemovePlayerMoney(playerid, AMOUNT)
{
    pMoney[playerid] -= AMOUNT;
    GivePlayerMoney(playerid,GetPlayerMoney(playerid)-AMOUNT);
}
stock mResetPlayerMoney(playerid)
{
    pMoney[playerid] = 0;
    ResetPlayerMoney(playerid);
}
stock mGetPlayerMoney(playerid)
{
    new Amount = pMoney[playerid];
    return Amount;
}
stock ReFormatMoney(playerid)//i use this under OnPlayerUpdate In my Gamemode works fine
{
    LoadmMoney(playerid);
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, pMoney[playerid]);
    return pMoney[playerid];
}
stock LoadmMoney(playerid)
{
    new name[MAX_PLAYER_NAME],file[80];GetPlayerName(playerid, name, sizeof(name));
    format(file,sizeof(file),"/mRegistration/Users/%s.txt",name);
    if(fexist(file)) INI_ParseFile(file, "LoadMoney", false, true, playerid, true, false);
    if(fexist(file))
        {
            mSetPlayerMoney(playerid,GetPVarInt(playerid, "Money"));
        }
    return pMoney[playerid];
}

forward LoadMoney(playerid, name[], value[]);
public LoadMoney(playerid, name[], value[])
{
if(!strcmp(name, "Money"))SetPVarInt(playerid,"Money", strval(value));
}
Reply


Messages In This Thread
Public Function ? - by park4bmx - 19.11.2011, 17:01
Re: Public Function ? - by MP2 - 19.11.2011, 18:40

Forum Jump:


Users browsing this thread: 1 Guest(s)