Slotbezogen nicht
Ich lass die nachicht direkt in einer Tabelle setzen wo alle Nachichten für jeden sind
Hier bitte ein kleiner Anfang ^^:
new ids[MAX_PLAYERS], counter;
#define DIALOG_LISTE 1
ocmd:liste(playerid)
{
new string[500],pName[MAX_PLAYER_NAME],string2[MAX_PLAYER_NAME+4];
counter = 0;
for(new x; x < MAX_PLAYERS; x++){
if(IsPlayerConnected(x)){
GetPlayerName(x,pName,MAX_PLAYER_NAME);
format(string,sizeof(string),"%s %s\n",string,pName);
ids[counter] = x;
counter++;
}
}
printf(string);
ShowPlayerDialog(playerid,DIALOG_LISTE,DIALOG_STYLE_LIST,"Namen",string,"Auswählen","Schließen");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1){
for(new i; i< counter; i++){
if(listitem == i && response == 1){
new pName[MAX_PLAYER_NAME];
GetPlayerName(ids[i],pName,MAX_PLAYER_NAME);
printf("nummer : %d / Name: %s und die id %d",i,pName,ids[i]);
}
}
}
return 1;
}
Ich konnte nicht wiederstehen
deine Grundidee für ein System ist wirklich nicht schlecht.
@ RFT Wenn du noch verbesserungen an dem codeschnipsel hast bitte drunterposten oder ein besser Methode , was anderes ist mir auf die kürze nicht eingefallen.