Vortex Roleplay help
#1

Hello,

Im using vortex roleplay 2 with little bits edited yet im stuck on this bit

If i wanted to add this command in the script script:

public GetPlayerAVSAdmin(playerid)
{
return PlayerInfo[playerid][pAdmin];
}

what do i change return PlayerInfo[playerid][pAdmin] too.

Many Thanks
Jack Davis
Reply
#2

Still looking for some one to do this for me
Reply
#3

if your trying to load the admin value thats not the way
you will need to perse the file then load it like this
pawn Код:
public GetPlayerAVSAdmin(playerid)
{
      new name[MAX_PLAYER_NAME],file[80];GetPlayerName(playerid, name, sizeof(name));
      format(file,sizeof(file),"/%s.txt",name);//File location
      if(fexist(file))
      {
            INI_ParseFile(file, "PerseAdminLevel", false, true, playerid, true, false);
            PlayerInfo[playerid][pAdmin] = GetPVarInt(playerid, "Admin");//what ever you save it as in the file i used here "Admin"
      }
}

//put this anywhere OUTSIDE a callback
forward PerseAdminLevel(playerid, name[], value[]);
public PerseAdminLevel(playerid, name[], value[])
{
if(!strcmp(name,"Admin"))SetPVarString(playerid,"Admin", value);
}
and when you want to load the player level just use GetPlayerAVSAdmin(playerid);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)