AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Change Map (https://forums.alliedmods.net/showthread.php?t=317977)

SlientArmy 08-07-2019 10:04

Change Map
 
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]
        
pVote_This[2]
        
pVote_This[3]
        
pVote_This[4]
        
pVote_This[5]
        if(
>= && >= && >= && >= 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(
>= && >= && >= && >= 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(
>= && >= && >= && >= 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(
>= && >= && >= && >= 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(
>= && >= && >= && >= 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(PLUGINVERSIONAUTHOR)
    
    
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(playersinum"a")
        for(new 
iinumi++) {
            
Uid players[i];
            
set_task(6.0,"pChooserMenu",Uid)
            
set_task(36.0,"pRemoveChoose",Uid)
        }
    }
}
public 
pMapChooser() {
    new 
lNow;
    for(new 
i5i++){
        
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 
i5i++){
        if(
pMap_Check[i] == pChoosenMap){
            return 
true;
        }
    }
    return 
false;
}
public 
pChooserMenu(id){    
    static 
Item[128]
    
    
formatex(Itemcharsmax(Item),"\d| \w`\r%s \d| \d| \wMap \yOylama \wMenusu ",MENUTAG)
    new 
Menu menu_create(Item"pChooserMenu_")
    
    for(new 
i5i++){
        new 
lNTS[6];
        
num_to_str(i,lNTS,charsmax(lNTS));
        
formatex(Itemcharsmax(Item),"\d| \w`\r%s \d| \d- \w%s",MENUKISATAG,pMap_Names[pMap_Check[i]][0]);
        
menu_additem(MenuItem,lNTS)
    }
    
    
menu_setprop(Menu,MPROP_EXITNAME,"\wCikis")
    
menu_display(id,Menu,0)
}
public 
pChooserMenu_(idmenuitem) {
    if( 
item == MENU_EXIT ) {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    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]
        
pVote_This[2]
        
pVote_This[3]
        
pVote_This[4]
        
pVote_This[5]
        if(
>= && >= && >= && >= 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(
>= && >= && >= && >= 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(
>= && >= && >= && >= 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(
>= && >= && >= && >= 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(
>= && >= && >= && >= 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 1players[32];
    static 
msg[191];
    
vformat(msg190input3);
    
    
replace_all(msg190"!n""^x01"); // Default Renk(Sarı)
    
replace_all(msg190"!g""^x04"); // Yeşil Renk
    
replace_all(msg190"!t""^x03"); // Takım Renk( CT mavi , T kırmızı )
    
    
if (idplayers[0] = id; else get_players(playerscount"ch");
    {
    for (new 
0counti++){
        if (
is_user_connected(players[i])){
            
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]);
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
        }
        
    }
}



CrazY. 08-07-2019 14:20

Re: Change Map
 
You don't need a plugin for that, just set the cvar mp_maxrounds to 30 at server.cfg or amxx.cfg.

SlientArmy 08-07-2019 15:41

Re: Change Map
 
@CrazyY İ know but İ want to do vote.

SlientArmy 08-08-2019 13:03

Re: Change Map
 
I solved :D

Fuck For Fun 08-08-2019 14:40

Re: Change Map
 
Quote:

server_cmd( "amx_map %s", pMap_Names[ pMap_Check[ id ] ] );
You can use it at the end of the code pRemoveChoose

Or you can create a newround and make it a change in newround


All times are GMT -4. The time now is 17:31.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.