29.12.2010, 19:13
how can i make this to dcmd
I just did this but didnt work, gave me alot of errors..
Also tell me how you do it so I learn thanks
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; } |
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; } |