Junior Member
|
08-07-2019
, 10:04
Change Map
|
#1
|
Hello forum members! İf round 30, I want to change map.
I didin't do this part. How I can do it ?
PHP Code:
public pRemoveChoose(id) { static a,b,c,d,e a = pVote_This[1] b = pVote_This[2] c = pVote_This[3] d = pVote_This[4] e = pVote_This[5] if(a >= b && a >= c && a >= d && a >= e) { client_printc(id, "!n[ !t- !g%s !t- !n] !gThis Map Selected !t%s",TAG,pMap_Names[pMap_Check[0]][0]) return PLUGIN_HANDLED; } if(b >= a && b >= c && b >= d && b >= e) { client_printc(id, "!n[ !t- !g%s !t- !n] !gThis Map Selected !t%s",TAG,pMap_Names[pMap_Check[1]][0]) return PLUGIN_HANDLED; } if(c >= b && c >= a && c >= d && c >= e) { client_printc(id, "!n[ !t- !g%s !t- !n] !gThis Map Selected !t%s",TAG,pMap_Names[pMap_Check[2]][0]) return PLUGIN_HANDLED; } if(d >= b && d >= c && d >= a && d >= e) { client_printc(id, "!n[ !t- !g%s !t- !n] !gThis Map Selected !t%s",TAG,pMap_Names[pMap_Check[3]][0]) return PLUGIN_HANDLED; } if(e >= b && e >= c && e >= d && e >= a) { client_printc(id, "!n[ !t- !g%s !t- !n] !gThis Map Selected !t%s",TAG,pMap_Names[pMap_Check[4]][0]) return PLUGIN_HANDLED; } return PLUGIN_HANDLED; }
Plugin Full Version :
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx> #include <amxmisc> #include <engine>
#define PLUGIN "Plugin Name" #define VERSION "1.0" #define AUTHOR "Slient Army" #define MENUTAG "KIRAATHANE" #define MENUKISATAG "KG" #define TAG "KIRAATHANE"
new pMap_Check[5],pVote_This[6],pRound_Num
new pMap_Names[][] = { {"jail_buyukisyan_dark"}, {"jail_buyukisyan_v8"}, {"jail_oyunhavuzu"}, {"jail_kg_aquacity"}, {"jail_pixelcity"}, {"jail_arkasokaklar"}, {"jail_pixelcityv2"}, {"jail_buyukisyan_v4"}, {"jail_buyukisyan_v7"} }
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_logevent("pEnd", 2, "1=Round_End"); register_clcmd("gunekle","Plus") } public Plus() pRound_Num = 29 public pEnd() { pRound_Num++ if(pRound_Num == 30) { set_task(3.0,"pMapChooser") new players[32], inum; static Uid; get_players(players, inum, "a") for(new i; i < inum; i++) { Uid = players[i]; set_task(6.0,"pChooserMenu",Uid) set_task(36.0,"pRemoveChoose",Uid) } } } public pMapChooser() { new lNow; for(new i; i < 5; i++){ lNow = random_num(0,charsmax(pMap_Names)); while(pMapChoosen(lNow)){ lNow = random_num(0,charsmax(pMap_Names)); } pMap_Check[i] = lNow; } } public pMapChoosen(pChoosenMap){ for(new i; i < 5; i++){ if(pMap_Check[i] == pChoosenMap){ return true; } } return false; } public pChooserMenu(id){ static Item[128] formatex(Item, charsmax(Item),"\d| \w`\r%s \d| \d| \wMap \yOylama \wMenusu ",MENUTAG) new Menu = menu_create(Item, "pChooserMenu_") for(new i; i < 5; i++){ new lNTS[6]; num_to_str(i,lNTS,charsmax(lNTS)); formatex(Item, charsmax(Item),"\d| \w`\r%s \d| \d- \w%s",MENUKISATAG,pMap_Names[pMap_Check[i]][0]); menu_additem(Menu, Item,lNTS) } menu_setprop(Menu,MPROP_EXITNAME,"\wCikis") menu_display(id,Menu,0) } public pChooserMenu_(id, menu, item) { if( item == MENU_EXIT ) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], iName[64]; new access, callback; menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); new key = str_to_num(data); pVote_This[key]++ return PLUGIN_HANDLED } public pRemoveChoose(id) { static a,b,c,d,e a = pVote_This[1] b = pVote_This[2] c = pVote_This[3] d = pVote_This[4] e = pVote_This[5] if(a >= b && a >= c && a >= d && a >= e) { client_printc(id, "!n[ !t- !g%s !t- !n] !gThis Map Selected !t%s",TAG,pMap_Names[pMap_Check[0]][0]) return PLUGIN_HANDLED; } if(b >= a && b >= c && b >= d && b >= e) { client_printc(id, "!n[ !t- !g%s !t- !n] !gThis Map Selected !t%s",TAG,pMap_Names[pMap_Check[1]][0]) return PLUGIN_HANDLED; } if(c >= b && c >= a && c >= d && c >= e) { client_printc(id, "!n[ !t- !g%s !t- !n] !gThis Map Selected !t%s",TAG,pMap_Names[pMap_Check[2]][0]) return PLUGIN_HANDLED; } if(d >= b && d >= c && d >= a && d >= e) { client_printc(id, "!n[ !t- !g%s !t- !n] !gThis Map Selected !t%s",TAG,pMap_Names[pMap_Check[3]][0]) return PLUGIN_HANDLED; } if(e >= b && e >= c && e >= d && e >= a) { client_printc(id, "!n[ !t- !g%s !t- !n] !gThis Map Selected !t%s",TAG,pMap_Names[pMap_Check[4]][0]) return PLUGIN_HANDLED; } return PLUGIN_HANDLED; } stock client_printc(const id, const input[], any:...) { new count = 1, players[32]; static msg[191]; vformat(msg, 190, input, 3); replace_all(msg, 190, "!n", "^x01"); // Default Renk(Sarı) replace_all(msg, 190, "!g", "^x04"); // Yeşil Renk replace_all(msg, 190, "!t", "^x03"); // Takım Renk( CT mavi , T kırmızı ) if (id) players[0] = id; else get_players(players, count, "ch"); { for (new i = 0; i < count; i++){ if (is_user_connected(players[i])){ message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]); write_byte(players[i]); write_string(msg); message_end(); } } } }
Last edited by SlientArmy; 08-07-2019 at 10:32.
|
|