17.03.2012, 21:07
Bueno tengo 4 errores en el comando reportar, cabe destacar que el gm usa MySQL, a continuaciуn los datos:
gm.pwn(31774) : error 012: invalid function call, not a valid address
gm.pwn(31774) : warning 215: expression has no effect
gm.pwn(31774) : error 001: expected token: ";", but found ")"
gm.pwn(31774) : error 029: invalid expression, assumed zero
gm.pwn(31774) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
La linea del error estб comentada, si quieren ver mejor: http://pastebin.com/euEaNZiE
gm.pwn(31774) : error 012: invalid function call, not a valid address
gm.pwn(31774) : warning 215: expression has no effect
gm.pwn(31774) : error 001: expected token: ";", but found ")"
gm.pwn(31774) : error 029: invalid expression, assumed zero
gm.pwn(31774) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Код:
//--------------------------------------------------------------------------------------------------------- if(strcmp(cmd, "/reportar", true) == 0) { new reported; tmp = strtokex(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, Blanco, "USO: /reportar [IdJugador/ParteDelNombre] [Razon]") && SendClientMessage(playerid, Naranja, "Atencion: Para reportes largos usar el foro!"); return 1; } if(!IsNumeric(tmp)) reported = ReturnUser(tmp,reported); else reported = strval(tmp); if(IsPlayerConnected(reported) && reported != INVALID_PLAYER_ID) { if(PlayerInfo[reported][pAdmin] >= 1) { SendClientMessage(playerid,Rojo,"ERROR: No puedes reportar a un administrador!"); return 1; } if(playerid == reported) { SendClientMessage(playerid,Rojo,"ERROR: No puedes reportarte ati mismo!"); return 1; } new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[128]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, Blanco, "USO: /reportar [IdJugador/ParteDelNombre] [Razon]"); SendClientMessage(playerid, Naranja, "Atencion: Para reportes largos usar el foro!"); return 1; } if(PlayerInfo[playerid][pReporting]==1) { SendClientMessage(playerid,AzulClaro,"* Parece que ya reportaste algo, intйntalo dentro de 30 segundos."); return 1; } for(new reportid = 1; reportid < MAX_REPORTS; reportid++) { if(Report[reportid][rState] == NOEXISTE) { new hour,minute,second,year,month,day; gettime(hour,minute,second); getdate(year, month, day); new query[128]; format(query, sizeof(query), "INSERT INTO `reportes` (`reportado`, `reportador`, `razon`, `fecha`) VALUES ('%s', '%s', '%s','%d:%d:%d | %d-%d-%d')", pNameEx(reported), pNameEx(playerid), (result),hour,minute,second,day,month,year); //LINEA DEL ERROR mysql_query(query); PlayerInfo[playerid][pReporting]=1; SetTimerEx("Reporting",30000,0,"i",playerid); Report[reportid][rState] = 1; Report[reportid][rReporter] = playerid; format(Report[reportid][rReporterName], 24, "%s", pName(playerid)); Report[reportid][rReported] = reported; format(Report[reportid][rReportedName], 24, "%s", pName(reported)); format(Report[reportid][rDescription], 128, "%s", result); format(Report[reportid][rTime], 24, "%d:%d:%d", hour,minute,second); SendClientMessage(playerid,Amarillo, "* Tu reporte ha sido enviado a los administradores!"); format(string, sizeof(string), "REPORTE: %s(%d) ha reportado a %s(%d) - Hora: %d:%d:%d", pName(playerid),playerid, pName(reported), reported,hour,minute,second); ABroadCastOnDuty(Amarillo, string); format(string, sizeof(string), "Razon: %s", (result)); ABroadCastOnDuty(Amarillo, string); return 1; } } } else { SendClientMessage(playerid,Rojo,"ERROR: Jugador no conectado."); } return 1; }