02.04.2014, 08:36
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;
}