Help Get +1 REP
#1

This is the pwn code of Ladmin
Cmd /admins
i need to change the style showing /admins into luxadmin showing style
So can anybody Make luxadmin this code compatiable to ladmin pls
Those who help me will get +1 rep



CMD:admins(playerid,params[]) {
#pragma unused params
new Count[2], i, string[128];
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
if(PlayerInfo[i][Level] > 0) Count[0]++;
if(IsPlayerAdmin(i)) Count[1]++;
}

#if defined HIDE_ADMINS
if(PlayerInfo[playerid][Level] == 0) {
if(Count[0] >= 1) {
format(string, sizeof(string), "There are %d Administrators online. Use /report <id> <reason> if you suspect a player of cheating", Count[0]);
return SendClientMessage(playerid, blue, string);
} else return SendClientMessage(playerid, blue, "No Administrators online");
}
#endif

if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][Level] == 0) ) return SendClientMessage(playerid, blue, "No Administrators online");

if(Count[0] == 1) {
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Level] > 0) {
format(string, sizeof(string), "Admin: (%d)%s [%d]", i, PlayerName2(i), PlayerInfo[i][Level] ); SendClientMessage(playerid, blue, string);
}
}

if(Count[0] > 1) {
new x; format(string, sizeof(string), "Admins: ");
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][Level] > 0)
{
format(string,sizeof(string),"%s(%d)%s [%d]",string,i,PlayerName2(i),PlayerInfo[i][Level]);
x++;
if(x >= 5) {
SendClientMessage(playerid, blue, string); format(string, sizeof(string), "Admins: "); x = 0;
}
else format(string, sizeof(string), "%s, ", string);
}
if(x <= 4 && x > 0) {
string[strlen(string)-3] = '.';
SendClientMessage(playerid, blue, string);
}
}

if( (Count[1] == 1) && (PlayerInfo[playerid][Level] > 0) ) {
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i)) {
format(string, sizeof(string), "RCON Admin: (%d)%s", i, PlayerName2(i)); SendClientMessage(playerid, COLOR_WHITE, string);
}
}
if(Count[1] > 1) {
new x; format(string, sizeof(string), "RCON Admins: ");
for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
{
format(string,sizeof(string),"%s(%d)%s",string,i,P layerName2(i));
x++;
if(x >= 5) {
SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "RCON Admins: "); x = 0;
}
else format(string, sizeof(string), "%s, ", string);
}
if(x <= 4 && x > 0) {
string[strlen(string)-3] = '.';
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
return 1;
}




Thankx
Sorry For my bad english
Reply
#2

Create youw own with your own experience. lAdmin is old admin system, as far as I know, and changing dcmds to zcmd, adding sscanf is a lot of harder then to fixing all those mistakes. First error u made is on second line. You can define admin command like this: CMD:admins(playerid), and avoid pragma unused params. Secondly, 2 loops? for /admins? using Loop? I would rather put admins in an array when they login, more easier (better wasting memory then CPU), and you defined only Count[2], and wheres Count[1] and Count[2]? And Do you know what means Count[1]? There is just 1 cell, so u cannot do nothing. It should be defined like Count[MAX_PLAYERS], so tehre would be enought cells and no only 1. Thirdly, you mad enew variable x. Then you made some real strange checks like: if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][Level] == 0) ) return SendClientMessage(playerid, blue, "No Administrators online");


Those systems, evene if you fix that will go so slow, and better made your new one with just 1 array (putting admins into it), and no those loops (There are few loops on one command, and it's really sucks).

That's advice from me.
Aco.
Reply
#3

Please use [pawn ] [/pawn]
I can't understand a shit >.<
Reply
#4

Quote:
Originally Posted by aco_SRBIJA
Посмотреть сообщение
Create youw own with your own experience. lAdmin is old admin system, as far as I know, and changing dcmds to zcmd, adding sscanf is a lot of harder then to fixing all those mistakes. First error u made is on second line. You can define admin command like this: CMD:admins(playerid), and avoid pragma unused params. Secondly, 2 loops? for /admins? using Loop? I would rather put admins in an array when they login, more easier (better wasting memory then CPU), and you defined only Count[2], and wheres Count[1] and Count[2]? And Do you know what means Count[1]? There is just 1 cell, so u cannot do nothing. It should be defined like Count[MAX_PLAYERS], so tehre would be enought cells and no only 1. Thirdly, you mad enew variable x. Then you made some real strange checks like: if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][Level] == 0) ) return SendClientMessage(playerid, blue, "No Administrators online");


Those systems, evene if you fix that will go so slow, and better made your new one with just 1 array (putting admins into it), and no those loops (There are few loops on one command, and it's really sucks).

That's advice from me.
Aco.
WhaDuFaq?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)