Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Kërko Plugins [Me Ngjyra]
Code:
/* AMX Mod X * NextMap Plugin * * by the AMX Mod X Development Team * originally developed by OLO * * This file is part of AMX Mod X. * * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * In addition, as a special exception, the author gives permission to * link the code of this program with the Half-Life Game Engine ("HL * Engine") and Modified Game Libraries ("MODs") developed by Valve, * L.L.C ("Valve"). You must obey the GNU General Public License in all * respects for all of the code used other than the HL Engine and MODs * from Valve. If you modify this file, you may extend this exception * to your version of the file, but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from your * version. */ #include <amxmodx> #include <colorchat> // WARNING: If you comment this line make sure // that in your mapcycle file maps don't repeat. // However the same map in a row is still valid. #define OBEY_MAPCYCLE new g_nextMap[32] new g_mapCycle[32] new g_pos public plugin_init() { register_plugin("NextMap", AMXX_VERSION_STR, "AMXX Dev Team") register_dictionary("nextmap.txt") register_event("30", "changeMap", "a") register_clcmd("say nextmap", "sayNextMap", 0, "- displays nextmap") register_clcmd("say currentmap", "sayCurrentMap", 0, "- display current map") register_clcmd("say ff", "sayFFStatus", 0, "- display friendly fire status") register_cvar("amx_nextmap", "", FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY) new szString[32], szString2[32], szString3[8] get_localinfo("lastmapcycle", szString, 31) parse(szString, szString2, 31, szString3, 7) g_pos = str_to_num(szString3) get_cvar_string("mapcyclefile", g_mapCycle, 31) if (!equal(g_mapCycle, szString2)) g_pos = 0 // mapcyclefile has been changed - go from first readMapCycle(g_mapCycle, g_nextMap, 31) set_cvar_string("amx_nextmap", g_nextMap) format(szString3, 31, "%s %d", g_mapCycle, g_pos) // save lastmapcycle settings set_localinfo("lastmapcycle", szString3) } getNextMapName(szArg[], iMax) { new len = get_cvar_string("amx_nextmap", szArg, iMax) if (ValidMap(szArg)) return len len = copy(szArg, iMax, g_nextMap) set_cvar_string("amx_nextmap", g_nextMap) return len } public sayNextMap() { new name[32] getNextMapName(name, 31) client_print_color(0, print_chat, "^4%L ^3%s", LANG_PLAYER, "^4NEXT_MAP", name) } public sayCurrentMap() { new mapname[32] get_mapname(mapname, 31) client_print_color(0, print_chat, "^4%L: ^3%s", LANG_PLAYER, "^4PLAYED_MAP", mapname) } public sayFFStatus() { client_print_color(0, print_chat, "^4%L: ^3%L", LANG_PLAYER, "^4FRIEND_FIRE", LANG_PLAYER, get_cvar_num("mp_friendlyfire") ? "^3ON" : "^4OFF") } public delayedChange(param[]) { set_cvar_float("mp_chattime", get_cvar_float("mp_chattime") - 2.0) server_cmd("changelevel %s", param) } public changeMap() { new string[32] new Float:chattime = get_cvar_float("mp_chattime") set_cvar_float("mp_chattime", chattime + 2.0) // make sure mp_chattime is long new len = getNextMapName(string, 31) + 1 set_task(chattime, "delayedChange", 0, string, len) // change with 1.5 sec. delay } new g_warning[] = "WARNING: Couldn't find a valid map or the file doesn't exist (file ^"%s^")" stock bool:ValidMap(mapname[]) { if ( is_map_valid(mapname) ) { return true; } // If the is_map_valid check failed, check the end of the string new len = strlen(mapname) - 4; // The mapname was too short to possibly house the .bsp extension if (len < 0) { return false; } if ( equali(mapname[len], ".bsp") ) { // If the ending was .bsp, then cut it off. // the string is byref'ed, so this copies back to the loaded text. mapname[len] = '^0'; // recheck if ( is_map_valid(mapname) ) { return true; } } return false; } #if defined OBEY_MAPCYCLE readMapCycle(szFileName[], szNext[], iNext) { new b, i = 0, iMaps = 0 new szBuffer[32], szFirst[32] if (file_exists(szFileName)) { while (read_file(szFileName, i++, szBuffer, 31, b)) { if (!isalnum(szBuffer[0]) || !ValidMap(szBuffer)) continue if (!iMaps) copy(szFirst, 31, szBuffer) if (++iMaps > g_pos) { copy(szNext, iNext, szBuffer) g_pos = iMaps return } } } if (!iMaps) { log_amx(g_warning, szFileName) get_mapname(szFirst, 31) } copy(szNext, iNext, szFirst) g_pos = 1 } #else readMapCycle(szFileName[], szNext[], iNext) { new b, i = 0, iMaps = 0 new szBuffer[32], szFirst[32], szCurrent[32] get_mapname(szCurrent, 31) new a = g_pos if (file_exists(szFileName)) { while (read_file(szFileName, i++, szBuffer, 31, b)) { if (!isalnum(szBuffer[0]) || !ValidMap(szBuffer)) continue if (!iMaps) { iMaps = 1 copy(szFirst, 31, szBuffer) } if (iMaps == 1) { if (equali(szCurrent, szBuffer)) { if (a-- == 0) iMaps = 2 } } else { if (equali(szCurrent, szBuffer)) ++g_pos else g_pos = 0 copy(szNext, iNext, szBuffer) return } } } if (!iMaps) { log_amx(g_warning, szFileName) copy(szNext, iNext, szCurrent) } else copy(szNext, iNext, szFirst) g_pos = 0 } #endif

ej kqyre be edhe te kjo e bona complie e krejt ama pe qet aty ML_NOTFOUND:NEXTMAP de_dust2 ?? a munesh me ma bo ni plugin me ngjyra te timeleft ama qe o tamam ?

edhe

Code:
/* AMX Mod X * TimeLeft Plugin * * by the AMX Mod X Development Team * originally developed by OLO * * This file is part of AMX Mod X. * * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at * your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * In addition, as a special exception, the author gives permission to * link the code of this program with the Half-Life Game Engine ("HL * Engine") and Modified Game Libraries ("MODs") developed by Valve, * L.L.C ("Valve"). You must obey the GNU General Public License in all * respects for all of the code used other than the HL Engine and MODs * from Valve. If you modify this file, you may extend this exception * to your version of the file, but you are not obligated to do so. If * you do not wish to do so, delete this exception statement from your * version. */ #include <amxmodx> #include <colorchat> new g_TimeSet[32][2] new g_LastTime new g_CountDown new g_Switch public plugin_init() { register_plugin("TimeLeft", AMXX_VERSION_STR, "AMXX Dev Team") register_dictionary("timeleft.txt") register_cvar("amx_time_voice", "1") register_srvcmd("amx_time_display", "setDisplaying") register_cvar("amx_timeleft", "00:00", FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY) register_clcmd("say timeleft", "sayTimeLeft", 0, "- displays timeleft") register_clcmd("say thetime", "sayTheTime", 0, "- displays current time") set_task(0.8, "timeRemain", 8648458, "", 0, "b") } public sayTheTime(id) { if (get_cvar_num("amx_time_voice")) { new mhours[6], mmins[6], whours[32], wmins[32], wpm[6] get_time("%H", mhours, 5) get_time("%M", mmins, 5) new mins = str_to_num(mmins) new hrs = str_to_num(mhours) if (mins) num_to_word(mins, wmins, 31) else wmins[0] = 0 if (hrs < 12) wpm = "am " else { if (hrs > 12) hrs -= 12 wpm = "pm " } if (hrs) num_to_word(hrs, whours, 31) else whours = "twelve " client_cmd(id, "spk ^"fvox/time_is_now %s_period %s%s^"", whours, wmins, wpm) } new ctime[64] get_time("%m/%d/%Y - %H:%M:%S", ctime, 63) client_print_color(0, print_chat, "^4%L: ^3%s", LANG_PLAYER, "^4THE_TIME", ctime) return PLUGIN_CONTINUE } public sayTimeLeft(id) { if (get_cvar_float("mp_timelimit")) { new a = get_timeleft() if (get_cvar_num("amx_time_voice")) { new svoice[128] setTimeVoice(svoice, 127, 0, a) client_cmd(id, "%s", svoice) } client_print_color(0, print_chat, "^4%L: ^3%d:%02d", LANG_PLAYER, "^4TIME_LEFT", (a / 60), (a % 60)) } else client_print_color(0, print_chat, "^4%L", LANG_PLAYER, "^3NO_T_LIMIT") return PLUGIN_CONTINUE } setTimeText(text[], len, tmlf, id) { new secs = tmlf % 60 new mins = tmlf / 60 if (secs == 0) format(text, len, "%d %L", mins, id, (mins > 1) ? "MINUTES" : "MINUTE") else if (mins == 0) format(text, len, "%d %L", secs, id, (secs > 1) ? "SECONDS" : "SECOND") else format(text, len, "%d %L %d %L", mins, id, (mins > 1) ? "MINUTES" : "MINUTE", secs, id, (secs > 1) ? "SECONDS" : "SECOND") } setTimeVoice(text[], len, flags, tmlf) { new temp[7][32] new secs = tmlf % 60 new mins = tmlf / 60 for (new a = 0;a < 7;++a) temp[a][0] = 0 if (secs > 0) { num_to_word(secs, temp[4], 31) if (!(flags & 8)) temp[5] = "seconds " /* there is no "second" in default hl */ } if (mins > 59) { new hours = mins / 60 num_to_word(hours, temp[0], 31) if (!(flags & 8)) temp[1] = "hours " mins = mins % 60 } if (mins > 0) { num_to_word(mins, temp[2], 31) if (!(flags & 8)) temp[3] = "minutes " } if (!(flags & 4)) temp[6] = "remaining " return format(text, len, "spk ^"vox/%s%s%s%s%s%s%s^"", temp[0], temp[1], temp[2], temp[3], temp[4], temp[5], temp[6]) } findDispFormat(time) { for (new i = 0; g_TimeSet[i][0]; ++i) { if (g_TimeSet[i][1] & 16) { if (g_TimeSet[i][0] > time) { if (!g_Switch) { g_CountDown = g_Switch = time remove_task(8648458) set_task(1.0, "timeRemain", 34543, "", 0, "b") } return i } } else if (g_TimeSet[i][0] == time) { return i } } return -1 } public setDisplaying() { new arg[32], flags[32], num[32] new argc = read_argc() - 1 new i = 0 while (i < argc && i < 32) { read_argv(i + 1, arg, 31) parse(arg, flags, 31, num, 31) g_TimeSet[i][0] = str_to_num(num) g_TimeSet[i][1] = read_flags(flags) i++ } g_TimeSet[i][0] = 0 return PLUGIN_HANDLED } public timeRemain(param[]) { new gmtm = get_timeleft() new tmlf = g_Switch ? --g_CountDown : gmtm new stimel[12] format(stimel, 11, "%02d:%02d", gmtm / 60, gmtm % 60) set_cvar_string("amx_timeleft", stimel) if (g_Switch && gmtm > g_Switch) { remove_task(34543) g_Switch = 0 set_task(0.8, "timeRemain", 8648458, "", 0, "b") return } if (tmlf > 0 && g_LastTime != tmlf) { g_LastTime = tmlf new tm_set = findDispFormat(tmlf) if (tm_set != -1) { new flags = g_TimeSet[tm_set][1] new arg[128] if (flags & 1) { new players[32], pnum get_players(players, pnum, "c") for (new i = 0; i < pnum; i++) { setTimeText(arg, 127, tmlf, players[i]) if (flags & 16) set_hudmessage(255, 255, 255, -1.0, 0.85, 0, 0.0, 1.1, 0.1, 0.5, -1) else set_hudmessage(255, 255, 255, -1.0, 0.85, 0, 0.0, 3.0, 0.0, 0.5, -1) show_hudmessage(players[i], "%s", arg) } } if (flags & 2) { setTimeVoice(arg, 127, flags, tmlf) client_cmd(0, "%s", arg) } } } }



ej kqyre be edhe te kjo e bona complie e krejt ama pe qet aty ML_NOTFOUND:TIME_LEFT: (kohen pe tregon) ?? a munesh me ma bo ni plugin me ngjyra te timeleft ama qe o tamam ?
Reply }}}}
Thanks given by:
Thanks given by:
Thanks given by:


Messages In This Thread
Kërko Plugins [Me Ngjyra] - by ScrappeR - 10-06-2021, 08:43 AM
Re: Kërko Plugins [Me Ngjyra] - by F. ツ - 12-27-2023, 12:44 PM
Re: Kërko Plugins [Me Ngjyra] - by MentorNrekaj - 01-04-2024, 12:26 PM
Re: Kërko Plugins [Me Ngjyra] - by ScrappeR - 01-04-2024, 03:05 PM
Re: Kërko Plugins [Me Ngjyra] - by MentorNrekaj - 01-07-2024, 08:00 AM
Re: Kërko Plugins [Me Ngjyra] - by BR3ACKER - 01-07-2024, 11:12 AM
Re: Kërko Plugins [Me Ngjyra] - by ScrappeR - 01-07-2024, 04:24 PM
Re: Kërko Plugins [Me Ngjyra] - by goLd ~ - 01-08-2024, 07:22 PM
Re: Kërko Plugins [Me Ngjyra] - by goLd ~ - 01-08-2024, 07:24 PM
Re: Kërko Plugins [Me Ngjyra] - by LonN - 01-08-2024, 07:29 PM
Re: Kërko Plugins [Me Ngjyra] - by goLd ~ - 01-09-2024, 04:15 PM
:p - by goLd ~ - 01-09-2024, 04:50 PM
Re: :p - by BR3ACKER - 01-10-2024, 06:21 AM
Re: Kërko Plugins [Me Ngjyra] - by f0LLeRaUAG - 01-17-2024, 02:16 PM
Re: Kërko Plugins [Me Ngjyra] - by ScrappeR - 01-18-2024, 05:01 PM
Re: Kërko Plugins [Me Ngjyra] - by ScrappeR - 01-18-2024, 05:01 PM
Re: Kërko Plugins [Me Ngjyra] - by ..... - 02-05-2024, 01:04 PM
Re: Kërko Plugins [Me Ngjyra] - by Cyanide. - 02-05-2024, 01:59 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-13-2024, 08:55 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-13-2024, 08:55 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-13-2024, 09:14 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-13-2024, 09:14 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-14-2024, 02:42 PM
Re: Kërko Plugins [Me Ngjyra] - by Cyanide. - 02-14-2024, 03:23 PM
Re: Kërko Plugins [Me Ngjyra] - by Cyanide. - 02-14-2024, 03:23 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-14-2024, 04:45 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-14-2024, 04:45 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-14-2024, 04:46 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-14-2024, 04:46 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-14-2024, 05:08 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-14-2024, 05:08 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-14-2024, 07:28 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-14-2024, 07:28 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-14-2024, 07:32 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-14-2024, 07:32 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-14-2024, 07:33 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-14-2024, 07:33 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-14-2024, 07:36 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-14-2024, 07:36 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-14-2024, 07:47 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-14-2024, 07:47 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-15-2024, 07:14 AM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-15-2024, 07:14 AM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-15-2024, 07:45 AM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-15-2024, 07:45 AM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-15-2024, 12:48 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-15-2024, 12:48 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-15-2024, 01:49 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-15-2024, 01:49 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-15-2024, 06:13 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-15-2024, 06:13 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-16-2024, 08:00 AM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-16-2024, 08:00 AM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-16-2024, 11:44 AM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-16-2024, 11:44 AM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-16-2024, 02:28 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-16-2024, 02:28 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-16-2024, 02:36 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-16-2024, 02:36 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-16-2024, 03:03 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-16-2024, 03:03 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-17-2024, 11:21 AM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-17-2024, 11:21 AM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-17-2024, 01:23 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-17-2024, 01:23 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-17-2024, 02:46 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-17-2024, 02:46 PM
Re: Kërko Plugins [Me Ngjyra] - by Cyanide. - 02-17-2024, 04:30 PM
Re: Kërko Plugins [Me Ngjyra] - by Cyanide. - 02-17-2024, 04:30 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-17-2024, 10:59 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-17-2024, 10:59 PM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-18-2024, 06:45 AM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-18-2024, 06:45 AM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-18-2024, 05:28 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-18-2024, 05:28 PM
Re: Kërko Plugins [Me Ngjyra] - by veron - 02-19-2024, 11:44 AM
Re: Kërko Plugins [Me Ngjyra] - by iNFINITY^ - 02-19-2024, 11:54 AM
Re: Kërko Plugins [Me Ngjyra] - by Cyanide. - 04-16-2024, 09:54 AM
Re: Kërko Plugins [Me Ngjyra] - by inL. - 04-21-2024, 04:17 PM
Re: Kërko Plugins [Me Ngjyra] - by Alphaa - 04-21-2024, 06:51 PM
Re: Kërko Plugins [Me Ngjyra] - by inL. - 04-22-2024, 12:22 AM
Re: Kërko Plugins [Me Ngjyra] - by faton1233 - 04-22-2024, 08:20 PM
Re: Kërko Plugins [Me Ngjyra] - by dewiiL. - 04-24-2024, 07:58 PM
Re: Kërko Plugins [Me Ngjyra] - by Survival - 06-07-2024, 01:15 PM
Re: Kërko Plugins [Me Ngjyra] - by -M- - 06-07-2024, 02:59 PM
Re: Kërko Plugins [Me Ngjyra] - by x0n1x.# - 10-09-2024, 12:23 PM
Re: Kërko Plugins [Me Ngjyra] - by Dinnii - 10-09-2024, 12:39 PM
Re: Kërko Plugins [Me Ngjyra] - by Dinnii - 12-01-2024, 05:22 PM
Re: Kërko Plugins [Me Ngjyra] - by kushtrim1233 - 01-03-2025, 11:07 PM
Re: Kërko Plugins [Me Ngjyra] - by kushtrim1233 - 01-03-2025, 11:40 PM
Re: Kërko Plugins [Me Ngjyra] - by BR3ACKER - 01-07-2025, 07:07 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)