dcmd_report(playerid,params[]) { new reported, tmp[256], tp3[256], Index; tmp = strtok(params,Index), tp3 = strtok(params,Index); if(!strlen(params)) return SendClientMessage(playerid, red, "USA: /report [playerid] [razon]"); reported = strval(tmp); if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID) { if(IsPlayerFlooding(playerid)) return SendClientMessage(playerid,red,"[ADVERTENCIA]: No Agas Flood De Reportes! Espera 3 Segundos e Intentalo De Nuevo!"); iPlayerChatTime[playerid] = GetTickCount(); if(PlayerInfo[reported][Level] == ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"[ERROR]: Tu No Puedes Reportar a Ese Adminstrador"); if(playerid == reported) return SendClientMessage(playerid,red,"[ERROR]: No Te Puedes Reportar a Ti Mismo"); if(strlen(params) > 7) { new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str2[128], hour,minute,second; gettime(hour,minute,second); GetPlayerName(reported, reportedname, sizeof(reportedname)); GetPlayerName(playerid, reporter, sizeof(reporter)); format(str2, sizeof(str2), "||Reporte|| %s(%d) Reporto %s(%d) Razon: %s |@%d:%d:%d|", reporter,playerid, reportedname, reported, params[strlen(tmp)+1], hour,minute,second); MessageToAdmins(COLOR_RED,str2); SaveToFile("ReportLog",str2); format(str2, sizeof(str2), "Reporte(%d:%d:%d): %s(%d) Reporto %s(%d) Razon: %s", hour,minute,second, reporter,playerid, reportedname, reported, params[strlen(tmp)+1]); for(new i = 1; i < MAX_REPORTS-1; i++) Reports[i] = Reports[i+1]; Reports[MAX_REPORTS-1] = str2; return SendClientMessage(playerid,yellow, "Tu Reporte Fue Enviado a Los Administradores Conectados!"); } else return SendClientMessage(playerid,red,"[ERROR]: Esa No Es Una Razon Valida"); } else return SendClientMessage(playerid, red, "El Jugador No Esta Conectado!"); }
#define DIALOG_REPORT (1) dcmd_report(playerid,params[]) { ShowPlayerDialog(playerid, DIALOG_REPORT, DIALOG_STYLE_INPUT, "REPORT", "Escribe Tu Reporte Aqui:", "Reposrtar", "Cancel"); } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(dialogid == DIALOG_REPORT) { if(response) { new reported, tmp[256], tp3[256], Index; tmp = strtok(inputtext,Index), tp3 = strtok(inputtext,Index); if(!strlen(inputtext)) return SendClientMessage(playerid, red, "USA: /report [playerid] [razon]"); reported = strval(inputtext); if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID) { if(IsPlayerFlooding(playerid)) return SendClientMessage(playerid,red,"[ADVERTENCIA]: No Agas Flood De Reportes! Espera 3 Segundos e Intentalo De Nuevo!"); iPlayerChatTime[playerid] = GetTickCount(); if(PlayerInfo[reported][Level] == ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"[ERROR]: Tu No Puedes Reportar a Ese Adminstrador"); if(playerid == reported) return SendClientMessage(playerid,red,"[ERROR]: No Te Puedes Reportar a Ti Mismo"); if(strlen(inputtext) > 7) { new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str2[128], hour,minute,second; gettime(hour,minute,second); GetPlayerName(reported, reportedname, sizeof(reportedname)); GetPlayerName(playerid, reporter, sizeof(reporter)); format(str2, sizeof(str2), "||Reporte|| %s(%d) Reporto %s(%d) Razon: %s |@%d:%d:%d|", reporter,playerid, reportedname, reported, params[strlen(tmp)+1], hour,minute,second); MessageToAdmins(COLOR_RED,str2); SaveToFile("ReportLog",str2); format(str2, sizeof(str2), "Reporte(%d:%d:%d): %s(%d) Reporto %s(%d) Razon: %s", hour,minute,second, reporter,playerid, reportedname, reported, params[strlen(tmp)+1]); for(new i = 1; i < MAX_REPORTS-1; i++) Reports[i] = Reports[i+1]; Reports[MAX_REPORTS-1] = str2; return SendClientMessage(playerid,yellow, "Tu Reporte Fue Enviado a Los Administradores Conectados!"); } else return SendClientMessage(playerid,red,"[ERROR]: Esa No Es Una Razon Valida"); } else return SendClientMessage(playerid, red, "El Jugador No Esta Conectado!"); } } return 0; }
if(dialogid == DIALOG_REPORT) { if(response) { new reported, tmp[256], tp3[256], Index; tmp = strtok(inputtext,Index), tp3 = strtok(inputtext,Index); if(!strlen(inputtext)) return SendClientMessage(playerid, red, "USA: /report [playerid] [razon]"); reported = strval(inputtext); if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID) { if(IsPlayerFlooding(playerid)) return SendClientMessage(playerid,red,"[ADVERTENCIA]: No Agas Flood De Reportes! Espera 3 Segundos e Intentalo De Nuevo!"); iPlayerChatTime[playerid] = GetTickCount(); if(PlayerInfo[reported][Level] == ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"[ERROR]: Tu No Puedes Reportar a Ese Adminstrador"); if(playerid == reported) return SendClientMessage(playerid,red,"[ERROR]: No Te Puedes Reportar a Ti Mismo"); if(strlen(inputtext) > 7) { new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str2[128], hour,minute,second; gettime(hour,minute,second); GetPlayerName(reported, reportedname, sizeof(reportedname)); GetPlayerName(playerid, reporter, sizeof(reporter)); format(str2, sizeof(str2), "||Reporte|| %s(%d) Reporto %s(%d) Razon: %s |@%d:%d:%d|", reporter,playerid, reportedname, reported, params[strlen(tmp)+1], hour,minute,second); MessageToAdmins(COLOR_RED,str2); SaveToFile("ReportLog",str2); format(str2, sizeof(str2), "Reporte(%d:%d:%d): %s(%d) Reporto %s(%d) Razon: %s", hour,minute,second, reporter,playerid, reportedname, reported, params[strlen(tmp)+1]); for(new i = 1; i < MAX_REPORTS-1; i++) Reports[i] = Reports[i+1]; Reports[MAX_REPORTS-1] = str2; return SendClientMessage(playerid,yellow, "Tu Reporte Fue Enviado a Los Administradores Conectados!"); } else return SendClientMessage(playerid,red,"[ERROR]: Esa No Es Una Razon Valida"); } else return SendClientMessage(playerid, red, "El Jugador No Esta Conectado!"); } } return 0; }
params[strlen(tmp)+1]
strlen(inputtext+1)
if(dialogid == DIALOG_REPORT) { if(response) { new reported, tmp[256], tp3[256], Index; tmp = strtok(inputtext,Index), tp3 = strtok(inputtext,Index); if(!strlen(inputtext)) return SendClientMessage(playerid, red, "USA: /report [playerid] [razon]"); reported = strval(inputtext); if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID) { if(IsPlayerFlooding(playerid)) return SendClientMessage(playerid,red,"[ADVERTENCIA]: No Agas Flood De Reportes! Espera 3 Segundos e Intentalo De Nuevo!"); iPlayerChatTime[playerid] = GetTickCount(); if(PlayerInfo[reported][Level] == ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"[ERROR]: Tu No Puedes Reportar a Ese Adminstrador"); if(playerid == reported) return SendClientMessage(playerid,red,"[ERROR]: No Te Puedes Reportar a Ti Mismo"); if(strlen(inputtext) > 7) { new reportedname[MAX_PLAYER_NAME], reporter[MAX_PLAYER_NAME], str2[128], hour,minute,second; gettime(hour,minute,second); GetPlayerName(reported, reportedname, sizeof(reportedname)); GetPlayerName(playerid, reporter, sizeof(reporter)); format(str2, sizeof(str2), "||Reporte|| %s(%d) Reporto %s(%d) Razon: %s |@%d:%d:%d|", reporter,playerid, reportedname, reported, strlen(inputtext+1), hour,minute,second); MessageToAdmins(COLOR_RED,str2); SaveToFile("ReportLog",str2); format(str2, sizeof(str2), "Reporte(%d:%d:%d): %s(%d) Reporto %s(%d) Razon: %s", hour,minute,second, reporter,playerid, reportedname, reported, strlen(inputtext+1)); for(new i = 1; i < MAX_REPORTS-1; i++) Reports[i] = Reports[i+1]; Reports[MAX_REPORTS-1] = str2; return SendClientMessage(playerid,yellow, "Tu Reporte Fue Enviado a Los Administradores Conectados!"); } else return SendClientMessage(playerid,red,"[ERROR]: Esa No Es Una Razon Valida"); } else return SendClientMessage(playerid, red, "El Jugador No Esta Conectado!"); } } return 0; }
Disculpa por revivir tema, pero me urge :P
Como lo puedo hacer eso en y_cmd? porque y_cmd no usa strval ni tmp :C gracias |