H3ater.SG Posted February 28, 2015 Report Share Posted February 28, 2015 Buna seara. Am incercat sa implementez o comanda de pe gamemode-ul "bugged" (/factions") sa apara applications online sau offline Cand inchid aplicatiile de pe panel, pe server inca apare ca sunt deschise Cum as putea sa fac sa fie identice? Comanda /factions CMD:factions(playerid, params[]) { new members; new stringz2[1024]; for(new xf = 0; xf < MAX_GROUPS; xf++) { if(strlen(groupVariables[xf][gGroupName]) >= 1 && strcmp(groupVariables[xf][gGroupName], "None", true)) { new stringy2[256], app; mysql_format(handle, stringy2, 256, "SELECT * FROM `playeraccounts` WHERE `playerGroup` = '%d'", xf); new Cache: resultx = mysql_query (handle, stringy2); members = cache_get_row_count(); cache_delete(resultx); mysql_format(handle, stringy2, 256, "SELECT * FROM `groups` WHERE `groupID` = '%d'", xf); new Cache: resultd = mysql_query(handle, stringy2); if(cache_get_row_count() != 0) { cache_get_field_content(0, "groupApplication", result); app = strval(result); } cache_delete(resultd); if(app == 0) { format(stringz2, sizeof(stringz2),"%sID: %d - %s [%d/%d] {00FF00}[applications online]{FFFFFF}n", stringz2,xf, groupVariables[xf][gGroupName], members, groupVariables[xf][gSlots]); } else if(app == 1) { format(stringz2, sizeof(stringz2),"%sID: %d - %s [%d/%d] {FF0000}[applications offline]{FFFFFF}n", stringz2,xf, groupVariables[xf][gGroupName], members, groupVariables[xf][gSlots]); } } ShowPlayerDialog(playerid, DIALOG_FACTIONS, DIALOG_STYLE_LIST,"Server: Factions", stringz2, "Select", "Cancel"); } return 1; } Dialog_factions case DIALOG_FACTIONS: { if(!response) { hidePlayerDialog(playerid); SelFac[playerid] = 0; } else { new f = listitem+1; SelFac[playerid] = f; new szDialogs[512]; new lead[MAX_PLAYER_NAME]; format(lead, MAX_PLAYER_NAME, "None"); new query[256]; format(query, 256, "SELECT * FROM `playeraccounts` WHERE `playerGroup` = '%d' AND `playerGroupRank` = '7'", f); new Cache: masta = mysql_query(handle, query); if(cache_get_row_count() >= 1) { cache_get_field_content(0, "playerName", result); format(lead, MAX_PLAYER_NAME, result); } cache_delete(masta); format(query, 256, "SELECT * FROM `playeraccounts` WHERE `playerGroup` = '%d'", f); new Cache: mastau = mysql_query(handle, query); new membs = cache_get_row_count(); cache_delete(mastau); mysql_format(handle, query, 256, "SELECT * FROM groups WHERE groupID = '%d'", f); new Cache: val = mysql_query(handle, query); new apply; new apply2[64]; if(cache_get_row_count() >= 1) { cache_get_field_content(0, "groupApplication", result); apply = strval(result); } cache_delete(val); if(apply == 0) { format(apply2, 64, "Online"); } else { format(apply2, 64, "Offline"); } new onmembers; foreach(Player, i) { if(playerVariables[pGroup] == f) { onmembers++; } } if(strlen(lead) >= 1 && strcmp(lead, "None", true)) { new id = GetPlayerID(lead); if(id != INVALID_PLAYER_ID) { format(szDialogs, 512, "Faction info:nnFaction name: %snLeader: %s(online)nMembers: %d/%dnOnline members: %dnApplications: %s", groupVariables[f][gGroupName], lead, membs, groupVariables[f][gSlots], onmembers, apply2); } else { format(szDialogs, 512, "Faction info:nnFaction name: %snLeader: %s(offline)nMembers: %d/%dnOnline members: %dnApplications: %s", groupVariables[f][gGroupName], lead, membs, groupVariables[f][gSlots], onmembers, apply2); } } else { format(szDialogs, 512, "Faction info:nnFaction name: %snLeader: NonenMembers: %d/%dnOnline members: %d", groupVariables[f][gGroupName], membs, groupVariables[f][gSlots], onmembers, apply2); } ShowPlayerDialog(playerid, DIALOG_FACTIONS2, DIALOG_STYLE_MSGBOX, "Server: Factions", szDialogs, "Close", ""); } } case DIALOG_FACTIONS2: { hidePlayerDialog(playerid); } Link to comment Share on other sites More sharing options...
Question
H3ater.SG
Buna seara. Am incercat sa implementez o comanda de pe gamemode-ul "bugged" (/factions") sa apara applications online sau offline
Cand inchid aplicatiile de pe panel, pe server inca apare ca sunt deschise
Cum as putea sa fac sa fie identice?
Comanda /factions
Dialog_factions
Link to comment
Share on other sites
0 answers to this question
Recommended Posts