26.01.2018, 14:40
Now, i get another crash new from a different command. I think is because i use simultaneously on my gamemode CMD and YMCD (examples in first post).
server_log
https://pastebin.com/VxtnC48u
COMMAND with line 27490 (line is with red - scroll down):
server_log
https://pastebin.com/VxtnC48u
COMMAND with line 27490 (line is with red - scroll down):
Код:
CMD:spec(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to log in first."); if(!PlayerInfo[playerid][pAdmin] && !PlayerInfo[playerid][pHelper]) return SCM(playerid, COLOR_RED, AdminOnly); if(InRaceArena[playerid] == 1) return SCM(playerid, COLOR_LGREEN, "Nu ai voie sa folosesti aceasta comanda atata timp cat esti in arena de curse!"); if(Alive[playerid] == 0) return SCM(playerid, COLOR_LGREEN, "Wait..."); new id, string[256], Float: health, manevra[126], bool:pizda; if(sscanf(params, "u", id)) return SCM(playerid, COLOR_GREY, "Syntax:{FFFFFF} /spec [playerid]"); if(id == INVALID_PLAYER_ID || id == playerid) return SCM(playerid, COLOR_GREY, "The specified player is not connected, or has not authenticated."); if(GetPVarInt(id, "specme") > 0 && PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use /spec on this admin."); if(Spectate[id] != -1) return SendClientMessage(playerid, COLOR_GREY, "That player is on spectating someone else."); if(TutTime[id] >= 1) return SendClientMessage(playerid, COLOR_GREY, "This player is currently in the tutorial."); if(PlayerInfo[id][pAdmin] != 0 && PlayerInfo[playerid][pHelper] != 0) return SendClientMessage(playerid, COLOR_GREY, "You can't spectate an admin."); if(Spectate[playerid] == -1) { saveCurrentPosition(playerid); } Spectate[playerid] = id; foreach(new x : Reporturi) { if(Reports[x][reportValid] && Reports[x][reportPlayer] == id && (Reports[x][reportType] == r_type_stuck || Reports[x][reportType] == r_type_dm)) { AdaugaRaport(playerid, "Reports", 1); switch(Reports[x][reportType]) { case r_type_stuck: { format(string, sizeof(string), "Admin %s is now spectating %s (reported for being stuck).", GetName(playerid), GetName(id)); ABroadCast(COLOR_INFO,string,1); format(manevra, 126, "%s is stuck.", GetName(id)); } case r_type_dm: { format(string, sizeof(string), "Admin %s is now spectating %s (reported for deathmatch).", GetName(playerid), GetName(id)); ABroadCast(COLOR_INFO,string,1); format(manevra, 126, "%s was reported for deathmatch by %s.", GetName(id), GetName(Reports[x][reportBy])); } } pizda = true; Reports[x][reportValid] = 0; Reports[x][reportBy] = INVALID_PLAYER_ID; Reports[x][reportPlayer] = INVALID_PLAYER_ID; Reports[x][reportType] = r_type_none; Reports[x][reportTime] = 0; format(Reports[x][reportText], 128, "-"); new cur = x; Iter_SafeRemove(Reporturi, cur, x); break; } } foreach(new x : Cheateri) { if(Cheaters[x][cheatValid] && Cheaters[x][cheatCheater] == id && Cheaters[x][cheatScore] >= 1) { AdaugaRaport(playerid, "Reports", 1); format(string, sizeof(string), "Admin %s is now spectating %s (reported for cheats).", GetName(playerid), GetName(id)); ABroadCast(COLOR_INFO,string,1); format(manevra, 126, "%s was reported for cheats by %s.", GetName(id), GetName(Cheaters[x][cheatPlayer])); pizda = true; Cheaters[x][cheatPlayer] = INVALID_PLAYER_ID; Cheaters[x][cheatCheater] = INVALID_PLAYER_ID; Cheaters[x][cheatValid] = 0; Cheaters[x][cheatType] = c_type_none; Cheaters[x][cheatTime] = 0; Cheaters[x][cheatScore] = 0; format(Cheaters[x][cheatText], 128, "-"); new cur = x; Iter_SafeRemove(Cheateri, cur, x); break; } } if(pizda) { mysql_format(SQL, gString, sizeof(gString),"INSERT INTO report_logs (`playerid`,`adminid`,`problem`,`answer`,`time`) VALUES ('%d','%d','%e','/spec','%d')",PlayerInfo[id][pSQLID],PlayerInfo[playerid][pSQLID],manevra,gettime()); // LINE mysql_tquery(SQL, gString, "", ""); } new weap, am, are = 0,str33[128],wName[50]; format(string, sizeof(string),"%s's weapons:",GetName(id)); for(new is; is < 13; is++) { GetPlayerWeaponData(id, is, weap, am); if(weap >= 1 && am >= 1) { are = 1; GetWeaponNameEx(weap, wName, sizeof(wName)); format(str33, sizeof(str33)," [%s - %d]",wName,am); strcat(string, str33); } } if(are == 1) { SendClientMessage(playerid, COLOR_GREY, string); } else if(are == 0) { new noweapon[156]; format(noweapon, sizeof(noweapon), "%s doesn't have any weapons!", GetName(id)); SendClientMessage(playerid, COLOR_GREY, noweapon); } GetPlayerHealth(Spectate[playerid], health); format(string, sizeof(string), "(%d) %s | Level: %d | Health: %.0f | AFK: %d | Duty: %d | Ping: %d", Spectate[playerid], GetName(id), PlayerInfo[Spectate[playerid]][pLevel], health, IsPlayerAFK[Spectate[playerid]], OnDuty[Spectate[playerid]], GetPlayerPing(Spectate[playerid])); SendClientMessage(playerid, COLOR_WHITE, string); TogglePlayerSpectating(playerid, 1); ShowDMG[playerid] = 1; if(EstiFondator(id)) SCMF(id, COLOR_WHITE, "* Admin %s is now spectating you.", GetName(playerid)); if(IsPlayerInAnyVehicle(Spectate[playerid])) { new carid = GetPlayerVehicleID(Spectate[playerid]); PlayerSpectateVehicle(playerid, carid); SpectateState[id] = 2; } else { PlayerSpectatePlayer(playerid, Spectate[playerid]); SpectateState[id] = 1; } PlayerTextDrawSetString(playerid, TextDrawSpec[playerid][1], "LOADING..."); PlayerTextDrawShow(playerid, TextDrawSpec[playerid][1]); return 1; }