Raised This Month: $ Target: $400
 0% 

Compile Mod errors


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sl1ps
Junior Member
Join Date: Sep 2005
Old 09-11-2005 , 16:01   Compile Mod errors
Reply With Quote #1

Hi, i'm trying to compile a pug mod .sma someone gave me, i'm guessing
it was originally made for amxmod, so i'm trying to compile with the amxmodx compiler.
But i'm getting a few errors, if anyone could help out it would be appreciated.
Cheers

First off, I get this error in the compiler (errors slightly shortened)


//// pugmod v1.5.0.sma
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(2) : fatal erro
r 100: cannot read from file: "VexdUM"
//
// Compilation aborted.
// 1 Error.
// Could not locate output file F:\serv\amxcompile\addons\amxmodx\scripting\c omp
iled\pugmod v1.5.0.amx (compile failed).
//
// Compilation Time: 0.12 sec
// ----------------------------------------

I was told to comment out
#include <VexdUM>

#define NEW_VEXDUM

Then I get this error...

//// pugmod v1.5.0.sma
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(316) : error 01
7: undefined symbol "get_offset_int"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(321) : error 01
7: undefined symbol "get_offset_int"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(397) : error 01
7: undefined symbol "get_offset_int"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(555) : error 01
7: undefined symbol "CS_ClearModel"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(635) : error 01
7: undefined symbol "get_offset_int"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1106) : error 0
17: undefined symbol "get_offset_int"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1142) : error 0
17: undefined symbol "get_offset_int"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1769) : error 0
17: undefined symbol "get_offset_int"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1777) : error 0
17: undefined symbol "get_offset_int"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1800) : error 0
17: undefined symbol "get_offset_int"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1801) : error 0
17: undefined symbol "set_offset_int"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1823) : error 0
17: undefined symbol "CS_SetModel"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1824) : error 0
17: undefined symbol "CS_SetModel"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1825) : error 0
17: undefined symbol "CS_SetModel"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1826) : error 0
17: undefined symbol "CS_SetModel"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1839) : error 0
17: undefined symbol "CS_SetModel"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1840) : error 0
17: undefined symbol "CS_SetModel"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1841) : error 0
17: undefined symbol "CS_SetModel"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1842) : error 0
17: undefined symbol "CS_SetModel"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1862) : error 0
17: undefined symbol "find_entity"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1863) : error 0
17: undefined symbol "find_entity"
// F:\serv\amxcompile\addons\amxmodx\scripting\p ugmod v1.5.0.sma(1954) : error 0
21: symbol already defined: "build_path"
//
// 22 Errors.

THEN I was told to try

#include <amxmod>
#include <engine>

// #define NEW_VEXDUM

OR

#include <amxmod>
#include <engine>

#define NEW_VEXDUM

and got the same error as above "undefined etc"

So, if anyone is able to help, please do - Cheers
sl1ps is offline
sl1ps
Junior Member
Join Date: Sep 2005
Old 09-11-2005 , 18:39  
Reply With Quote #2

.bump
sl1ps is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-11-2005 , 18:53  
Reply With Quote #3

Post the source here..
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
sl1ps
Junior Member
Join Date: Sep 2005
Old 09-11-2005 , 22:52   code
Reply With Quote #4

Wasn't sure if you wanted it pasted or if you wanted the file - So I did both


Code:
#include <amxmod> #include <engine> #define NEW_VEXDUM /* Changelog:     Version:    Changes by: Changes:     --------    ----------- --------     1.5.0       Fox-NL      Added .mute and .unmute     1.4.3       Fox-NL      Modified some things     1.4.2       Fox-NL      Added a introduce message     1.4.1       Fox-NL      Added .votestop + .message     1.4.0       Fox-NL      Added green colored text     1.3.1       Fox-NL      Optimized the plugin to run faster :-D     1.3.0       Fox-NL      Removed the pug_enabled cvar to make the pugmod run faster     1.2.5       Fox-NL      Added a kill restriction (when victim is already dead)     1.2.4       Fox-NL      Removed Pause command     1.2.3       Fox-NL      Fixed more bugs     1.2.2       Fox-NL      Added players checking     1.2.1       Fox-NL      Updated shield block     1.2.0       Fox-NL      Added a @admins command     1.1.3       Fox-NL      Added some teamforcing restrictions     1.1.2       Fox-NL      Added a scrollmsg     1.1.1       Fox-NL      Updated the Ra ndomTeams (without KRoTaL's help :-D)     1.1.0       Fox-NL      Fixed more bugs     1.0.7       Fox-NL      Updated the TeamTransfering! (now teamtransfering without kill)     1.0.6       Fox-NL      Removed useless things     1.0.5       Fox-NL      Fixed the .rcon bug     1.0.4       Fox-NL      Added some rcon restriction's (sv_password and rcon_password)     1.0.3       Fox-NL      Added servercmd: pug_status     1.0.2       Fox-NL      Made an extra check (teamcheck before starting pug)         1.0.1       Fox-NL      fixed admin     1.0.0       Fox-NL      started logging... */ new PLUGINNAME[] = "JoltPug" new VERSION[] = "1.5.0" new AUTHORS[] = "Fox-NL" #define PUG_ADMIN_1 (1<<12) // IMMUNITY #define PUG_ADMIN_2 (1<<13) // READYFORCING + PUG_ADMIN_1 #define PUG_ADMIN_3 (1<<14) // TEAMFORCING AND KILL + PUG_ADMIN_2 #define PUG_ADMIN_4 (1<<15) // KICK + PUG_ADMIN_3 #define PUG_ADMIN_5 (1<<16) // STOPPUG + PUG_ADMIN_4 #define PUG_ADMIN_6 (1<<17) // SERVERRESTART + RCON + PUG_ADMIN_5 #define MAX_MAPS 64 #define TEAM_OFFSET 114 new ready[32] new kickchoice[2] new typechoice[4] new teamchoice[2] new stopchoice[2] new pug_fase=0 new pug_start_fase=0 new pug_continue_fase=0 new roundcount=0 new swap_teams=0 new rtime_done=0 new maxplayers new ct_score=0 new t_score=0 new ct_oldscore=0 new t_oldscore=0 new task_stop=1 new task_start=2 new task_swap=3 new task_continue=4 new task_shuffle=5 new task_round=6 new task_round_two=7 new task_votekick=8 new task_typevote=9 new task_check=10 new task_mapvote=11 new task_teamvote=12 new task_stopvote=13 new task_msg=14 new code_pos[33] new code_entered[33][8] new code_file[]="addons/amx/pug_keypad.ini" new blankcode[]="xxxxx" new map_count = 0 new map_name[MAX_MAPS][32] new map_desc[MAX_MAPS][32] new map_menuposition[33] new map_votecount[MAX_MAPS] new kickcmd[16] new gmsgSayText new is_muted[32] /*===================================== NOTE: =====================================*/ /*=========================#################################=======================*/ /*=========================### ONLY EDIT BELOW THIS LINE ###=======================*/ /*=========================#################################=======================*/ /*=================================================================================*/ new server_full[]=  "[#joltpug] The server is full.  Please check in #joltpug for more available servers." new select_team[]=  "[#joltpug] Select a team" new no_spectating[]=    "[#joltpug] Spectating is not allowed in this server..." new team_already[]= "[#joltpug] You're already in that team..." new t_are_full[]=   "[#joltpug] The Terrorist team is full..." new ct_are_full[]=  "[#joltpug] The Counter-Terrorist team is full..." new better_t[]=     "[#joltpug] You must join the Terrorist team..." new better_ct[]=    "[#joltpug] You must join the Counter-Terrorist team..." new joined_t[]=     "[#joltpug] You have joined the Terrorist team..." new joined_ct[]=    "[#joltpug] You have joined the Counter-Terrorist team..." new shield_disabled[]=  "[#joltpug] The shield has been disabled" new has_kicked[]=   "[#joltpug] You have been kicked." new v_kick_msg[]=   "[#joltpug] Voting to kick you has been Succesfull" new t_win[]=        "^x04[#joltpug]^x01 T's have won with %d-%d!!!!!!!!!!! GG everyone!" new ct_win[]=       "^x04[#joltpug]^x01 CT's have won with %d-%d!!!!!!!!!!! GG everyone!" new t_over[]=       "^x04[#joltpug]^x01 T's are over the Ct's with %d-%d" new draw_score[]=   "^x04[#joltpug]^x01 CT's are tied with the T's (%d-%d)" new ct_over[]=      "^x04[#joltpug]^x01 CT's are over the T's with %d-%d" new check_gametype[]=   "^x04[#joltpug]^x01 Gametype is %dvs%d" new not_live[]=     "^x04[#joltpug]^x01 Pug is not LIVE yet." new check_round[]=  "^x04[#joltpug]^x01 Round %d is running now" new keypad_off[]=   "^x04[#joltpug]^x01 Keypad has been disabled" new digit_code[]=   "^x04[#joltpug]^x01 Please enter your 5 digit code" new no_statuschange[]=  "^x04[#joltpug]^x01 You can't change your status now!" new now_ready[]=    "^x04[#joltpug]^x01 %s is READY" new now_notready[]= "^x04[#joltpug]^x01 %s is NOT READY" new already_ready[]=    "^x04[#joltpug]^x01 You're already READY" new already_notready[]= "^x04[#joltpug]^x01 You're already NOT READY" new switching_teams[]=  "^x04[#joltpug]^x01 Switching teams!..." new no_access[]=    "^x04[#joltpug]^x01 You have no access to that command" new cant_status[]=  "^x04[#joltpug]^x01 You can't change someone's status right now" new everyone_ready[]=   "^x04[#joltpug]^x01 %s has forced everyone to be READY" new everyone_notready[]="^x04[#joltpug]^x01 %s has forced everyone to be NOT READY" new force_ready[]=  "^x04[#joltpug]^x01 %s forced %s to be READY" new force_notready[]=   "^x04[#joltpug]^x01 %s forced %s to be NOT READY" new no_force_ready[]=   "^x04[#joltpug]^x01 %s is already READY" new no_force_notready[]="^x04[#joltpug]^x01 %s is already NOT READY" new player_kicked[]=    "^x04[#joltpug]^x01 %s kicked %s" new player_kick_r[]=    "^x04[#joltpug]^x01 %s kicked %s (reason: ^"%s^")" new force_t[]=      "^x04[#joltpug]^x01 %s forced %s to the Terrorist team" new force_ct[]=     "^x04[#joltpug]^x01 %s forced %s to the Counter-terrorist team" new already_t[]=    "^x04[#joltpug]^x01 %s is already at the Terrorist team" new already_ct[]=   "^x04[#joltpug]^x01 %s is already at the Counter-terrorist team" new vote_already[]= "^x04[#joltpug]^x01 A vote has already been cast" new wait_awhile[]=  "^x04[#joltpug]^x01 Please wait awhile before you can vote again" new v_kick_started[]=   "^x04[#joltpug]^x01 Voting to kick %s has started" new v_gt_started[]= "^x04[#joltpug]^x01 Voting for gametype has started" new v_team_started[]=   "^x04[#joltpug]^x01 Voting for teams has started" new v_stop_started[]=   "^x04[#joltpug]^x01 Voting for stopping the pug has started" new cant_use_cmd[]= "^x04[#joltpug]^x01 you cant use that command right now" new has_stopped_pug[]=  "^x04[#joltpug]^x01 %s has stopped the pug..." new access_gained[]=    "^x04[#joltpug]^x01 You have been given access: %s" new invalid_code[]= "^x04[#joltpug]^x01 Invalid code" new cant_find_code[]=   "^x04[#joltpug]^x01 File %s with codes not found!" new v_kick_succes[]=    "^x04[#joltpug]^x01 Votes for kicking %s succeded (yes ^"%d^") (needed ^"%d^")" new v_kick_fail[]=  "^x04[#joltpug]^x01 Vote for kicking %s failed (yes ^"%d^") (needed ^"%d^")" new v_stop_succes[]=    "^x04[#joltpug]^x01 Vote for stopping the pug succeded (yes ^"%d^") (no ^"%d^")" new v_stop_failed[]=    "^x04[#joltpug]^x01 Vote for stopping the pug failed (yes ^"%d^") (no ^"%d^")" new v_normal_succes[]=  "^x04[#joltpug]^x01 Vote for leaving normal succeded (%d votes)" new v_random_succes[]=  "^x04[#joltpug]^x01 Vote for random teams succeded (%d votes)" new server_kicked[]=    "^x04[#joltpug]^x01 Kicked %s" new lo3_msg[]=      "^x04[#joltpug]^x01 Live on 3 restarts!!!" new lonr_msg[]=     "^x04[#joltpug]^x01 Live on next restart!!!" new now_live[]=     "^x04[#joltpug]^x01 Pug is now Live!!!" new gl_and_hf[]=    "^x04[#joltpug]^x01 Goodluck and Have Fun" new co3r_msg[]=     "^x04[#joltpug]^x01 Pug continue on 3 restarts!!!" new conr_msg[]=     "^x04[#joltpug]^x01 Pug continue on next restart!!!" new cont_pug[]=     "^x04[#joltpug]^x01 Continueing Pug!!!" new trans_t[]=      "^x04[#joltpug]^x01 You have been transfered to the Terrorist team" new trans_ct[]=     "^x04[#joltpug]^x01 You have been transfered to the Counter-terrorist team" new tied_win[]=     "^x04[#joltpug]^x01 The game was tied! (15-15) GG everyone!" new has_admin[]=    "^x04[#joltpug]^x01 %s has admin level %d! so be nice." new has_cmpl_admin[]=   "^x04[#joltpug]^x01 %s has complete admin! so be nice!!!" new has_no_admin[]= "^x04[#joltpug]^x01 %s is no admin!" new more_clients[]= "^x04[#joltpug]^x01 There are more players matching to your argument" new cl_notfound[]=  "^x04[#joltpug]^x01 Player with that name or userid not found" new has_imm[]=      "^x04[#joltpug]^x01 Player ^"%s^" has immunity" new cant_p_on_dead[]=   "^x04[#joltpug]^x01 That action can't be performed on dead player ^"%s^"" new cant_p_on_bot[]=    "^x04[#joltpug]^x01 That action can't be performed on bot ^"%s^"" new pl_killed[]=    "^x04[#joltpug]^x01 %s slayed %s" new pl_muted[]=     "^x04[#joltpug]^x01 %s muted %s" new pl_unmuted[]=   "^x04[#joltpug]^x01 %s muted %s" new not_muted[]=    "^x04[#joltpug]^x01 %s is not muted!" new already_dead[]= "^x04[#joltpug]^x01 %s is already dead!" new already_muted[]=    "^x04[#joltpug]^x01 %s is already muted!" new mapvote_succes[]=   "^x04[#joltpug]^x01 Voting for %s is a succes!" new votemap_started[]=  "^x04[#joltpug]^x01 Voting for map has been started" new votemap_failed[]=   "^x04[#joltpug]^x01 Voting done, staying on %s" new type_toomany[]= "^x04[#joltpug]^x01 Vote for %dvs%d succeded but there are too many players (%d votes)" new type_succes[]=  "^x04[#joltpug]^x01 Vote for %dvs%d succeded (%d votes)" new restart_server[]=   "^x04[#joltpug]^x01 %s is restarting the server" new no_rcon_access[]=   "^x04[#joltpug]^x01 You don't have access to that rcon command" new rcon_usage[]=   "^x04[#joltpug]^x01 usage: say .rcon <command>" new votekick_usage[]=   "^x04[#joltpug]^x01 usage: say .votekick <victim>" new force_usage[]=  "^x04[#joltpug]^x01 usage: say %s <victim>" new kick_usage[]=   "^x04[#joltpug]^x01 usage: say .kick <victim> [reason]" new kill_usage[]=   "^x04[#joltpug]^x01 usage: say .kill <victim>" new checka_usage[]= "^x04[#joltpug]^x01 usage: say .checkadmin <victim>" new admins_usage[]= "^x04[#joltpug]^x01 usage: say .@admins <message>" new msg_usage[]=    "^x04[#joltpug]^x01 usage: say .message <message>" new mute_usage[]=   "^x04[#joltpug]^x01 usage: say .mute <victim>" new unmute_usage[]= "^x04[#joltpug]^x01 usage: say .unmute <victim>" /*===================================== NOTE: =====================================*/ /*=========================#################################=======================*/ /*=========================### ONLY EDIT ABOVE THIS LINE ###=======================*/ /*=========================#################################=======================*/ /*=================================================================================*/ public plugin_init() {     register_plugin(PLUGINNAME,VERSION,AUTHORS)     register_cvar("pug_vote_time","10")     register_cvar("pug_vote_answers","1")     register_cvar("pug_vote_delay","30")     register_cvar("pug_votekick_ratio","0.70")     register_cvar("pug_last_voting","0")     register_cvar("pug_noshield","1")     register_cvar("pug_keypad","1")     register_cvar("pug_gametype","5")     register_cvar("pug_mapchange","0")     register_cvar("pug_helpfile","http://www.joltservers.com/pugmod.htm")     set_cvar_float("pug_last_voting",0.0)     register_clcmd("say","check_say")     register_clcmd("say_team","check_say")     register_clcmd("shield","block_shield")     register_srvcmd("pug_status","pug_status")     format(kickcmd, 15, "pugres%c%c%c%c",random_num('A','Z'),random_num('A','Z'),random_num('A','Z'),random_num('A','Z'))     register_clcmd(kickcmd,"kicksignal")     register_menucmd(register_menuid("Kick"),(1<<0)|(1<<1),"count_kickvotes")     register_menucmd(register_menuid("Team"),(1<<0)|(1<<1),"count_teamvotes")     register_menucmd(register_menuid("Gametype"),(1<<0)|(1<<1)|(1<<2)|(1<<3),"count_typevotes")     register_menucmd(register_menuid("Stoppug"),(1<<0)|(1<<1),"count_stopvotes")     register_menucmd(register_menuid("\yChoose a map:"),1023,"count_mapvotes")     register_menucmd(register_menuid("Enter code"),1023,"enter_code")     register_menucmd(register_menuid("Reset or Exit"),3,"reset_close")     register_menucmd(register_menuid("Team_Select",1),(1<<0)|(1<<1)|(1<<4),"team_select")     register_menucmd(register_menuid("BuyItem", 1 ),511,"blockmenu")     register_menucmd(-34,511,"blockmenu")     register_clcmd("jointeam","join_team")     register_event("RoundTime","event_roundtime","bc")     register_event("SendAudio","event_sendaudio","a","2=%!MRAD_terwin","2=%!MRAD_ctwin")     register_event("ResetHUD","event_resethud","b")     set_task(1.0,"pug_task",0,"",0,"b")     maxplayers = get_maxplayers()     new filename[64]     build_path(filename,63,"$basedir/config/maps.ini")     load_settings(filename)     gmsgSayText = get_user_msgid("SayText") } public plugin_precache() {     precache_model("models/player/terror/terror.mdl")     precache_model("models/player/leet/leet.mdl")     precache_model("models/player/arctic/arctic.mdl")     precache_model("models/player/guerilla/guerilla.mdl")     precache_model("models/player/urban/urban.mdl")     precache_model("models/player/gsg9/gsg9.mdl")     precache_model("models/player/sas/sas.mdl")     precache_model("models/player/gign/gign.mdl") } public showsay(id,msg[]) {     if(id==0) {         for(new i=0; i<=maxplayers; i++) {             if(is_user_connected(i)) {                 message_begin(1, gmsgSayText, {0,0,0}, i)                 write_byte(i)                 write_string(msg)                 message_end()             }         }     } else {         message_begin(1, gmsgSayText, {0,0,0}, id)         write_byte(id)         write_string(msg)         message_end()     } } public kicksignal(id) server_cmd("kick #%d ^"%s^"",get_user_userid(id),server_full) load_settings(filename[]) {     if (!file_exists(filename)) return 0     new text[256], szDesc[48]     new a , pos = 0     while(map_count < MAX_MAPS && read_file(filename,pos++,text,255,a))     {         if(text[0]==';') continue         if(parse(text,map_name[map_count],31,szDesc,47) < 2 ) continue         if(!is_map_valid(map_name[map_count])) continue         if(strlen(szDesc) > 31 )         {             copy(map_desc[map_count],28, szDesc )             map_desc[map_count][28] = map_desc[map_count][29] = map_desc[map_count][30] = '.'             map_desc[map_count][31] = 0         }         else copy(map_desc[map_count],31, szDesc )         map_count++     }     return 1 } public pug_task() {     if(pug_fase!=0&&swap_teams==0) return PLUGIN_HANDLED     set_hudmessage(255, 255, 0, 1.0, 0.07, 0, 0.0, 1.0, 0.1, 0.1, 1)     show_hudmessage(0,"Not-Ready:  ")     set_hudmessage(255, 255, 0, 1.0, 0.50, 0, 0.0, 1.0, 0.1, 0.1, 2)     show_hudmessage(0,"Ready:  ")     new r_ct_counter[2], r_t_counter[2], r_msg[1024], r_entry[256], r_len, nr_msg[1024], nr_entry[256], nr_len, team, name[32]     for(new r_id = 1 ; r_id <= maxplayers; ++r_id) {         team = get_user_team(r_id)         if(team==1||team==2) {             get_user_name(r_id, name, 31)             if(ready[r_id]==1) {                 format(r_entry, 255, "%s  ^n", name)                 r_len += copy(r_msg[r_len], 1023 - r_len, r_entry)                 if(get_offset_int(r_id,TEAM_OFFSET)==1) ++r_t_counter[0]                 else ++r_ct_counter[0]             } else {                 format(nr_entry, 255, "%s  ^n", name)                 nr_len += copy(nr_msg[nr_len], 1023 - nr_len, nr_entry)                 if(get_offset_int(r_id,TEAM_OFFSET)==1) ++r_t_counter[1]                 else ++r_ct_counter[1]             }         }     }     set_hudmessage(255, 255, 255, 1.0, 0.53, 0, 0.0, 1.0, 0.1, 0.1, 3)     show_hudmessage(0,r_msg,1023)     set_hudmessage(255, 255, 255, 1.0, 0.10, 0, 0.0, 1.0, 0.1, 0.1, 4)     show_hudmessage(0,nr_msg,1023)     if((r_ct_counter[1]+r_t_counter[1])==0) {         new pg_cvar = get_cvar_num("pug_gametype")         if(r_ct_counter[0]==pg_cvar && r_t_counter[0]==pg_cvar) {             if(swap_teams==1) {                 if(pug_continue_fase!=0) return PLUGIN_HANDLED                 pug_continue_fase=1                 set_task(0.1,"continue_pug",task_continue)                 return PLUGIN_HANDLED             }             if(swap_teams==2) {                 return PLUGIN_HANDLED             }             if(task_exists(task_votekick)) remove_task(task_votekick)             if(task_exists(task_typevote)) remove_task(task_typevote)             roundcount=0             ct_score=0             t_score=0             t_oldscore=0             ct_oldscore=0             swap_teams=0             pug_fase=1             pug_start_fase=1             if(get_cvar_num("pug_mapchange")==1) {                 set_task(0.1,"vote_teams")                 set_cvar_num("pug_mapchange",0)             }             else set_task(0.1,"vote_map")             return PLUGIN_HANDLED         }     }       return PLUGIN_HANDLED } public client_connect(id) return check_connect(id) public client_authorized(id) return check_connect(id) public client_putinserver(id) return check_connect(id) public check_connect(id) {     if(is_user_hltv(id)) return PLUGIN_CONTINUE     new pugplayers = 0     for(new checkid = 1 ; checkid <= maxplayers; ++checkid) {         if(get_user_team(checkid)==1||get_user_team(checkid)==2) {             ++pugplayers         }     }     if(pugplayers >= (get_cvar_num("pug_gametype")*2)) {         client_cmd(id,"echo %s;%s",server_full,kickcmd)         return PLUGIN_HANDLED     }     ready[id]=0     is_muted[id]=0     return PLUGIN_CONTINUE } public join_team(id) {     new arg[2]     read_argv(1,arg,1)     return check_team(id,strtonum(arg)) } public team_select(id,key) return check_team(id,key+1) public check_team(id,newteam) {     new t_count=0, ct_count=0     for(new k=1; k<=maxplayers; ++k) {         if(k != id) {             if(get_user_team(k)==1||get_user_team(k)==2) {                 if(get_offset_int(k,TEAM_OFFSET)==1) ++t_count                 else ++ct_count             }         }     }     if((t_count+ct_count) >= (get_cvar_num("pug_gametype") *2)) {         client_print(id,print_center,server_full)         client_print(id,print_console,server_full)         engclient_cmd(id,"chooseteam")         client_cmd(id,"echo %s;%s",server_full,kickcmd)         return PLUGIN_HANDLED     }     if(newteam==5) {         client_print(id,print_center,select_team)         client_print(id,print_console,select_team)         engclient_cmd(id,"chooseteam")         return PLUGIN_HANDLED     }     if(newteam==6) {         if(checkadmin(id,1)) return PLUGIN_CONTINUE         client_print(id,print_center,no_spectating)         client_print(id,print_console,no_spectating)         engclient_cmd(id,"chooseteam")         return PLUGIN_HANDLED     }     if(get_user_team(id)==newteam){         client_print(id,print_center,team_already)         client_print(id,print_console,team_already)         return PLUGIN_HANDLED     }     if(newteam==1) {         if(t_count >= get_cvar_num("pug_gametype")) {             client_print(id,print_center,t_are_full)             client_print(id,print_console,t_are_full)             engclient_cmd(id,"chooseteam")             return PLUGIN_HANDLED         }         if(t_count > ct_count) {             client_print(id,print_center,better_ct)             client_print(id,print_console,better_ct)             engclient_cmd(id,"chooseteam")             return PLUGIN_HANDLED         }         client_print(id,print_center,joined_t)         client_print(id,print_console,joined_t)         new data[1]         data[0]=id         set_task(5.0,"introduce",task_msg+id,data,1)         return PLUGIN_CONTINUE     } else if(newteam==2) {         if(ct_count >= get_cvar_num("pug_gametype")) {             client_print(id,print_center,ct_are_full)             client_print(id,print_console,ct_are_full)             engclient_cmd(id,"chooseteam")             return PLUGIN_HANDLED         }         if(ct_count > t_count) {             client_print(id,print_center,better_t)             client_print(id,print_console,better_t)             engclient_cmd(id,"chooseteam")             return PLUGIN_HANDLED         }         client_print(id,print_center,joined_ct)         client_print(id,print_console,joined_ct)         new data[1]         data[0]=id         set_task(5.0,"introduce",task_msg+id,data,1)         return PLUGIN_CONTINUE     }     new data[1]     data[0]=id     set_task(5.0,"introduce",task_msg+id,data,1)     return PLUGIN_CONTINUE } public introduce(data[]) {     new id=data[0], msg[300]     format(msg,299,"^x04[#joltpug]^x01 This server is running JoltPug v%s by Fox-NL",VERSION)     showsay(id,msg)     if(pug_fase==0) {         showsay(id,"^x04[#joltpug]^x01 Type .ready to ready up and .notready to unready")         showsay(id,"^x04[#joltpug]^x01 For more commands please type .help")     } else {         showsay(id,"^x04[#joltpug]^x01 For information on some commands please type .help")     }     return PLUGIN_CONTINUE } public pug_status() {     server_print("--- Showing Status For %s ---",PLUGINNAME)     server_print("version: %s",VERSION)     server_print("")     server_print("pugfase: %d",pug_fase)     server_print("swapfase: %d",swap_teams)     server_print("roundcount: %d",roundcount)     server_print("ct score: %d",ct_score)     server_print("t score: %d",t_score)     server_print("pug start fase: %d",pug_start_fase)     server_print("pug continue fase: %d",pug_continue_fase) } public event_roundtime() {     new rtime = read_data(1)     if(get_cvar_num("mp_freezetime")==rtime && rtime_done==0)       {         set_task(0.3, "round_start", task_round)         set_task(2.0, "rtimedone", task_round_two)         rtime_done=1     } } public rtimedone()     rtime_done=0 public event_sendaudio() {     if(pug_fase==2 && swap_teams==0) {         new msg[32]         read_data(2,msg,32)         if(containi(msg,"ct") != -1) {             ct_score++         }         else if(containi(msg,"ter") != -1) {             t_score++         }         if(roundcount==15) {             showsay(0,switching_teams)             //client_print(0,print_chat,switching_teams)             t_oldscore = t_score             ct_oldscore = ct_score             swap_teams = 0             set_task(2.0, "team_switch",task_swap)         }     }     new pugplayers     for(new checkid = 1 ; checkid <= maxplayers; ++checkid) {         if((get_user_team(checkid)==1||get_user_team(checkid)==2)&&!is_user_hltv(checkid)) {             ++pugplayers             if(pugplayers > (get_cvar_num("pug_gametype")*2)) {                 new shortest= 999999999, who = 0, mytime                 for(new i= 1; i<= maxplayers; ++i) {                     if((get_user_team(i)==1||get_user_team(i)==2)&&!is_user_hltv(i)) {                         mytime = get_user_time(i)                               if(shortest > mytime)   {                             shortest = mytime                             who = i                         }                     }                 }                 if(who != 0) client_cmd(who,"echo %s;%s",server_full,kickcmd)             }         }     }     return PLUGIN_CONTINUE } #if defined NEW_VEXDUM public event_resethud(id) set_user_model(id) #else public event_resethud(id) CS_ClearModel(id) #endif public block_shield(id) {     if(get_cvar_num("pug_noshield")==1) {         client_print(id,print_center,shield_disabled)         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE } public blockmenu(id,key) {     if(key==7 && get_cvar_num("pug_noshield")==1) {         client_print(id,print_center,shield_disabled)         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE } public round_start() {     if(swap_teams!=0) return PLUGIN_HANDLED     if(pug_fase!=2) return PLUGIN_HANDLED     ++roundcount     if(roundcount==1) return PLUGIN_HANDLED     if(ct_score==16) {         //client_print(0,print_center,ct_win,ct_score,t_score)         //client_print(0,print_chat,ct_win,ct_score,t_score)         new msg1[300]         format(msg1,299,ct_win,ct_score,t_score)         showsay(0,msg1)         set_task(0.1,"stop_pug",task_stop)         return PLUGIN_HANDLED     }     if(t_score==16) {         //client_print(0,print_center,t_win,t_score,ct_score)         //client_print(0,print_chat,t_win,t_score,ct_score)         new msg2[300]         format(msg2,299,t_win,t_score,ct_score)         showsay(0,msg2)         set_task(0.1,"stop_pug",task_stop)         return PLUGIN_HANDLED     }     if((t_score==15)&&(ct_score==15)) {         //client_print(0,print_center,tied_win)         //client_print(0,print_chat,tied_win)         showsay(0,tied_win)         set_task(0.1,"stop_pug",task_stop)         return PLUGIN_HANDLED     }           else if(ct_score > t_score) {         new msg3[300]         format(msg3,299,ct_over,ct_score,t_score)         showsay(0,msg3)         //client_print(0,print_chat,ct_over,ct_score,t_score)         return PLUGIN_HANDLED     }     else if(ct_score==t_score) {         new msg4[300]         format(msg4,299,draw_score,ct_score,t_score)         showsay(0,msg4)         //client_print(0,print_chat,draw_score,ct_score,t_score)         return PLUGIN_HANDLED     }     else if(t_score > ct_score) {         new msg5[300]         format(msg5,299,t_over,t_score,ct_score)         showsay(0,msg5)         //client_print(0,print_chat,t_over,t_score,ct_score)         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } public team_switch() {     new limitt = get_cvar_num("mp_limitteams")     set_cvar_num("mp_limitteams",0)     swap_teams=2     for(new id = 1 ; id <= maxplayers; ++id) {         if(get_user_team(id)==1||get_user_team(id)==2) {             ready[id]=0             if(get_offset_int(id,TEAM_OFFSET)==1) set_user_team(id,2)             else set_user_team(id,1)         }     }     set_cvar_num("mp_limitteams",limitt)     swap_teams=1     server_cmd("exec server.cfg")     t_score=ct_oldscore     ct_score=t_oldscore     pug_continue_fase=0     server_cmd("sv_restartround 1") } public stop_pug() {     for(new i = 1; i <=maxplayers; i++) {         ready[i]=0     }     set_cvar_num("pug_gametype",5)     set_cvar_num("pug_mapchange",0)     pug_fase=0     pug_start_fase=0     pug_continue_fase=0     roundcount=0     swap_teams=0     rtime_done=0     ct_score=0     t_score=0     ct_oldscore=0     t_oldscore=0     server_cmd("exec server.cfg")     if(task_exists(task_stop)) remove_task(task_stop)     if(task_exists(task_start)) remove_task(task_start)     if(task_exists(task_swap)) remove_task(task_swap)     if(task_exists(task_continue)) remove_task(task_continue)     if(task_exists(task_shuffle)) remove_task(task_shuffle)     if(task_exists(task_round)) remove_task(task_round)     if(task_exists(task_round_two)) remove_task(task_round_two)     if(task_exists(task_check)) remove_task(task_check)     if(task_exists(task_votekick)) remove_task(task_votekick)     if(task_exists(task_typevote)) remove_task(task_typevote)     if(task_exists(task_teamvote)) remove_task(task_teamvote)     if(task_exists(task_mapvote)) remove_task(task_mapvote)     return PLUGIN_HANDLED } public check_say(id) {     new arg[192], ms[300]     read_args(arg,191)     remove_quotes(arg)     new player_name[32]     get_user_name(id, player_name, 31)     if(equali(arg,".help")) {         new temp[256]         get_cvar_string("pug_helpfile",temp,255)         show_motd(id,temp,"JoltPug Help File")         return PLUGIN_CONTINUE     }     if(equali(arg,".checkplayers")) {         //client_print(0,print_chat,check_gametype,get_cvar_num("pug_gametype"),get_cvar_num("pug_gametype"))         format(ms,299,check_gametype,get_cvar_num("pug_gametype"),get_cvar_num("pug_gametype"))         showsay(0,ms)         return PLUGIN_CONTINUE     }     if(equali(arg,".checkround")) {         if(pug_fase !=2) {             //client_print(id,print_chat,not_live)             showsay(id,ms)             return PLUGIN_HANDLED         }         //client_print(0,print_chat,check_round,roundcount)         format(ms,299,check_round,roundcount)         showsay(0,ms)         return PLUGIN_CONTINUE     }     if(equali(arg,".checkadmin")) {         //client_print(id,print_chat,checka_usage)         showsay(id,checka_usage)         return PLUGIN_HANDLED     }     if(containi(arg,".checkadmin ")==0) {         new arg2[32]         new victim_arg[32]         parse(arg,arg2,31,victim_arg,31)         new victim_id = search_target(id, victim_arg, 2)         if(!victim_id) return PLUGIN_HANDLED         new victim_name[32]         get_user_name(victim_id, victim_name, 31)         new admin_flags = get_user_flags(victim_id)         if(admin_flags & PUG_ADMIN_6) {             format(ms,299,has_cmpl_admin,victim_name)             showsay(0,ms)                 //client_print(0,print_chat,has_cmpl_admin,victim_name)             return PLUGIN_CONTINUE         }         if(admin_flags & PUG_ADMIN_5) {             format(ms,299,has_admin,victim_name,5)             showsay(0,ms)                 //client_print(0,print_chat,has_admin,victim_name,5)             return PLUGIN_CONTINUE         }         if(admin_flags & PUG_ADMIN_4) {             format(ms,299,has_admin,victim_name,4)             showsay(0,ms)                 //client_print(0,print_chat,has_admin,victim_name,4)             return PLUGIN_CONTINUE         }         if(admin_flags & PUG_ADMIN_3) {             format(ms,299,has_admin,victim_name,3)             showsay(0,ms)                 //client_print(0,print_chat,has_admin,victim_name,3)             return PLUGIN_CONTINUE         }         if(admin_flags & PUG_ADMIN_2) {             format(ms,299,has_admin,victim_name,2)             showsay(0,ms)                 //client_print(0,print_chat,has_admin,victim_name,2)             return PLUGIN_CONTINUE         }         if(admin_flags & PUG_ADMIN_1) {             format(ms,299,has_admin,victim_name,1)             showsay(0,ms)                 //client_print(0,print_chat,has_admin,victim_name,1)             return PLUGIN_CONTINUE         }         format(ms,299,has_no_admin,victim_name)         showsay(0,ms)         //client_print(0,print_chat,has_no_admin, victim_name)         return PLUGIN_CONTINUE     }     if(equali(arg,".checkscore")) {         if(pug_fase !=2) {             showsay(id,not_live)             //client_print(id,print_chat,not_live)             return PLUGIN_HANDLED         }         if(ct_score > t_score) {             format(ms,299,ct_over,ct_score,t_score)             showsay(0,ms)             //client_print(0,print_chat,ct_over,ct_score,t_score)             return PLUGIN_CONTINUE         }         if(ct_score==t_score) {             format(ms,299,draw_score,ct_score,t_score)             showsay(0,ms)             //client_print(0,print_chat,draw_score,ct_score,t_score)             return PLUGIN_CONTINUE         }         if(t_score > ct_score) {             format(ms,299,t_over,t_score,ct_score)             showsay(0,ms)             //client_print(0,print_chat,t_over,t_score,ct_score)             return PLUGIN_CONTINUE         }     }     if(equali(arg,".keypad")) {         if(get_cvar_num("pug_keypad")==0) {             showsay(id,keypad_off)             //client_print(id,print_chat,keypad_off)             return PLUGIN_HANDLED         }         code_pos[id] = 0         code_entered[id][0] = 0           d_keypad(id)         showsay(id,digit_code)         //client_print(id,print_chat,digit_code)         return PLUGIN_HANDLED     }     if(equali(arg,".ready")) {         if((pug_fase==1||pug_fase==2) && swap_teams==0) {             showsay(id,no_statuschange)             //client_print(id, print_chat,no_statuschange)             return PLUGIN_HANDLED         }         if(ready[id]==0) {             format(ms,299,now_ready,player_name)             showsay(0,ms)                 //client_print(0,print_chat,now_ready, player_name)                 ready[id]=1             return PLUGIN_CONTINUE         } else {             showsay(id,already_ready)             //client_print(id,print_chat,already_ready)             return PLUGIN_HANDLED         }     }     if(equali(arg,".notready")) {         if((pug_fase==1||pug_fase==2) && swap_teams==0) {             showsay(id,no_statuschange)             //client_print(id, print_chat,no_statuschange)             return PLUGIN_HANDLED         }         if(ready[id]==1) {             format(ms,299,now_notready,player_name)             showsay(0,ms)             //client_print(0, print_chat,now_notready, player_name)             ready[id]=0             return PLUGIN_CONTINUE         } else {             showsay(id,already_notready)             //client_print(id, print_chat,already_notready)             return PLUGIN_HANDLED         }     }     if(equali(arg,".forceready")) {         if(!checkadmin(id,2)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         format(ms,299,force_usage,".forceready")         showsay(id,ms)         //client_print(id,print_chat,force_usage,".forceready")         return PLUGIN_HANDLED     }     if(containi(arg,".forceready")==0) {         if(!checkadmin(id,2)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         if((pug_fase==1||pug_fase==2) && swap_teams==0) {             showsay(id,cant_status)             //client_print(id, print_chat,cant_status)             return PLUGIN_HANDLED         }         new arg2[32]         new victim_arg[32]         parse(arg,arg2,31,victim_arg,31)         if(equali(victim_arg,"*all")) {             format(ms,299,everyone_ready,player_name)                 //client_print(0, print_chat,everyone_ready, player_name)             for(new i = 1; i <= maxplayers; i++) {                 ready[i]=1             }             return PLUGIN_CONTINUE         }         new victim_id = search_target(id, victim_arg, 3)         if(!victim_id) return PLUGIN_HANDLED         new victim_name[32]         get_user_name(victim_id, victim_name, 31)         if(ready[victim_id]==0) {             format(ms,299,force_ready,player_name,victim_name)             showsay(0,ms)                 //client_print(0, print_chat,force_ready, player_name, victim_name)                 ready[victim_id]=1             return PLUGIN_CONTINUE         } else {             format(ms,299,no_force_ready,victim_name)             showsay(id,ms)             //client_print(id, print_chat,no_force_ready, victim_name)             return PLUGIN_HANDLED         }     }     if(equali(arg,".forcenotready")) {         if(!checkadmin(id,2)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         format(ms,299,force_usage,".forcenotready")         showsay(id,ms)         //client_print(id,print_chat,force_usage,".forcenotready")         return PLUGIN_HANDLED     }     if(containi(arg,".forcenotready ")==0) {         if(!checkadmin(id,2)) {             showsay(id,no_access)             //client_print(id, print_chat,no_access)             return PLUGIN_HANDLED         }         if((pug_fase==1||pug_fase==2) && swap_teams==0) {             showsay(id,cant_status)             //client_print(id, print_chat,cant_status)             return PLUGIN_HANDLED         }         new arg2[32]         new victim_arg[32]         parse(arg,arg2,31,victim_arg,31)         if(equali(victim_arg,"*all")) {             format(ms,299,everyone_notready,player_name)             showsay(id,ms)                 //client_print(0, print_chat,everyone_notready, player_name)             for(new i = 1; i <= maxplayers; i++) {                 ready[i]=0             }             return PLUGIN_CONTINUE         }         new victim_id = search_target(id, victim_arg, 3)         if(!victim_id) return PLUGIN_HANDLED         new victim_name[32]         get_user_name(victim_id, victim_name, 31)         if(ready[victim_id]==1) {             format(ms,299,force_notready,player_name,victim_name)             showsay(0,ms)             //client_print(0, print_chat,force_notready, player_name, victim_name)             ready[victim_id]=0             return PLUGIN_CONTINUE         } else {             format(ms,299,no_force_notready,victim_name)             showsay(id,ms)             //client_print(id, print_chat,no_force_notready, victim_name)             return PLUGIN_HANDLED         }     }     if(equali(arg,".kick")) {         if(!checkadmin(id,4)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         showsay(id,kick_usage)         //client_print(id,print_chat,kick_usage)         return PLUGIN_HANDLED     }     if(containi(arg,".kick ")==0) {         if(!checkadmin(id,4)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         new arg2[32]         new victim_arg[32]         new reason[64]         parse(arg,arg2,31,victim_arg,31,reason,63)         new victim_id = search_target(id, victim_arg, 3)         if(!victim_id) return PLUGIN_HANDLED         new victim_name[32]         get_user_name(victim_id, victim_name, 31)         ready[victim_id]=0         if(reason[0]) {             format(ms,299,player_kick_r,player_name,victim_name,reason)             showsay(0,ms)             //client_print(0, print_chat, player_kick_r, player_name, victim_name, reason)             server_cmd("kick #%d ^"%s^"", get_user_userid(victim_id), reason)         } else {             format(ms,299,player_kicked,player_name,victim_name)             showsay(0,ms)             //client_print(0, print_chat, player_kicked, player_name, victim_name)             server_cmd("kick #%d ^"%s^"", get_user_userid(victim_id), has_kicked)         }         return PLUGIN_CONTINUE     }     if(equali(arg,".kill")) {         if(!checkadmin(id,3)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         showsay(id,kill_usage)         //client_print(id,print_chat,kill_usage)         return PLUGIN_HANDLED     }     if(containi(arg,".kill ")==0) {         if(!checkadmin(id,3)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         new arg2[32]         new victim_arg[32]         parse(arg,arg2,31,victim_arg,31)         new victim_id = search_target(id, victim_arg, 3)         if(!victim_id) return PLUGIN_HANDLED         new victim_name[32]         get_user_name(victim_id, victim_name, 31)         if(!is_user_alive(victim_id)) {             format(ms,299,already_dead,victim_name)             showsay(0,ms)             //client_print(0, print_chat, already_dead, victim_name)             return PLUGIN_HANDLED         }         format(ms,299,pl_killed,player_name,victim_name)         showsay(0,ms)         //client_print(0, print_chat, pl_killed, player_name, victim_name)         user_kill(victim_id)         return PLUGIN_CONTINUE     }     if(equali(arg,".mute")) {         if(!checkadmin(id,3)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         showsay(id,mute_usage)         //client_print(id,print_chat,mute_usage)         return PLUGIN_HANDLED     }     if(containi(arg,".mute ")==0) {         if(!checkadmin(id,3)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         new arg2[32], victim_arg[32]         parse(arg,arg2,31,victim_arg,31)         new victim_id = search_target(id, victim_arg, 3)         if(!victim_id) return PLUGIN_HANDLED         new victim_name[32]         get_user_name(victim_id, victim_name, 31)         if(is_muted[victim_id]) {             format(ms,299,already_muted,victim_name)             showsay(0,ms)             //client_print(0, print_chat,already_muted, victim_name)             return PLUGIN_HANDLED         }         format(ms,299,pl_muted,player_name,victim_name)         showsay(0,ms)         //client_print(0,print_chat,pl_muted,player_name,victim_name)         is_muted[victim_id]=1         set_speak(victim_id,1)         return PLUGIN_CONTINUE     }     if(equali(arg,".unmute")) {         if(!checkadmin(id,3)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         showsay(id,unmute_usage)         //client_print(id,print_chat,unmute_usage)         return PLUGIN_HANDLED     }     if(containi(arg,".unmute ")==0) {         if(!checkadmin(id,3)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         new arg2[32], victim_arg[32]         parse(arg,arg2,31,victim_arg,31)         new victim_id = search_target(id, victim_arg, 3)         if(!victim_id) return PLUGIN_HANDLED         new victim_name[32]         get_user_name(victim_id, victim_name, 31)         if(!is_muted[victim_id]) {             format(ms,299,not_muted,victim_name)             showsay(0,ms)             //client_print(0, print_chat,not_muted, victim_name)             return PLUGIN_HANDLED         }         format(ms,299,pl_unmuted,player_name,victim_name)         showsay(0,ms)         //client_print(0,print_chat,pl_unmuted,player_name,victim_name)         is_muted[victim_id]=0         set_speak(victim_id,0)         return PLUGIN_CONTINUE     }     if(equali(arg,".forcet")) {         if(!checkadmin(id,3)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         format(ms,299,force_usage,".forcet")         showsay(id,ms)         //client_print(id,print_chat,force_usage,".forcet")         return PLUGIN_HANDLED     }     if(containi(arg,".forcet ")==0) {         if(!checkadmin(id,3)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         new arg2[32]         new victim_arg[32]         parse(arg,arg2,31,victim_arg,31)         new victim_id = search_target(id, victim_arg, 3)         if(!victim_id) return PLUGIN_HANDLED         new victim_name[32]         get_user_name(victim_id, victim_name, 31)         if(get_offset_int(victim_id,TEAM_OFFSET)==1) {             format(ms,299,already_t,victim_name)             showsay(id,ms)             //client_print(id, print_chat, already_t, victim_name)             return PLUGIN_HANDLED         }         format(ms,299,force_t,player_name,victim_name)         showsay(0,ms)         //client_print(0, print_chat, force_t, player_name, victim_name)         set_user_team(victim_id,1,1)         return PLUGIN_CONTINUE     }     if(equali(arg,".forcect")) {         if(!checkadmin(id,3)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         format(ms,299,force_usage,".forcect")         showsay(id,ms)         //client_print(id,print_chat,force_usage,".forcect")         return PLUGIN_HANDLED     }     if(containi(arg,".forcect ")==0) {         if(!checkadmin(id,3)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         new arg2[32]         new victim_arg[32]         parse(arg,arg2,31,victim_arg,31)         new victim_id = search_target(id, victim_arg, 3)         if(!victim_id) return PLUGIN_HANDLED         new victim_name[32]         get_user_name(victim_id, victim_name, 31)         if(get_offset_int(victim_id,TEAM_OFFSET)==2) {             format(ms,299,already_ct,victim_name)             showsay(id,ms)             //client_print(id, print_chat, already_ct, victim_name)             return PLUGIN_HANDLED         }         format(ms,299,force_ct,player_name,victim_name)         showsay(id,ms)         //client_print(0, print_chat, force_ct, player_name, victim_name)         set_user_team(victim_id,2,1)         return PLUGIN_CONTINUE     }     if(equali(arg,".votekick")) {         showsay(id,votekick_usage)         //client_print(id,print_chat,votekick_usage)         return PLUGIN_HANDLED     }     if(containi(arg,".votekick ")==0) {         new arg2[32]         new victim_arg[32]         parse(arg,arg2,31,victim_arg,31)         new victim_id = search_target(id, victim_arg, 3)         if(!victim_id) return PLUGIN_HANDLED         new Float:voting = get_cvar_float("pug_last_voting")         if(voting > get_gametime()) {             showsay(id,vote_already)             //client_print(id,print_chat,vote_already)             return PLUGIN_HANDLED         }         if(voting && voting + get_cvar_float("pug_vote_delay") > get_gametime()) {             showsay(id,wait_awhile)             //client_print(id,print_chat,wait_awhile)             return PLUGIN_HANDLED         }         new victim_name[32]         get_user_name(victim_id,victim_name,31)         new info[1]         info[0] = victim_id         new menu_msg[256]         format(menu_msg,255,"\yKick %s?",victim_name)         add(menu_msg,255,"^n^n\y1.\w Yes")         add(menu_msg,255,"^n\y2.\w No")         new Float:votetime = get_cvar_float("pug_vote_time") + 10.0         set_cvar_float("pug_last_voting", get_gametime() + votetime)         show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(votetime),"Kick")         set_task(votetime,"check_kickvotes",task_votekick,info,1)         format(ms,299,v_kick_started,victim_name)         showsay(0,ms)         //client_print(0,print_chat,v_kick_started, victim_name)         kickchoice[0]=kickchoice[1]=0         return PLUGIN_CONTINUE     }     if(equali(arg,".voteplayers")) {         if(pug_fase==1||pug_fase==2) {             showsay(id,cant_use_cmd)             //client_print(id, print_chat,cant_use_cmd)             return PLUGIN_HANDLED         }         new Float:voting = get_cvar_float("pug_last_voting")         if (voting > get_gametime()) {             showsay(id,vote_already)             //client_print(id,print_chat,vote_already)             return PLUGIN_HANDLED         }         if (voting && voting + get_cvar_float("pug_vote_delay") > get_gametime()) {             showsay(id,wait_awhile)             //client_print(id,print_chat,wait_awhile)             return PLUGIN_HANDLED         }         new menu_msg[256]         format(menu_msg,255,"\yGametype?")         add(menu_msg,255,"^n^n\y1.\w 2vs2")         add(menu_msg,255,"^n\y2.\w 3vs3")         add(menu_msg,255,"^n\y3.\w 4vs4")         add(menu_msg,255,"^n\y4.\w 5vs5")         new Float:votetime = get_cvar_float("pug_vote_time") + 10.0         set_cvar_float("pug_last_voting",  get_gametime() + votetime )         show_menu(0,(1<<0)|(1<<1)|(1<<2)|(1<<3),menu_msg,floatround(votetime),"Gametype")         set_task(votetime,"check_typevotes",task_typevote)         showsay(0,v_gt_started)         //client_print(0,print_chat,v_gt_started)         typechoice[0]=typechoice[1]=typechoice[2]=typechoice[3]=0         return PLUGIN_CONTINUE     }     if(equali(arg,".votestop")) {         if(pug_fase==0) {             showsay(id,cant_use_cmd)             //client_print(id, print_chat, cant_use_cmd)             return PLUGIN_HANDLED         }         new Float:voting = get_cvar_float("pug_last_voting")         if (voting > get_gametime()) {             showsay(id,vote_already)             //client_print(id,print_chat,vote_already)             return PLUGIN_HANDLED         }         if (voting && voting + get_cvar_float("pug_vote_delay") > get_gametime()) {             showsay(id,wait_awhile)             //client_print(id,print_chat,wait_awhile)             return PLUGIN_HANDLED         }         new menu_msg[256]         format(menu_msg,255,"\yStop the Pug?")         add(menu_msg,255,"^n^n\y1.\w Yes")         add(menu_msg,255,"^n\y2.\w No")         new Float:votetime = get_cvar_float("pug_vote_time") + 10.0         set_cvar_float("pug_last_voting", get_gametime() + votetime)         show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(votetime),"Stoppug")         set_task(votetime,"check_stopvotes",task_stopvote)         showsay(0,v_stop_started)         //client_print(0,print_chat,v_stop_started)         stopchoice[0]=stopchoice[1]=0         return PLUGIN_CONTINUE     }     if(equali(arg,".stoppug")) {         if(!checkadmin(id,5)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         if(pug_fase==0) {             showsay(id,cant_use_cmd)             //client_print(id, print_chat, cant_use_cmd)             return PLUGIN_HANDLED         }         format(ms,299,has_stopped_pug,player_name)         showsay(0,ms)         //client_print(0,print_chat,has_stopped_pug,player_name)         for(new i = 1; i <= maxplayers; i++) {             ready[i]=0         }         set_cvar_num("pug_gametype",5)         set_cvar_num("pug_mapchange",0)         pug_fase=0         pug_start_fase=0         pug_continue_fase=0         roundcount=0         swap_teams=0         rtime_done=0         ct_score=0         t_score=0         ct_oldscore=0         t_oldscore=0         server_cmd("exec server.cfg")         if(task_exists(task_stop)) remove_task(task_stop)         if(task_exists(task_start)) remove_task(task_start)         if(task_exists(task_swap)) remove_task(task_swap)         if(task_exists(task_continue)) remove_task(task_continue)         if(task_exists(task_shuffle)) remove_task(task_shuffle)         if(task_exists(task_round)) remove_task(task_round)         if(task_exists(task_round_two)) remove_task(task_round_two)         if(task_exists(task_check)) remove_task(task_check)         if(task_exists(task_votekick)) remove_task(task_votekick)         if(task_exists(task_typevote)) remove_task(task_typevote)         if(task_exists(task_teamvote)) remove_task(task_teamvote)         if(task_exists(task_mapvote)) remove_task(task_mapvote)         return PLUGIN_CONTINUE     }     if(equali(arg,".rcon")) {         if(!checkadmin(id,5)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         showsay(id,rcon_usage)         //client_print(id,print_chat,rcon_usage)         return PLUGIN_HANDLED     }     if(containi(arg,".rcon ")==0) {         if(!checkadmin(id,5)) {             showsay(id,no_access)             //client_print(id, print_chat,no_access)             return PLUGIN_HANDLED         }         if(!arg[6]) {             showsay(id,rcon_usage)             //client_print(id,print_chat,rcon_usage)             return PLUGIN_HANDLED         }         if((containi(arg,"sv_password")!=-1)||(containi(arg,"rcon_password")!=-1)) {             showsay(id,no_rcon_access)             //client_print(id,print_chat,no_rcon_access)             return PLUGIN_HANDLED         }         server_cmd(arg[6])         return PLUGIN_HANDLED     }     if(equali(arg,".message")) {         if(!checkadmin(id,5)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         showsay(id,msg_usage)         //client_print(id,print_chat,msg_usage)         return PLUGIN_HANDLED     }     if(containi(arg,".message ")==0) {         if(!checkadmin(id,5)) {             showsay(id,no_access)             //client_print(id, print_chat,no_access)             return PLUGIN_HANDLED         }         if(!arg[9]) {             showsay(id,msg_usage)             //client_print(id,print_chat,msg_usage)             return PLUGIN_HANDLED         }         new mes[300]         format(mes,299,"^x04[#joltpug]^x01 %s",arg[9])         showsay(0,mes)         //format(mes,299,"[#joltpug] %s",arg[9])         //client_print(id,print_chat,mes)         return PLUGIN_HANDLED     }     if(equali(arg,".@admins")) {         showsay(id,admins_usage)         //client_print(id,print_chat,admins_usage)         return PLUGIN_HANDLED     }     if(containi(arg,".@admins ")==0) {         if(!arg[9]) {             showsay(id,admins_usage)             //client_print(id,print_chat,admins_usage)             return PLUGIN_HANDLED         }         new message[300]         copy(arg,191,arg[9])         format(message, 128, "%c%s (to admins):  %s^n", 2, player_name, arg)         for(new i=1; i<=maxplayers; i++) {             if(checkadmin(i,1)||id==i) {                 showsay(i,message)             }         }         return PLUGIN_HANDLED     }     if(equali(arg,".svrestart")) {         if(!checkadmin(id,6)) {             showsay(id,no_access)             //client_print(id, print_chat, no_access)             return PLUGIN_HANDLED         }         format(ms,299,restart_server,player_name)         showsay(0,ms)         //client_print(0,print_chat,restart_server,player_name)             message_begin(MSG_ALL, SVC_INTERMISSION)             message_end()             set_task(2.0,"delayedRestart")         return PLUGIN_CONTINUE     }     if(is_muted[id]) return PLUGIN_HANDLED     return PLUGIN_CONTINUE } public delayedRestart() server_cmd("restart") d_keypad(id) {     new menuBody[256]     format(menuBody,255,"\yEnter code:^n\r%s%s^n^n\w1   2   3^n4   5   6^n7   8   9^n^n0. Reset/Exit",code_entered[id],blankcode[code_pos[id]])     show_menu(id,1023,menuBody) } public reset_close(id,key) {     if(!key) d_keypad(id)     return PLUGIN_HANDLED } public enter_code(id,key) {     if(key==9) {         show_menu(id,3,"\yReset or Exit?\w^n^n\y1.\w Reset^n\y2.\w Exit")         return PLUGIN_HANDLED     }     code_entered[id][code_pos[id]++]='0'+1+key     code_entered[id][code_pos[id]]=0     if(code_pos[id]<5) {         d_keypad(id)     } else {         new sFlags[32], iFlags         if ((iFlags=authcode(sFlags,31,code_entered[id]))) {             set_user_flags(id,iFlags)             new ms[300]             format(ms,299,access_gained,sFlags)             showsay(id,ms)             //client_print(id,print_chat,access_gained,sFlags)         } else             showsay(id,invalid_code)             //client_print(id,print_chat,invalid_code)     }     return PLUGIN_HANDLED } authcode(flags[],iflags,code[]) {     if(!file_exists(code_file)) {         server_print(cant_find_code,code_file)         return 0     }     new scode[8],sline[256],ilen,iline=0     while(read_file(code_file,iline++,sline,255,ilen)) {         parse(sline,scode,7,flags,iflags)         if(scode[0]!=';'&&equal(scode,code))         return read_flags(flags)     }     return 0 } public count_kickvotes(id,key) {     if(get_cvar_num("pug_vote_answers")==1) {         new player_name[32]         get_user_name(id,player_name,31)         client_print(0,print_chat,"%s voted %s",player_name,key ?"against kicking (no)":"for kicking (yes)")     }     ++kickchoice[key]     return PLUGIN_HANDLED } public check_kickvotes(info[]) {     new victim_id = info[0], victim_name[32], ms[300]     get_user_name(victim_id,victim_name,31)     new needed = floatround(get_cvar_float("pug_votekick_ratio") * (kickchoice[0] + kickchoice[1]), floatround_ceil)     if(kickchoice[0] >= needed) {         server_cmd("kick #%d ^"%s^"", get_user_userid(victim_id), v_kick_msg)         new ms2[300]         format(ms,299,v_kick_succes,victim_name,kickchoice[0],needed)         showsay(0,ms)         //client_print(0,print_chat,v_kick_succes, victim_name, kickchoice[0],needed)         format(ms2,299,server_kicked,victim_name)         showsay(0,ms2)         //client_print(0,print_chat,server_kicked, victim_name)     } else {         format(ms,299,v_kick_fail,victim_name,kickchoice[0],needed)         showsay(0,ms)         //client_print(0,print_chat,v_kick_fail, victim_name,kickchoice[0],needed)     }     return PLUGIN_HANDLED } public count_typevotes(id,key) {     new name[32]     get_user_name(id,name,31)     if(get_cvar_num("pug_vote_answers")==1) {         switch( key ) {             case 0: client_print(0,print_chat,"%s voted for 2vs2",name)             case 1: client_print(0,print_chat,"%s voted for 3vs3",name)             case 2: client_print(0,print_chat,"%s voted for 4vs4",name)             case 3: client_print(0,print_chat,"%s voted for 5vs5",name)         }     }     ++typechoice[key]     return PLUGIN_HANDLED } public check_typevotes() {     new j, pugplayers=0     for(new checkid = 1 ; checkid <= maxplayers; ++checkid) {         if(get_user_team(checkid)==1||get_user_team(checkid)==2) {             ++pugplayers         }     }     for(new i = 0; i < 4; ++i) {         if(typechoice[j] < typechoice[i]) {             j = i         }     }     for(new k = 0; k < 4; ++k) {         if(typechoice[j]==typechoice[k]) {             new type = k+2, ms[300]             if(pugplayers > (type*2)) {                 format(ms,299,type_toomany,type,type,typechoice[k])                 showsay(0,ms)                 //client_print(0,print_chat,type_toomany,type,type,typechoice[k])             } else {                 format(ms,299,type_succes,type,type,typechoice[k])                 showsay(0,ms)                 //client_print(0,print_chat,type_succes,type,type,typechoice[k])                 set_cvar_num("pug_gametype",type)             }             return PLUGIN_HANDLED         }     }     return PLUGIN_HANDLED } public start_pug() {     if(pug_start_fase==1) {         server_cmd("exec pugmod.cfg")         showsay(0,lo3_msg)         //client_print(0,print_chat,lo3_msg)         pug_start_fase=2         set_task(1.0,"start_pug",task_start)     }     else if(pug_start_fase==2) {         server_cmd("sv_restartround 1")         pug_start_fase=3         set_task(2.0,"start_pug",task_start)     }     else if(pug_start_fase==3) {         server_cmd("sv_restartround 1")         pug_start_fase=4         set_task(2.0,"start_pug",task_start)     }     else if(pug_start_fase==4) {         showsay(0,lonr_msg)         //client_print(0,print_chat,lonr_msg)         pug_start_fase=5         set_task(1.5,"start_pug",task_start)     }     else if(pug_start_fase==5) {         server_cmd("sv_restartround 1")         pug_start_fase=6         pug_fase=2         rtime_done=0         set_task(2.0,"start_pug",task_start)     }     else if(pug_start_fase==6) {         showsay(0,now_live)         showsay(0,gl_and_hf)         //client_print(0,print_chat,now_live)         //client_print(0,print_chat,gl_and_hf)         pug_start_fase=0     }     return PLUGIN_HANDLED } public continue_pug() {     if(pug_continue_fase==1) {         server_cmd("exec pugmod.cfg")         showsay(0,co3r_msg)         //client_print(0,print_chat,co3r_msg)         pug_continue_fase=2         set_task(2.0,"continue_pug",task_continue)     }     else if(pug_continue_fase==2) {         server_cmd("sv_restartround 1")         pug_continue_fase=3         set_task(2.0,"continue_pug",task_continue)     }     else if(pug_continue_fase==3) {         server_cmd("sv_restartround 1")         pug_continue_fase=4         set_task(2.0,"continue_pug",task_continue)     }     else if(pug_continue_fase==4) {         showsay(0,conr_msg)         //client_print(0,print_chat,conr_msg)         pug_continue_fase=5         set_task(2.0,"continue_pug",task_continue)     }     else if(pug_continue_fase==5) {         roundcount=15         swap_teams=0         server_cmd("sv_restartround 1")         pug_continue_fase=6         set_task(2.0,"continue_pug",task_continue)     }     else if(pug_continue_fase==6) {         showsay(0,cont_pug)         //client_print(0,print_chat,cont_pug)         pug_continue_fase=0     }     return PLUGIN_HANDLED } public vote_teams() {     new menu_msg[256]     format(menu_msg,255,"\yTeam type?")     add(menu_msg,255,"^n^n\y1.\w Leave normal")     add(menu_msg,255,"^n\y2.\w Random")     new Float:votetime = get_cvar_float("pug_vote_time") + 10.0     set_cvar_float("pug_last_voting", get_gametime() + votetime)     show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(votetime),"Team")     set_task(votetime,"check_teamvotes",task_teamvote)     showsay(0,v_team_started)     //client_print(0,print_chat,v_team_started)     teamchoice[0]=teamchoice[1]=0     return PLUGIN_CONTINUE } public count_teamvotes(id,key) {     if(get_cvar_num("pug_vote_answers")==1) {         new player_name[32]         get_user_name(id,player_name,31)         client_print(0,print_chat,"%s voted for %s",player_name,key ?"random teams":"leaving normal")     }     ++teamchoice[key]     return PLUGIN_HANDLED } public check_teamvotes() {     new ms[300]     if(teamchoice[0] > teamchoice[1]) {         format(ms,299,v_normal_succes,teamchoice[0])         showsay(0,ms)         //client_print(0,print_chat,v_normal_succes, teamchoice[0])         roundcount=0         ct_score=0         t_score=0         swap_teams=0         pug_fase=1         pug_start_fase=1         set_task(2.0,"start_pug",task_start)     } else {         format(ms,299,v_random_succes,teamchoice[1])         showsay(0,ms)         //client_print(0,print_chat,v_random_succes, teamchoice[1])         set_task(1.0,"shuffle_teams",task_shuffle)     }     return PLUGIN_HANDLED } public count_stopvotes(id,key) {     if(get_cvar_num("pug_vote_answers")==1) {         new player_name[32]         get_user_name(id,player_name,31)         client_print(0,print_chat,"%s voted for %s",player_name,key ?"no":"yes")     }     ++stopchoice[key]     return PLUGIN_HANDLED } public check_stopvotes() {     new ms[300]     if(teamchoice[0] > teamchoice[1]) {         format(ms,299,v_stop_succes,stopchoice[0],stopchoice[1])         showsay(0,ms)         //client_print(0,print_chat,v_stop_succes, stopchoice[0], stopchoice[1])         stop_pug()     } else {         format(ms,299,v_stop_failed,stopchoice[0],stopchoice[1])         showsay(0,ms)         //client_print(0,print_chat,v_stop_failed, stopchoice[0], stopchoice[1])     }     return PLUGIN_HANDLED } public vote_map() {     if(!map_count) {         set_task(0.5,"vote_teams")         return PLUGIN_HANDLED     }     new Float:votetime = get_cvar_float("pug_vote_time") + 10.0     set_cvar_float("pug_last_voting", get_gametime() + votetime)     //client_print(0,print_chat,votemap_started)     showsay(0,votemap_started)     for(new i=0; i<=map_count; ++i) {         map_votecount[i]=0     }     for(new id=1; id<=maxplayers; ++id) {         vote_map_menu(id,map_menuposition[id]=0)     }     set_task(votetime,"check_mapvotes",task_mapvote)     return PLUGIN_HANDLED } public vote_map_menu(id,pos) {     if(pos < 0) return     new menuBody[1024], b = 0, start= pos * 7     if(start >= map_count) start=pos=map_menuposition[id]=0     new len = format(menuBody,1023,"\yChoose a map:^n^n")     new end = start + 7, keys = (1<<9)     if(end > map_count) end=map_count     for(new a = start; a < end; ++a) {         keys |= (1<<b)         len += format(menuBody[len],1023-len,"\y%d.\w %s^n",++b,map_desc[a])     }     if(end != map_count) {         len += format(menuBody[len],1023-len,"^n\y9.\w More^n\y0.\w %s", pos? "Back":"Exit")         keys |= (1<<8)     } else {         len += format(menuBody[len],1023-len,"^n\y0.\w %s", pos ? "Back" : "Exit")     }     show_menu(id,keys,menuBody,-1) } public count_mapvotes(id,key) {     switch(key) {         case 8: vote_map_menu(id,++map_menuposition[id])         case 9: vote_map_menu(id,--map_menuposition[id])         default: {             new mapnumber = (map_menuposition[id]*7) + (key)             ++map_votecount[mapnumber]             if(get_cvar_num("pug_vote_answers")==1) {                 new player_name[32]                 get_user_name(id,player_name,31)                 if(map_votecount[mapnumber] > 1) client_print(0,print_chat,"%s voted for %s (currently %i votes)",player_name,map_name[mapnumber],map_votecount[mapnumber])                 else client_print(0,print_chat,"%s voted for %s (currently %i vote)",player_name,map_name[mapnumber],map_votecount[mapnumber])             }         }     }     return PLUGIN_HANDLED } public check_mapvotes() {     new num, ppl[32], a=0, ms[300]     get_players(ppl,num,"c")     if(num==0) num = 1     for(new i = 0; i <=map_count; ++i) {         if(map_votecount[a] < map_votecount[i]) {             a=i         }     }     new currentMap[32]     get_mapname(currentMap,31)     if(!equali(map_name[a],currentMap)) {         format(ms,299,mapvote_succes,map_name[a])         showsay(0,ms)         //client_print(0,print_chat,mapvote_succes,map_name[a])         set_cvar_num("pug_mapchange",1)             message_begin(MSG_ALL, SVC_INTERMISSION)             message_end()             set_task(2.0,"delayedChange",0,map_name[a],strlen(map_name[a]) + 1)         return PLUGIN_HANDLED     }     format(ms,299,votemap_failed,currentMap)     //client_print(0,print_chat,votemap_failed,currentMap)     set_task(0.5,"vote_teams")     return PLUGIN_HANDLED } public delayedChange(mapname[]) {     server_cmd("changelevel %s",mapname) } public shuffle_teams(id) {     new players[32], pnum, i     for(i=1; i<=maxplayers; ++i) {         if(get_user_team(i)==1||get_user_team(i)==2) {             if(get_offset_int(i,TEAM_OFFSET)==2) {                 players[pnum]=i                 pnum++             }         }     }     for(i=1; i<=maxplayers; ++i) {         if(get_user_team(i)==1||get_user_team(i)==2) {             if(get_offset_int(i,TEAM_OFFSET)==1) {                 players[pnum]=i                 pnum++             }         }     }     for(i=0; i<pnum; i=i+2) {         set_user_team(players[i],1,1)         set_user_team(players[i+1],2,1)     }     roundcount=0     ct_score=0     t_score=0     swap_teams=0     rtime_done=0     pug_fase=1     pug_start_fase=1     set_task(2.0,"start_pug",task_start)     return PLUGIN_HANDLED } stock set_user_team(id,team,spawn=0) {     if(team != 1 && team != 2) return 0     if(get_offset_int(id,TEAM_OFFSET)==team) return 0     set_offset_int(id,TEAM_OFFSET,team)     message_begin(MSG_ALL, 86, {0,0,0}, id)     write_byte(id)     if(team==1) write_string("TERRORIST")     else write_string("CT")     message_end()     if(is_user_alive(id)) {         if(team==1) {             message_begin(MSG_ONE,107,{0,0,0},id)             write_byte(0)             write_string("defuser")             write_byte(0)             write_byte(255)             write_byte(0)             message_end()             switch(random_num(0,3)) { #if defined NEW_VEXDUM                 case 0: set_user_model(id, "terror")                 case 1: set_user_model(id, "leet")                 case 2: set_user_model(id, "arctic")                 case 3: set_user_model(id, "guerilla") #else                 case 0: CS_SetModel(id, "terror")                 case 1: CS_SetModel(id, "leet")                 case 2: CS_SetModel(id, "arctic")                 case 3: CS_SetModel(id, "guerilla") #endif             }         } else {             if(is_user_bot(id)) engclient_cmd(id, "drop", "weapon_c4")             else client_cmd(id, "drop weapon_c4")             switch(random_num(0,3)) { #if defined NEW_VEXDUM                 case 0: set_user_model(id, "urban")                 case 1: set_user_model(id, "gsg9")                 case 2: set_user_model(id, "sas")                 case 3: set_user_model(id, "gign") #else                 case 0: CS_SetModel(id, "urban")                 case 1: CS_SetModel(id, "gsg9")                 case 2: CS_SetModel(id, "sas")                 case 3: CS_SetModel(id, "gign") #endif             }         }         if(spawn==1) checkspot(id,team)     }     if(team==1) {         showsay(id,trans_t)         //client_print(id,print_chat,trans_t)     } else {         showsay(id,trans_ct)         //client_print(id,print_chat,trans_ct)     }     return 1 } public checkspot(id,team) {     new sp_string[2][] = {"info_player_start","info_player_deathmatch"}     new sp_points[128], ent = -1, sp_found = 0, Float:sp_origin[3]     do {         if(team==1) ent=find_entity(ent,sp_string[1])         else ent=find_entity(ent,sp_string[0])         if(ent>0) {             sp_points[sp_found]=ent             sp_found++         }     }     while(ent&&sp_found<128)     new bool:found_sp, vici=72, ii, p_invici, j, Float:othorigin[3]     for(ii=0 ;ii<sp_found && !found_sp;ii++) {         entity_get_vector(sp_points[ii],EV_VEC_origin,sp_origin)         p_invici = 0         for(j=get_maxplayers();j>0 && !p_invici;j--){             if(is_user_connected(j)){                 entity_get_vector(j,EV_VEC_origin,othorigin)                 if(floatround(vector_distance(sp_origin, othorigin)) < vici)                     p_invici++             }         }         if(p_invici==0) found_sp=true         else found_sp=false     }     if(found_sp) {         entity_set_vector(id,EV_VEC_origin,sp_origin)         return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE } stock checkadmin(id,checkflag) {     new aflags = get_user_flags(id)     switch(checkflag) {         case 1: if((aflags & PUG_ADMIN_1)||(aflags & PUG_ADMIN_2)||(aflags & PUG_ADMIN_3)||(aflags & PUG_ADMIN_4)||(aflags & PUG_ADMIN_5)||(aflags & PUG_ADMIN_6)) return 1         case 2: if((aflags & PUG_ADMIN_2)||(aflags & PUG_ADMIN_3)||(aflags & PUG_ADMIN_4)||(aflags & PUG_ADMIN_5)||(aflags & PUG_ADMIN_6)) return 1         case 3: if((aflags & PUG_ADMIN_3)||(aflags & PUG_ADMIN_4)||(aflags & PUG_ADMIN_5)||(aflags & PUG_ADMIN_6)) return 1         case 4: if((aflags & PUG_ADMIN_4)||(aflags & PUG_ADMIN_5)||(aflags & PUG_ADMIN_6)) return 1         case 5: if((aflags & PUG_ADMIN_5)||(aflags & PUG_ADMIN_6)) return 1         case 6: if(aflags & PUG_ADMIN_6) return 1     }     return 0 } stock search_target(id,const arg[],flags = 1) {     new player = find_player("bl",arg)     if(player) {         if(player != find_player("blj",arg)) {         showsay(id,more_clients)         //client_print(id,print_chat,more_clients)         return 0             }     }     else if((player=find_player("c",arg) )==0&&arg[0]=='#'&&arg[1]) {         player = find_player("k",strtonum(arg[1]))     }     if(!player) {         showsay(id,cl_notfound)         //client_print(id,print_chat,cl_notfound)         return 0     }     if(flags & 1) {         if((get_user_flags(player)&PUG_ADMIN_1) && ((flags&2)?(id!=player):true)) {             new imname[32], ms[300]             get_user_name(player,imname,31)             format(ms,299,has_imm,imname)             showsay(id,ms)             //client_print(id,print_chat,has_imm,imname)             return 0         }     }     if(flags & 4) {         if(!is_user_alive(player)) {             new imname[32], ms[300]             get_user_name(player,imname,31)             format(ms,299,cant_p_on_dead,imname)             showsay(id,ms)             //client_print(id,print_chat,cant_p_on_dead,imname)             return 0         }     }     if(flags & 8) {         if(is_user_bot(player)) {             new imname[32], ms[300]             get_user_name(player,imname,31)             format(ms,299,cant_p_on_bot,imname)             showsay(id,ms)             //client_print(id,cant_p_on_bot,imname)             return 0         }     }     return player } stock build_path(path[],len,{Float,_}:...) {     new basedir[32]     get_localinfo("amx_basedir", basedir , 31 )     format_args(path,len,2)     return replace(path,len,"$basedir", basedir) }

Theres the source
Attached Files
File Type: sma Get Plugin or Get Source (pugmod_v1.5.0.sma - 143 views - 62.3 KB)
sl1ps is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-12-2005 , 17:55  
Reply With Quote #5

Here you go.

EDIT: files removed
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS

Last edited by XxAvalanchexX; 04-16-2007 at 01:19.
XxAvalanchexX is offline
sl1ps
Junior Member
Join Date: Sep 2005
Old 09-14-2005 , 13:24   ty
Reply With Quote #6

Thanks for that.

The only problem i'm having is once someone has connected once and
started playing, if they quit and come back to the server when they try to
select either CT or T it says they have chosen either random or normal
teams(a vote to leave teams or mix them up for the pug) as if the plugin
commands are conflicting with the CS choose-team commands...
I don't really need that option anyway, so would removing this part of the code be an easier way to get rid of that problem?

Code:
} public vote_teams() {     new menu_msg[256]     format(menu_msg,255,"\yTeam type?")     add(menu_msg,255,"^n^n\y1.\w Leave normal")     add(menu_msg,255,"^n\y2.\w Random")     new Float:votetime = get_cvar_float("pug_vote_time") + 10.0     set_cvar_float("pug_last_voting", get_gametime() + votetime)     show_menu(0,(1<<0)|(1<<1),menu_msg,floatround(votetime),"Team")     set_task(votetime,"check_teamvotes",task_teamvote)     showsay(0,v_team_started)     //client_print(0,print_chat,v_team_started)     teamchoice[0]=teamchoice[1]=0     return PLUGIN_CONTINUE } public count_teamvotes(id,key) {     if(get_cvar_num("pug_vote_answers")==1) {         new player_name[32]         get_user_name(id,player_name,31)         client_print(0,print_chat,"%s voted for %s",player_name,key ?"random teams":"leaving normal")     }     ++teamchoice[key]     return PLUGIN_HANDLED } public check_teamvotes() {     new ms[300]     if(teamchoice[0] > teamchoice[1]) {         format(ms,299,v_normal_succes,teamchoice[0])         showsay(0,ms)         //client_print(0,print_chat,v_normal_succes, teamchoice[0])         roundcount=0         ct_score=0         t_score=0         swap_teams=0         pug_fase=1         pug_start_fase=1         set_task(2.0,"start_pug",task_start)     } else {         format(ms,299,v_random_succes,teamchoice[1])         showsay(0,ms)         //client_print(0,print_chat,v_random_succes, teamchoice[1])         set_task(1.0,"shuffle_teams",task_shuffle)     }     return PLUGIN_HANDLED

Cheers in advance
sl1ps is offline
sl1ps
Junior Member
Join Date: Sep 2005
Old 09-14-2005 , 17:03  
Reply With Quote #7

bump^
sl1ps is offline
Mr. Pink
Junior Member
Join Date: Sep 2005
Location: Cali
Old 09-15-2005 , 19:18  
Reply With Quote #8

what is this for?
im new.
if it helps me.
ill use it.
if i know what.
it is haha.
__________________
Peace <3 Alex.!
Mr. Pink is offline
Send a message via AIM to Mr. Pink Send a message via MSN to Mr. Pink
sl1ps
Junior Member
Join Date: Sep 2005
Old 09-16-2005 , 17:02   team voting
Reply With Quote #9

Would anyone know how I would go about getting rid of the option to
vote teams in this mod - it comes up with the menu to choose to leave
teams as they are or mix them up - but I don't want that option, could someone
point out what I should change for it to not allow swapping the teams about
at all - i believe it's to do with vote_teams -


Cheers in advance,

Pete
sl1ps is offline
sl1ps
Junior Member
Join Date: Sep 2005
Old 09-17-2005 , 10:12  
Reply With Quote #10

bump-_-
sl1ps is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:30.


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