Filterscript / Gamemode Communication ??
#5

What you can do is make an include (For Example: pawno/include/stuoytoadmin.inc) and to #include <stuoytoadmin> in both the filterscript and the gamemode.

The include should look something like this:

pawn Код:
#include <a_samp>

//====================ENUNM====================
enum gPInfo
{
    Logged,
    Level,
    Skin,
    Spec,
    Muted,
    Frozen,
    Jailed,
    Banned,
    Warnings,
    Cash,
    Kills,
    Deaths
};


new PInfo[MAX_PLAYERS][gPInfo];


//=============================================
stock IsPlayerYAdmin(playerid)
{
    if(PInfo[playerid][Logged]==1)
    {
        new file[256],playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
        format(file,sizeof(file),"YAdmin/Users/%s.user",playername);
   
        PInfo[playerid][Level] = dini_Int(file,"Level");
        if(PInfo[playerid][Level]>=1)
        {
            return 1;
        }
        else return 0;
    }
    else return 0;
}

stock IsPlayerYAdminLevel(playerid,level)
{
    if(PInfo[playerid][Logged]==1)
    {
        new file[256],playername[MAX_PLAYER_NAME];
        GetPlayerName(playerid,playername,MAX_PLAYER_NAME);
        format(file,sizeof(file),"YAdmin/Users/%s.user",playername);
       
        PInfo[playerid][Level] = dini_Int(file,"Level");
        if(PInfo[playerid][Level]>=level)
        {
            return 1;
        }
        else return 0;
    }
    else return 0;
}
You can then use the new IsPlayer(Y)Admin functions in either script. If you use Y-INI, just modify it accordingly.
Reply


Messages In This Thread
Filterscript / Gamemode Communication ?? - by stuoyto - 10.05.2012, 01:38
Re: Filterscript / Gamemode Communication ?? - by SuperViper - 10.05.2012, 01:51
Re: Filterscript / Gamemode Communication ?? - by stuoyto - 10.05.2012, 02:01
Re: Filterscript / Gamemode Communication ?? - by stuoyto - 10.05.2012, 02:11
Re: Filterscript / Gamemode Communication ?? - by Yuryfury - 10.05.2012, 03:01
Re: Filterscript / Gamemode Communication ?? - by stuoyto - 10.05.2012, 03:13
Re: Filterscript / Gamemode Communication ?? - by SuperViper - 10.05.2012, 03:15
Re: Filterscript / Gamemode Communication ?? - by (SF)Noobanatior - 10.05.2012, 03:56

Forum Jump:


Users browsing this thread: 1 Guest(s)