17.12.2012, 19:17
@[HRD]Mar1 - I have no errors during compiling. The problem occurs directly while the script is running and is not happening that often to be located accurately. Meaning it crashes with one callback, but not always with this callback, but rather only "sometimes", and I can't get to know the reason. I have set in a crashdetect plugin and this is what I got after the crash... Can you make a conclusion based on this?
@Dwane - I combine callback OnPlayerCommandReceived and zcmd comand, so I have strcmp and zcmd command processors.
here is makeleader cmd:
It doesn't crash always when I type /makeleader, it sometiems crashes when I type /pay and when "sometime" when dicsonnect from server!
@ikey07 - I will check!
@Dwane - I combine callback OnPlayerCommandReceived and zcmd comand, so I have strcmp and zcmd command processors.
here is makeleader cmd:
Код:
CMD:makeleader(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 1337) { new id, lvl; if(sscanf(params, "ud", id, lvl)) SendClientMessage(playerid, COLOR_GRAD2, "{FFFFFF}[{CD661D}Balkan Country{FFFFFF}]: /makeleader [ID/Dio imena] [ID Org]"); else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, -1, "{FFFFFF}[{FF0000}Balkan Country{FFFFFF}]: {AFAFAF}Igrač nije online!"); else { new orgid = PlayerInfo[id][pLeader]; new pName[24], string[380]; GetPlayerName(id, pName, 24); if(lvl == 0) { if(strcmp(oClan[orgid][0][orgClan], pName, true) == 0) { strmid(oClan[orgid][0][orgClan], "Niko", 0, strlen("Niko"), 255); PlayerInfo[id][pLeader] = 0; format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je skinuo lidera!", GetPlayerNameEx(playerid)); SendClientMessage(id, -1, string); format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Skinuli ste lidera igraču %s!", GetPlayerNameEx(id)); SendClientMessage(playerid, -1, string); PlayerInfo[id][pLeader] = 0; PlayerInfo[id][pRank] = 0; UpdateText(3, orgid); SetPlayerSkin(id, 1); PlayerInfo[id][pChar] = 1; SacuvajIgraca(id); SaveOrg(orgid); } else if(strcmp(oClan[orgid][1][orgClan], pName, true) == 0) { strmid(oClan[orgid][1][orgClan], "Niko", 0, strlen("Niko"), 255); PlayerInfo[id][pLeader] = 0; format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je skinuo lidera!", GetPlayerNameEx(playerid)); SendClientMessage(id, -1, string); format(string, sizeof(string), "[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Skinuli ste lidera igraču %s!", GetPlayerNameEx(id)); SendClientMessage(playerid, -1, string); PlayerInfo[id][pRank] = 0; UpdateText(3, orgid); SetPlayerSkin(id, 1); PlayerInfo[id][pChar] = 1; SacuvajIgraca(id); SaveOrg(orgid); } PlayerInfo[id][pLeader] = 0; PlayerInfo[id][pRank] = 0; } else if(lvl > 0 && lvl < MAX_ORG) { if(PlayerInfo[id][pLeader] != 0) { SendClientMessage(playerid,WHITE,"[{FF0000}Balkan Country{FFFFFF}]{AFAFAF} Igrač je već lider, prvo mu skini lidera!"); return 1; } if(strcmp(oClan[lvl][0][orgClan], "Niko", true) == 0) { SetPlayerSkin(id, OI[lvl][oLiderSkin]); PlayerInfo[id][pChar] = OI[lvl][oLiderSkin]; strmid(oClan[lvl][0][orgClan], pName, 0, strlen(pName), 255); PlayerInfo[id][pLeader] = lvl; format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je dodjelio lidera %s!", GetPlayerNameEx(playerid), OI[lvl][oIme]); SendClientMessage(id, -1, string); format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Dodjelili ste lidera %s igraču %s!", OI[lvl][oIme], GetPlayerNameEx(id)); SendClientMessage(playerid, -1, string); PlayerInfo[id][pRank] = 6; UpdateText(3, lvl); SacuvajIgraca(id); SaveOrg(lvl); } else { if(strcmp(oClan[lvl][1][orgClan], "Niko", true) == 0) { SetPlayerSkin(id, OI[lvl][oLiderSkin]); PlayerInfo[id][pChar] = OI[lvl][oLiderSkin]; strmid(oClan[lvl][1][orgClan], pName, 0, strlen(pName), 255); PlayerInfo[id][pLeader] = lvl; format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Admin %s vam je dodjelio lidera %s!", GetPlayerNameEx(playerid), OI[lvl][oIme]); SendClientMessage(id, -1, string); format(string, sizeof(string), "[{FFFF00}Balkan Country{FFFFFF}] {AFAFAF}Dodjelili ste lidera %s igraču %s!",OI[lvl][oIme], GetPlayerNameEx(id)); SendClientMessage(playerid, -1, string); PlayerInfo[id][pRank] = 6; UpdateText(3, lvl); SacuvajIgraca(id); SaveOrg(lvl); } else { SendClientMessage(playerid, -1, "{FFFFFF}[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Mjesto lidera za tu organizaciju je popunjeno!"); } } } else { SendClientMessage(playerid, -1, "{FFFFFF}[{FF0000}Balkan Country{FFFFFF}] {AFAFAF}Pograљan ID organizacije!"); } } } else { SendClientMessage(playerid,WHITE,"[{FF0000}Balkan Country{FFFFFF}]{AFAFAF} Admini samo!"); } return 1; }
@ikey07 - I will check!