Unter den Includes:
new bool:inEvent[MAX_PLAYERS];
CMD:ejoin(playerid,params[])
{
new name[MAX_PLAYER_NAME], string[100];
GetPlayerName(playerid, name, sizeof(name));
if(zaehler >= sizeof(RandomSpawns)) zaehler = 0;
SetPlayerPos(playerid, RandomSpawns[zaehler][0], RandomSpawns[zaehler][1], RandomSpawns[zaehler][2]);
format(string, sizeof(string), "{FF1717}[EVENT]:{FFFFFF}{%06x} %s{FFFFFF} joined the Event - {FF1717}/ejoin", GetPlayerColor(playerid) >>> 8,name);
SendClientMessageToAll(0xC4C4C4FF, string);
zaehler++;
inEvent[playerid] = true;
return 1;
}
Alles anzeigen
Beim Dialog anzeigen:
new str[512], pname[MAX_PLAYER_NAME];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && inEvent[i])
{
GetPlayerName(i, pname, MAX_PLAYER_NAME);
format(str, sizeof(str), "%s%s (ID: %d)\n", str, pname, i);
}
}
ShowPlayerDialog(playerid, DIALOG_EVENTLIST, DIALOG_STYLE_MSGBOX, "Event Participants", str, "Ok", "");
Beim Verlassen des Events:
inEvent[playerid] = false;