[HELP] getting offline player data
#4

pawn Код:
forward Offcheck(playerid);
public Offcheck(playerid)
{
    if(cache_num_rows() > 0)
    {
        cache_get_field_content_int(0,"Level",Promenljive[playerid][0]);
        cache_get_field_content_int(0,"Admin",Promenljive[playerid][1]);
        cache_get_field_content_int(0,"GameMaster",Promenljive[playerid][2]);
        SCMF(playerid,COLOR_ZUTA1,"Level[%d] AdminLV[%d] GSLevel[%d]",
        Promenljive[playerid][0],Promenljive[playerid][1],Promenljive[playerid][2]);
    }
    return 1;
}


CMD:offcheckdata(playerid,params[])
{
    if(Logged[playerid] != 1)
    {
        SCM(playerid,COLOR_GRAD2,"{FFFFFF}[{F81414}G-Protect{FFFFFF}] {C3C3C3}Most be logged in!");
        return 1;
    }
    if(PlayerInfo[playerid][Admin] >= 1337 || IsPlayerAdmin(playerid))
    {
        new name[128],query[128];
        if(sscanf(params,"s[128]",name))
        {
            SCM(playerid,COLOR_GRAD2,"{FFAF00}Use: {FFFFFF}/offcheckdata [Player name]");
            return 1;
        }
        if(IsPlayerConnected(ReturnUser(name))) return SCM(playerid,0xDB023EFF,"[!!!] That player is online!");
        mysql_format(mysql,query,128,"SELECT * FROM `users` WHERE `Nick` = '%e'",name);
        mysql_tquery(mysql,query,"Offcheck","i",playerid);// here is the public for data
    }
    else return SCM(playerid,COLOR_GRAD2,"{FFFFFF}[{F81414}G-Protect{FFFFFF}] {C3C3C3}Just admins!");
    return 1;
}
Try this. Althought, I wouldn't use numbers for player variables. I'd just use a name like "Admin", "Level" etc.
Reply


Messages In This Thread
[HELP] getting offline player data - by Luca12 - 01.04.2014, 22:50
Re: [HELP] getting offline player data - by azzerking - 01.04.2014, 23:02
Re: [HELP] getting offline player data - by Luca12 - 02.04.2014, 08:12
Re: [HELP] getting offline player data - by Keyhead - 02.04.2014, 08:36
Re: [HELP] getting offline player data - by Luca12 - 02.04.2014, 09:19
Re: [HELP] getting offline player data - by Keyhead - 02.04.2014, 09:25
Re: [HELP] getting offline player data - by Luca12 - 02.04.2014, 09:30

Forum Jump:


Users browsing this thread: 1 Guest(s)