Command problem -
StR_MaRy - 23.09.2016
hey guys i have a /adminlist where i see every Admin by DESC and i see thery name - admin level - staff points and hours played but i have a problem i did something to could select his name and do some things like change his Admin level and Remove his admin but now i have a little problem can some1 help me ?
this is the command:
Код HTML:
CMD:adminlist(playerid, params[])
{
if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
if(!IsManager(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai gradul necesar ca sa folosesti aceasta comanda!");
new aim[1500], tstring[100];
format(tstring, sizeof(tstring),"{FFFFFF}Lista adminilor");
new memid = 0;
gQuery[0] = (EOS);
mysql_format(handle, gQuery, sizeof(gQuery), "SELECT `Name`,`AdminLevel`,`StaffPoints`,`HoursPlayed` FROM `players` WHERE `AdminLevel` > 0 ORDER BY `AdminLevel` DESC LIMIT 20");
new Cache:result = mysql_query (handle, gQuery);
new iResult[64];
new test[32], query[32], test3[32], test4[32];
new coordsstring[250] = "Name\tAdmin Level\tStaff Points\tHours Played\n";
for ( new i, j = cache_get_row_count ( ); i != j; ++i )
{
cache_get_field_content(i, "Name", iResult); format(query, 32, iResult);
format(Selected[memid][snume],32, query);
cache_get_field_content(i, "AdminLevel", iResult); format(test, 32, iResult);
cache_get_field_content(i, "StaffPoints", iResult); format(test3, 32, iResult);
cache_get_field_content(i, "HoursPlayed", iResult); format(test4, 32, iResult);
new id = GetPlayerID(Selected[memid][snume]);
if(id != INVALID_PLAYER_ID)
{
format(gString, sizeof(gString), "{FFFFFF}%s\t%s\t%d\t%d\n", query, test, test3, test4);
strcat(aim, gString);
}
else
{
format(gString, sizeof(gString), "{FFFFFF}%s\t%s\t%d\t%d\n", query, test, test3, test4);
strcat(aim, gString);
}
memid ++;
}
cache_delete(result);
strins(aim, coordsstring, 0);
ShowPlayerDialog(playerid,DIALOG_ALIST,DIALOG_STYLE_TABLIST_HEADERS,tstring,aim,"Alege","Iesi");
return 1;
}
WRONG: this apear when i type /adminlist:
http://imgur.com/a/0lFXG - this is bad
GOOD: this apear corectly but you can't acces the helpers:
http://imgur.com/a/9VkG4 - this is good
Re: Command problem -
StR_MaRy - 23.09.2016
Код HTML:
CMD:adminlist(playerid, params[])
{
if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
if(!IsManager(playerid)) return SendClientMessage(playerid, COLOR_ERROR, "Nu ai gradul necesar ca sa folosesti aceasta comanda!");
new aim[1500], tstring[100];
format(tstring, sizeof(tstring),"{FFFFFF}Lista adminilor");
new memid = 0;
gQuery[0] = (EOS);
mysql_format(handle, gQuery, sizeof(gQuery), "SELECT `Name`,`AdminLevel`,`StaffPoints`,`HoursPlayed` FROM `players` WHERE `AdminLevel` > 0 ORDER BY `AdminLevel` DESC LIMIT 20");
new Cache:result = mysql_query (handle, gQuery);
new iResult[64];
new test[32], query[32];
new coordsstring[250] = "Name\tAdmin Level\tStaff Points\tHours Played\n";
for ( new i,a[11],h[11], j = cache_get_row_count ( ); i != j; ++i )
{
cache_get_field_content(i, "Name", iResult); format(query, 32, iResult);
format(Selected[memid][snume],32, query);
cache_get_field_content(i, "AdminLevel", iResult); format(test, 32, iResult);
cache_get_field_content(i, "StaffPoints", a);
cache_get_field_content(i, "HoursPlayed", h);
new id = GetPlayerID(Selected[memid][snume]);
if(id != INVALID_PLAYER_ID)
{
format(gString, sizeof(gString), "{FFFFFF}%s\t%s\t%d\t%d\n", query, test,strval(a),strval(h));
strcat(aim, gString);
}
else
{
format(gString, sizeof(gString), "{FFFFFF}%s\t%s\t%d\t%d\n", query, test,strval(a),strval(h));
strcat(aim, gString);
}
memid ++;
}
cache_delete(result);
strins(aim, coordsstring, 0);
ShowPlayerDialog(playerid,DIALOG_ALIST,DIALOG_STYLE_TABLIST_HEADERS,tstring,aim,"Alege","Iesi");
return 1;
}
SOLVE IT
Re: Command problem -
Spmn - 23.09.2016
Quote:
Originally Posted by StR_MaRy
SOLVE IT
|
That's rude. Nobody will help you with that attitude.