Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define DIALOG_LOG 20000
- #define DIALOG_MSJ 25000
- enum Logs
- {
- Chat_1[140],
- Chat_2[140],
- Chat_3[140]
- };
- new ChatLog[Logs];
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_LOG:
- {
- if(!response) return 1;
- switch(listitem)
- {
- case 0:
- {
- if(isnull(ChatLog[Chat_1]))
- {
- SendClientMessage(playerid, -1, "Está vacio");
- }
- else
- {
- new cadena[140];
- format(cadena,sizeof(cadena),"{CF0CDD}%s",ChatLog[Chat_1]);
- ShowPlayerDialog(playerid, DIALOG_MSJ, DIALOG_STYLE_MSGBOX, "Mensaje",cadena, "Ok", "");
- }
- }
- case 1:
- {
- if(isnull(ChatLog[Chat_2]))
- {
- SendClientMessage(playerid, -1, "Está vacio");
- }
- else
- {
- new cadena2[140];
- format(cadena2,sizeof(cadena2),"{CF0CDD}%s",ChatLog[Chat_2]);
- ShowPlayerDialog(playerid, DIALOG_MSJ, DIALOG_STYLE_MSGBOX, "Mensaje", cadena2, "Ok", "");
- }
- }
- case 2:
- {
- if(isnull(ChatLog[Chat_3]))
- {
- SendClientMessage(playerid, -1, "Está vacio");
- }
- else
- {
- new cadena3[140];
- format(cadena3,sizeof(cadena3),"{CF0CDD}%s",ChatLog[Chat_3]);
- ShowPlayerDialog(playerid, DIALOG_MSJ, DIALOG_STYLE_MSGBOX, "Mensaje", cadena3, "Ok", "");
- }
- }
- }
- }
- }
- return 1;
- }
- CMD:verlogs(playerid,params[])
- {
- new cadena[340];
- format(cadena,sizeof(cadena),"\n[1]- %s \n[2]- %s \n[3]- %s",ChatLog[Chat_1],ChatLog[Chat_2],ChatLog[Chat_3]);
- ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_LIST, "Tu lista de logs", cadena, "Abrir", "Cancelar");
- return 1;
- }
- CMD:crearlog(playerid,params[])
- {
- new msj[140];
- if(!sscanf(params,"s[140]",msj))
- {
- if(isnull(ChatLog[Chat_1]) && 100 <= sizeof(msj))
- {
- ChatLog[Chat_1] = msj;
- SendClientMessage(playerid, -1, "{CF0CDD}[+] {FFFFFF}Te quedan 2 espacios más");
- }
- else if (isnull(ChatLog[Chat_2]) && 100 <= sizeof(msj))
- {
- ChatLog[Chat_2] = msj;
- SendClientMessage(playerid, -1, "{CF0CDD}[+] {FFFFFF}Te queda 1 espacio más");
- }
- else if (isnull(ChatLog[Chat_3]) && 100 <= sizeof(msj))
- {
- ChatLog[Chat_3] = msj;
- SendClientMessage(playerid, -1, "{CF0CDD}[+] {FFFFFF}Esté era tu último espacio lbre ");
- }
- else
- {
- SendClientMessage(playerid, -1, "{CF0CDD}[+] {FFFFFF}Todos los espacios están llenos");
- }
- }
- else
- {
- SendClientMessage(playerid, -1, "use /crearlog[text]");
- }
- return 1;
- }
- CMD:borrarlog(playerid,params[])
- {
- new slot;
- if(sscanf(params, "i",slot))
- return SendClientMessage(playerid, -1, "Útiliza /borrarlog [1-3]");
- switch(slot)
- {
- case 1: ChatLog[Chat_1] = 0;
- case 2: ChatLog[Chat_2] = 0;
- case 3: ChatLog[Chat_3] = 0;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement