/admins help
#1

how can i make this to dcmd

Quote:

COMMAND:admins(playerid, params[])
{
new iname[MAX_PLAYER_NAME], string[180], count=0;
SendClientMessage(playerid, AdminColor, "List of online admins:");
for(new i; i < MAX_PLAYERS; i++)
{
if(level[i] >= 1)
{
GetPlayerName(i, iname, sizeof(iname));
format(string, sizeof(string), "%s [Level: %i]",iname,level[i]);
SendClientMessage(playerid, AdminColor, string);
count++;
}
}
if(count==0) SendClientMessage(playerid, AdminColor, "No Online Admins.");
return 1;
}

I just did this but didnt work, gave me alot of errors..

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
dcmd(admins, 6, cmdtext);
return 0;
}

dcmd_admins{playerid, params[]}
{
new iname[MAX_PLAYER_NAME], string[180], count=0;
SendClientMessage(playerid, AdminColor, "List of online admins:");
for(new i; i < MAX_PLAYERS; i++)
{
if(level[i] >= 1)
{
GetPlayerName(i, iname, sizeof(iname));
format(string, sizeof(string), " %s Level: %i",iname,level[i]);
SendClientMessage(playerid, AdminColor, string);
count++;
}
}
if(count==0) SendClientMessage(playerid, AdminColor, "No admins online.");
return 1;
}

Also tell me how you do it so I learn thanks
Reply


Messages In This Thread
/admins help - by xir - 29.12.2010, 19:13
Re: /admins help - by Jochemd - 29.12.2010, 19:18
Re: /admins help - by xir - 29.12.2010, 19:22
Re: /admins help - by Jochemd - 29.12.2010, 19:23
Re: /admins help - by xir - 29.12.2010, 19:28
Re: /admins help - by Jochemd - 29.12.2010, 19:32

Forum Jump:


Users browsing this thread: 1 Guest(s)