13.01.2015, 14:27
I made a quick command you can take a look at, with info.
Replace the loop if you have the foreach include.
You can also use your own stocks instead of "name" and "ip" if you have any.
EDIT: Loop was bugged, fixed. Sorry.
Replace the loop if you have the foreach include.
pawn Код:
CMD:getaccounts(playerid, params[])
{
new string[128], ip = GetPlayerIp(playerid, ip, sizeof(ip)), name = GetPlayerName(playerid, name, sizeof(name)); // We define the "ip" and "name" that we use in the string underneath
for(new i; i < MAX_PLAYERS; i++) // Then we loop through all players on the server
{
format(string, sizeof(string), "Name: %s | IP: %s", name(i), ip(i)); // The for each player, we format a string with the "name" and "ip" we created above
SendClientMessage(playerid, -1, string); // Then as final, for each player there is, we send the formatted string to the playerid that used the command
}
return 1;
}
EDIT: Loop was bugged, fixed. Sorry.