Posts: 39
Threads: 10
Joined: Nov 2011
Reputation:
0
Hello, I'm have a command "admins" and it writes me "error"
can someone to do?
I'm need a command 'admins' to see admins online.
my function in admin mod:
GetPVarInt > Level
CMD:admins(playerid,params[])
thanks you..
Posts: 1,219
Threads: 51
Joined: Jul 2012
Код HTML:
if(strcmp("/admins",cmdtext,true,10) == 0)
{
SCM(playerid,-1,"Admins:");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt(i,"Level")>0)
{
new adminslist[128];
format(adminslist,sizeof(adminslist),"%s",SpielerName(i));
SCM(playerid,-1,adminslist);
}
}
}
}
Posts: 1,219
Threads: 51
Joined: Jul 2012
SRy SendClientMessage not SCM i have shortcuted this in my script
Posts: 1,219
Threads: 51
Joined: Jul 2012
15.09.2012, 13:31
(
Последний раз редактировалось BiosMarcel; 15.09.2012 в 14:07.
)
no no no define only change the SCM to SendClientMessage
Код HTML:
if(strcmp("/admins",cmdtext,true,10) == 0)
{
SendClientMessage(playerid,-1,"Admins:");
new name[MAX_PLAYER_NAME];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPVarInt(i,"Level")>0)
{
new adminslist[128];
format(adminslist,sizeof(adminslist),"%s",GetPlayerName(i,name,sizeof(name)));
SendClientMessage(playerid,-1,adminslist);
}
}
}
}
Posts: 1,219
Threads: 51
Joined: Jul 2012
Sry the code is a littlebit false edited! (In my Mode it only writes the name one time)
Posts: 308
Threads: 23
Joined: Jun 2012
Well Try To Use THis Its Better
PHP код:
if (strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
SendClientMessage(playerid, COLOR_GREEN, "|____ PUT YOU'RE GAMING NAME HERE Online Administration Team ____|"); // Dont Forget To Change THe Name There!
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] <= 1339 || PlayerInfo[i][pTester] >= 1)
{
new admtext[64];
if(PlayerInfo[i][pAppearList] == 1)
{
if(PlayerInfo[i][pAdmin] == 1339) { admtext = "Owner"; }
else if(PlayerInfo[i][pAdmin] == 1338) { admtext = "Co-Owner"; }
else if(PlayerInfo[i][pAdmin] == 1337) { admtext = "Elite Admin"; }
else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Server Developer"; }
else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Main Administrator"; }
else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Senior Administrator"; }
else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Administrator"; }
else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Global Moderator"; }
else if(PlayerInfo[i][pAdmin] == 1) { admtext = "Moderator"; } // Also YOu Can Edit Here The Names.
else if(PlayerInfo[i][pTester] == 3) { admtext = "Lead Tester"; }
else if(PlayerInfo[i][pTester] == 2) { admtext = "Tester"; }
else if(PlayerInfo[i][pTester] == 1) { admtext = "Trial Tester"; }
else { admtext = "Unknown Rank"; }
}
GetPlayerName(i, sendername, sizeof(sendername));
if(PlayerInfo[i][pAdminDuty] == 0 && PlayerInfo[i][pAppearList] == 1)
{
format(string, sizeof(string), "%s - %s", admtext, sendername);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(PlayerInfo[i][pAdminDuty] == 1 && PlayerInfo[i][pAppearList] == 1)
{
format(string, sizeof(string), "%s - %s (On Duty)", admtext, sendername);
SendClientMessage(playerid, TEAM_VAGOS_COLOR, string);
}
}
}
}
}
return 1;
}