PDA

View Full Version : Admin Ranks?


sanplayer
09/10/2011, 02:22 PM
Ok I ****** for about 2 hours.
how do i add Admin Ranks

99999 = Owner
99998 = Co-Owner
1339 = Head Scripter
1338 = Scripter
1337 = Head Admin
4 = Senior Admin
3 = General Admin
2 = Junior Admin
1 = Moderator.

And how do i make a /admins command with these ranks?

TheLonelyBeast
09/10/2011, 02:24 PM
Umm do you even know how make commands and also try http://forum.sa-mp.com/search.php because you siad you search goggle only :)

sanplayer
09/10/2011, 02:25 PM
I have searched i can make commands yes i got some I dont know how to make

The Admin Ranks

/admins command.

TheLonelyBeast
09/10/2011, 02:27 PM
Ok im make commands for you but i am showing so you can also learn and remeber add me e-mail in signature

sanplayer
09/10/2011, 02:30 PM
ok :)

Zonoya
09/10/2011, 02:51 PM
i can show u right here mate i have a /admins command

dcmd_Admins(playerid, params[])
{
new count = 0;
new string[128];
#pragma unused params

SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "___________ |- Current Online Admins -| ___________");
SendClientMessage(playerid, Green, " ");

for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pInfo[i][AdminLevel] == 1)
{
count++;
new name[24];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s [LVL %d][Rank: Junior Modorator]\n", name, pInfo[i][AdminLevel]);
SendClientMessage(playerid, Yellow, string);
SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "________________________________________________");
}
if(pInfo[i][AdminLevel] == 2)
{
count++;
new name[24];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s [LVL %d][Rank: Modorator]\n", name, pInfo[i][AdminLevel]);
SendClientMessage(playerid, Yellow, string);
SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "________________________________________________");
}
if(pInfo[i][AdminLevel] == 3)
{
count++;
new name[24];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s [LVL %d][Rank: Super Moderator]\n", name, pInfo[i][AdminLevel]);
SendClientMessage(playerid, Yellow, string);
SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "________________________________________________");
}
if(pInfo[i][AdminLevel] == 4)
{
count++;
new name[24];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s [LVL %d][Rank: Junior Admin]\n", name, pInfo[i][AdminLevel]);
SendClientMessage(playerid, Yellow, string);
SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "________________________________________________");
}
if(pInfo[i][AdminLevel] == 5)
{
count++;
new name[24];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s [LVL %d][Rank: Super Admin]\n", name, pInfo[i][AdminLevel]);
SendClientMessage(playerid, Yellow, string);
SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "________________________________________________");
}
if(pInfo[i][AdminLevel] == 6)
{
count++;
new name[24];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s [LVL %d][Rank: Head Admin]\n", name, pInfo[i][AdminLevel]);
SendClientMessage(playerid, Yellow, string);
SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "________________________________________________");
}
if(pInfo[i][AdminLevel] == 1335)
{
count++;
new name[24];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s [LVL %d][Rank: Co-Co-Owner]\n", name, pInfo[i][AdminLevel]);
SendClientMessage(playerid, Yellow, string);
SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "________________________________________________");
}
if(pInfo[i][AdminLevel] == 1336)
{
count++;
new name[24];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s [LVL %d][Rank: Co-Owner]\n", name, pInfo[i][AdminLevel]);
SendClientMessage(playerid, Yellow, string);
SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "________________________________________________");
}
if(pInfo[i][AdminLevel] == 1337)
{
count++;
new name[24];
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s [LVL %d][Rank: Owner]\n", name, pInfo[i][AdminLevel]);
SendClientMessage(playerid, Yellow, string);
SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "________________________________________________");
}
}
}
if(count == 0)
{
SendClientMessage(playerid, Yellow,"No Admins online right now buddy.");
SendClientMessage(playerid, Green, " ");
SendClientMessage(playerid, Green, "_______________________________________________");
SendClientMessage(playerid, Green, " ");
}
return 1;
}


mine uses dcmd but thats the general structure

HyperZ
09/10/2011, 02:59 PM
Zcmd version:
CMD:admins( playerid, params[ ] )
{
new count, bool:online, string[128], AdminRank[70], name[24];
for(new i,g=GetMaxPlayers(); i < g; i++)
{
if(IsPlayerConnected(i))
{
if(1 <= pAdminLevel[i]/*Change this var to yours*/ <= 99999)
{


online = true;
switch(pAdminLevel[i]) /* << Change this var to yours*/
{
case 1: AdminRank = "Moderator";
case 2: AdminRank = "Junior Admin";
case 3: AdminRank = "General Admin";
case 4: AdminRank = "Senior Admin";
case 1337: AdminRank = "Head Admin";
case 1338: AdminRank = "Scripter";
case 1339: AdminRank = "Head Scripter";
case 99998: AdminRank = "Co-Owner";
case 99999: AdminRank = "Owner";

}
GetPlayerName(i, name, sizeof(name));
format(string,sizeof(string), "%s %s [%s],",string, name, AdminRank);
count++;
if(count == 4)
{
format(string,sizeof(string),"Admins: %s",string);
SendClientMessage(playerid, -1, string);
string = "";
count = 0;
}

}
}
}
if(count)
{
format(string,sizeof(string),"Admins: %s",string);
SendClientMessage(playerid, -1, string);
}
if(!online) SendClientMessage(playerid, -1,"No Admin online in the list.");
return 1;
}

Strcmp version:
if (strcmp("/admins", cmdtext, true, 10) == 0)
{
new count, bool:online, string[128], AdminRank[70], name[24];
for(new i,g=GetMaxPlayers(); i < g; i++)
{
if(IsPlayerConnected(i))
{
if(1 <= pAdminLevel[i]/*<<<Change this var to yours*/ <= 99999)
{


online = true;
switch(pAdminLevel[i]) /*Change this var to yours*/
{
case 1: AdminRank = "Moderator";
case 2: AdminRank = "Junior Admin";
case 3: AdminRank = "General Admin";
case 4: AdminRank = "Senior Admin";
case 1337: AdminRank = "Head Admin";
case 1338: AdminRank = "Scripter";
case 1339: AdminRank = "Head Scripter";
case 99998: AdminRank = "Co-Owner";
case 99999: AdminRank = "Owner";

}
GetPlayerName(i, name, sizeof(name));
format(string,sizeof(string), "%s %s [%s],",string, name, AdminRank);
count++;
if(count == 4)
{
format(string,sizeof(string),"Admins: %s",string);
SendClientMessage(playerid, -1, string);
string = "";
count = 0;
}

}
}
}
if(count)
{
format(string,sizeof(string),"Admins: %s",string);
SendClientMessage(playerid, -1, string);
}
if(!online) SendClientMessage(playerid, -1,"No Admin online in the list.");
return 1;
}

sanplayer
09/10/2011, 03:52 PM
Zcmd version:
CMD:admins( playerid, params[ ] )
{
new count, bool:online, string[128], AdminRank[70], name[24];
for(new i,g=GetMaxPlayers(); i < g; i++)
{
if(IsPlayerConnected(i))
{
if(1 <= pAdminLevel[i]/*Change this var to yours*/ <= 99999)
{


online = true;
switch(pAdminLevel[i]) /* << Change this var to yours*/
{
case 1: AdminRank = "Moderator";
case 2: AdminRank = "Junior Admin";
case 3: AdminRank = "General Admin";
case 4: AdminRank = "Senior Admin";
case 1337: AdminRank = "Head Admin";
case 1338: AdminRank = "Scripter";
case 1339: AdminRank = "Head Scripter";
case 99998: AdminRank = "Co-Owner";
case 99999: AdminRank = "Owner";

}
GetPlayerName(i, name, sizeof(name));
format(string,sizeof(string), "%s %s [%s],",string, name, AdminRank);
count++;
if(count == 4)
{
format(string,sizeof(string),"Admins: %s",string);
SendClientMessage(playerid, -1, string);
string = "";
count = 0;
}

}
}
}
if(count)
{
format(string,sizeof(string),"Admins: %s",string);
SendClientMessage(playerid, -1, string);
}
if(!online) SendClientMessage(playerid, -1,"No Admin online in the list.");
return 1;
}

Strcmp version:
if (strcmp("/admins", cmdtext, true, 10) == 0)
{
new count, bool:online, string[128], AdminRank[70], name[24];
for(new i,g=GetMaxPlayers(); i < g; i++)
{
if(IsPlayerConnected(i))
{
if(1 <= pAdminLevel[i]/*<<<Change this var to yours*/ <= 99999)
{


online = true;
switch(pAdminLevel[i]) /*Change this var to yours*/
{
case 1: AdminRank = "Moderator";
case 2: AdminRank = "Junior Admin";
case 3: AdminRank = "General Admin";
case 4: AdminRank = "Senior Admin";
case 1337: AdminRank = "Head Admin";
case 1338: AdminRank = "Scripter";
case 1339: AdminRank = "Head Scripter";
case 99998: AdminRank = "Co-Owner";
case 99999: AdminRank = "Owner";

}
GetPlayerName(i, name, sizeof(name));
format(string,sizeof(string), "%s %s [%s],",string, name, AdminRank);
count++;
if(count == 4)
{
format(string,sizeof(string),"Admins: %s",string);
SendClientMessage(playerid, -1, string);
string = "";
count = 0;
}

}
}
}
if(count)
{
format(string,sizeof(string),"Admins: %s",string);
SendClientMessage(playerid, -1, string);
}
if(!online) SendClientMessage(playerid, -1,"No Admin online in the list.");
return 1;
}

Yeh but then how do i make it so i can set myself a admin level?

sanplayer
09/10/2011, 04:09 PM
Yeh but then how do i make it so i can set myself a admin level?

What code do i use so it creates files for users and has in it Level etc?

And whats the code for /o

When a admin does it : [(ADMIN RANK) (NAME): (TEXT)]
When a normal player does it : [(NAME): (TEXT)]

?

Tigerkiller
09/10/2011, 05:47 PM
first of all

create an login / register system by yourself

and then try to make /admins cmd

sanplayer
09/10/2011, 05:59 PM
I cant make any of that lol