Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSGO Tarzi Otomatik Map&Team Değiştirme
#10
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>

#define PLUGIN "Auto Map Changer"
#define VERSION "1.0"
#define AUTHOR "akcaliberkk"

#define TASK_NOTIFICATION 1546

new round;
new 
vote[3];
new 
nextmap[32];
new 
menu
new szMap1[32],szMap2[32],szMap3[32];
new const 
mapcycle[] = "addons/amxmodx/configs/mapcycle_csgo.ini";

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    if(!
file_exists(mapcycle)) {
        new 
fopen(mapcycle,"wt")
        
fclose(f)
    }
    
    
register_event("HLTV","eNewRound","a","1=0","2=0")
    
register_event("TextMsg","eRestart","a","2=#Game_will_restart_in","2=#Game_Commencing")
}
public 
eNewRound() {
    
round++
    if(
round == 10) {
        
swap_teams()
    }
    else if(
round == 18) {
        
start_map_vote()
    }
    else if(
round == 20) {
        
change_map()
    }
    
}
public 
eRestart() {
    
round 0
}

// TEAM SWAP

public swap_teams() {
    new 
players[32],inum;
    
get_players(players,inum)
    for(new 
i;i<inum;i++) {
        switch(
i) {
            case 
0..6set_task(0.1,"delayed_team_change",players[i])
            case 
7..14set_task(0.2,"delayed_team_change",players)
            case 
15..22set_task(0.3,"delayed_team_change",players)
            case 
23..31set_task(0.4,"delayed_team_change",players)
        }
    }
    
set_task(1.0,"SendNotification")
}
public 
delayed_team_change(id) {
    switch(
cs_get_user_team(id)) {
        case 
CS_TEAM_Tcs_set_user_team(id,CS_TEAM_CT)
        case 
CS_TEAM_CT:  cs_set_user_team(id,CS_TEAM_T)
    }
    
ExecuteHamB(Ham_CS_RoundRespawn,id)
}
public 
SendNotification() {
    
ColorChat(0,"^4*** Takimlar Degistirildi !")
}
// VOTE

public start_map_vote() {
    
    new 
players[32],inum;
    
get_players(players,inum)
    
    new 
maxlines file_size(mapcycle,1)
    new 
randomNum1randomNum2randomNum3;
    new 
mapname[32];
    new 
szData[32],txtlen;
    new 
found = -1;
    
get_mapname(mapname,31)
    
    for(new 
lineline<maxlinesline++) {
        
szData[0] = 0
        read_file
(mapcycle,line,szData,31,txtlen)
        
        if(
equali(szData,mapname)) {
            
found line
        
}
        else if(!
szData[0]) {
            
maxlines--
        }
    }
    
    
randomNum1 = (found == -1) ? random_num(0,maxlines) : random_num2(0,maxlines,found)
    
randomNum2 = (found == -1) ? random_num2(0,maxlines,randomNum1) : random_num2(0,maxlines,found,randomNum1)
    
randomNum3 = (found == -1) ? random_num2(0,maxlines,randomNum2,randomNum1) : random_num2(0,maxlines,found,randomNum1,randomNum2)
    
    
read_file(mapcycle,randomNum1,szMap1,31,txtlen)
    
read_file(mapcycle,randomNum2,szMap2,31,txtlen)
    
read_file(mapcycle,randomNum3,szMap3,31,txtlen)
    
    
menu menu_create("\yMap Seciniz","vote_handle")
    
    
menu_additem(menu,szMap1,"")
    
menu_additem(menu,szMap2,"")
    
menu_additem(menu,szMap3,"")
    
menu_setprop(menu,MPROP_EXIT,MEXIT_NEVER)
    for(new 
i;i<inum;i++) {
        
menu_display(players,menu)
    }
    
ColorChat(0,"^4*** Sonraki Map Oylamasi Baslatildi !")
    
set_task(10.0,"vote_finish")
    return 
PLUGIN_HANDLED
}
public 
vote_handle(id,menu,item) {
    
    
vote[item]++
    
}
public 
vote_finish() {
    
menu_destroy(menu)
    if(
vote[0] >= vote[1] && vote[0] >= vote[2]) {
        
formatex(nextmap,31,szMap1)
    }
    else if(
vote[1] >= vote[0] && vote[1] >= vote[2]) {
        
formatex(nextmap,31,szMap2)
    }
    else if(
vote[2] >= vote[0] && vote[2] >= vote[1]) {
        
formatex(nextmap,31,szMap3)
    }
    
ColorChat(0,"^4*** Sonraki Map Oylamasi Bitti. Secilen Map: ^3%s",nextmap)
    return 
PLUGIN_HANDLED
}
stock random_num2_min_maxexception1exception2 = -1exception3 = -1) {
    new 
num random_num(_min,_max)
    while(
num == exception1 || num == exception2 || num == exception3) {
        
num random_num(_min,_max)
    }
    return 
num
}

// MAP CHANGE

public change_map() {
    new 
szMod[10]
    
get_modname(szMod9)
    
    if (!
equal(szMod"zp"))
    {
        
message_begin(MSG_ALLSVC_INTERMISSION)
        
message_end()
    }
    
    
set_task(2.0"mapChange")
    
ColorChat(0,"^4*** Map Degistiriliyor... Sonraki Map: ^3%s",nextmap)
}
public 
mapChange() {
    
server_cmd("changelevel %s",nextmap)
}

// STOCK

stock ColorChat(const id, const string[], {FloatSqlResul,_}:...) {
    new 
msg[191], players[32], count 1;
    
    static 
len;
    
len formatex(msgcharsmax(msg), "^x01" );
    
vformat(msg[len], charsmax(msg) - lenstring3);
    
    if(
id)players[0] = id;
    else 
get_players(players,count,"ch");
    
    for (new 
0counti++){
        
        if(
is_user_connected(players)){
            
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"),_players);
            
write_byte(players);
            
write_string(msg);
            
message_end();
        }
    }
    return;


configs klasörüne mapcycle_csgo.ini şeklinde bir dosya açın. İçine alt alta map isimlerini yazın.

Dikkat:

* 17. roundda dosyayı editlemeyin. Sadece ilk 16 round dosyayı düzenleyebilirsiniz.
* İki map ismi arasında boş bir satır olmasın.[/i][/i][/i][/i][/i][/i][/i][/i]


CS:GO ve CS 1.6 için ücretli eklenti yapılır.
Plugin yazmak isteyenlere yardımcı olabilirim.
Skype adresimden ulaşabilirsiniz:
destek_596
Steam: http://steamcommunity.com/id/ca-nemesis/

Reply


Messages In This Thread
Cevap: CSGO Tarzi Otomatik Map&amp;Team Değiştirme - by akcaliberkk - 18-08-13, 20:40

Possibly Related Threads…
Thread Author Replies Views Last Post
  Plugin İstek CFG Tarzı erenstrkl 6 3,778 03-08-16, 20:31
Last Post: murat1366
  Serverini Otomatik Olarak Favorilere Ekleme ottomanred 6 7,978 24-05-16, 15:15
Last Post: hola
  Nightvision yeşil ışığı değiştirme plugini ? sinan_604 4 8,571 16-06-15, 00:58
Last Post: kralik43
  Paraşüt Plugini Arıyorum fakat herkezde Otomatik olsun al_99 7 4,685 19-04-15, 20:07
Last Post: bireysel
  jbshop reklam degistirme. berkay6262 3 4,567 21-02-15, 00:06
Last Post: eneskaraca55
  Cs Acılınca Otomatik Servere Bağlanma mahmutt159 5 6,335 21-07-14, 04:04
Last Post: kaptan647
  oto t atma ve takim degiştirme engelleme LEGOFGRAND 6 11,974 24-05-14, 13:24
Last Post: LEGOFGRAND
  Otomatik respawn (Belirli modlarda) wienli 10 4,349 08-04-14, 14:47
Last Post: tifargemirhan
  Shop Pompa modeli Değiştirme murderteam 2 3,380 29-12-13, 21:29
Last Post: murderteam
  [Yardım-İstek-Destek] Model değiştirme AnqRfLow 10 8,963 07-12-13, 23:51
Last Post: JDM

Foruma Atla:


Users browsing this thread: