21.04.2013, 07:15
Tengo un problema con mi sistema de mensajes, cuando los bloqueo me siguen llegando. no bloquea los mensajes D:
Me pueden ayudar por favor?
Me pueden ayudar por favor?
Quote:
#include <a_samp> #define giveplayerid #define COLOR_WHITE 0xFFFFFFFF new ReceiverID[MAX_PLAYERS]; new PMfrom[MAX_PLAYERS]; new reply[MAX_PLAYERS]; new BloqueoDePrivados[MAX_PLAYERS]; public OnPlayerConnect(playerid) { reply[playerid] = 0; return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/pm", true)) { ShowPlayerDialog(playerid,755,DIALOG_STYLE_INPUT," Sistema de Mensajes Privados","Introduzca la ID del usuario","Hecho","Cancelar"); return 1; } if(!strcmp(cmdtext, "/nopm", true)) { BloqueoDePrivados[playerid] = 1; } if(!strcmp(cmdtext, "/sipm", true)) { BloqueoDePrivados[playerid] = 0; } return 0; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { new s1[264],s2[264],name[24]; if(dialogid == 755) { ReceiverID[playerid] = strval(inputtext); ShowPlayerDialog(playerid,756,DIALOG_STYLE_INPUT," Sistema de Mensajes Privados","Introduzca el texto que desea enviar:","Enviar","Cancelar"); return 1; } if(dialogid == 756) { if(response == 1) { if(reply[playerid] == 0) { PMfrom[ReceiverID[playerid]] = playerid; GetPlayerName(playerid, name, sizeof(name)); format(s1, sizeof(s1), "Ha recibido un nuevo PM de %s\n\n%s",name,inputtext); format(s2, sizeof(s2), "Nuevo PM de %s (%d)",name,playerid); ShowPlayerDialog(ReceiverID[playerid],757,DIALOG_STYLE_MSGBOX,s2,s1,"Responder","Cerrar "); PlayerPlaySound(ReceiverID[playerid], 1052, 0.0, 0.0, 0.0); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); } else if(reply[playerid] == 1) { PMfrom[ReceiverID[playerid]] = playerid; GetPlayerName(playerid, name, sizeof(name)); format(s1, sizeof(s1), "Ha recibido un nuevo PM de %s\n\n%s",name,inputtext); format(s2, sizeof(s2), "Nuevo PM de %s (%d)",name,playerid); ShowPlayerDialog(PMfrom[playerid],757,DIALOG_STYLE_MSGBOX,s2,s1,"Responder","Cerrar "); reply[playerid] = 0; PlayerPlaySound(PMfrom[playerid], 1052, 0.0, 0.0, 0.0); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); } } return 1; } if(dialogid == 757) { if(response == 1) { ShowPlayerDialog(playerid,756,DIALOG_STYLE_INPUT," Sistema de Mensajes Privados"," Introduzca el texto que desea enviar:","Hecho","Cancelar"); reply[playerid] = 1; return 1; } } return 0; } stock GetPlayerID(const Name[]) { for(new i; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { new pName[MAX_PLAYER_NAME]; GetPlayerName(i, pName, sizeof(pName)); if(strcmp(Name, pName, true)==0) { return i; } } } return -1; } |