Raised This Month: $ Target: $400
 0% 

Error compiling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bloods
Member
Join Date: Aug 2013
Old 05-10-2014 , 20:34   Error compiling
Reply With Quote #1

Hey, I'm trying to compile my jailbreak vip menu, my error is this:

Quote:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 262
Error: Invalid expression, assumed zero on line 262
Warning: Loose indentation on line 265
Error: Invalid statement; not in switch on line 265
Warning: Expression has no effect on line 265
Error: Expected token: ";", but found ":" on line 265
Error: Invalid expression, assumed zero on line 265
Error: Too many error messages on one line on line 265

Compilation aborted.
5 Errors.
Could not locate output file C:\Users\xxxxx\Documents\amx\jbvip.amx (compile failed).
My code is this(I've given lines 209-300):

PHP Code:
        
        case 
4:
        { 
            if( 
is_user_aliveid ) )
            { 
                if( 
cs_get_user_teamid ) == CS_TEAM_CT )
                {
                    if ( 
u_kit id ] )
                    {
                        
u_kit id ] = 0
                        
                        
new Client[32
                        
get_user_name(id,Client,31
                        
                        
give_item(id"weapon_hegrenade");
                        
give_item(id"weapon_flashbang");
                        
give_item(id"weapon_flashbang");
                        
give_item(id"weapon_smokegrenade");
                        
give_item(id"weapon_deagle");
                        
cs_set_user_bpammo(idCSW_DEAGLE35);
                        
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
                        
give_item(id"weapon_m4a1");
                        
cs_set_user_bpammo(idCSW_M4A190);
                        
ColorChat(0GREY"^x04%s^x03 ' ^4%s^3 ' used the VIP Menu to get a^4 Colt^3!"prefixClient )
                    }
                    else 
ColorChat(idGREY"^x04%s^x03 You have already picked a kit!"prefix )
                }
                else 
ColorChat(idGREY"^x04%s^x03 You need to be a^04 Counter Terrorist^03 to get^4 Weapons^3."prefix )            
            }
            else 
ColorChat(idGREY"^x04%s^x03 You're dead, you can't use this command!"prefix )
        }
        case 
5:
        { 
            if ( 
get_gametime ( ) < u_noclip id ] + 60 )
            {
                
ColorChat idGREY"^x04%s^x03 You must wait^4 %i^3 seconds before you can use noclip."prefixfloatround u_noclip id ] + 60 get_gametime ( ) + ) )
                return 
PLUGIN_HANDLED
            
}
            else
            {
                if(
is_user_alive(id)) 
                {
                    
u_noclip id ] = get_gametime ( )
                    
                    {
                        
set_user_noclip id)
                        
                        new 
Client[32
                        
get_user_name(id,Client,31)  
                        
                        
ColorChat 0GREY"^x04%s^x03 ' ^4%s^3 ' used the VIP Menu to get^4 Noclip^3!"prefixClient )
                        
set_task 10.0"CmdNoclipOff"id )            
                }
                else 
ColorChat(idGREY"^x04%s^x03 You're dead, you can't use this command!"prefix )
            }
        }
        case 
6:
        {
            
ShowGlowMenuColor(id)
        }
        case 
7:
        { 
            if ( 
get_gametime ( ) < u_drugs id ] + 15 )
            {
                
ColorChat idGREY"^x04%s^x03 You must wait^4 %i^3 seconds before you can use drugs."prefixfloatround u_drugs id ] + 15 get_gametime ( ) + ) )
                return 
PLUGIN_HANDLED
            
}
            else
            {
                if(
is_user_alive(id)) 
                {
                    
u_drugs id ] = get_gametime ( )
                    
                    
ShowDrug(id)
                }
                else 
ColorChat(idGREY"^x04%s^x03 You're dead, you can't use this command!"prefix )
            }
        }
        case 
8:
        { 
            if ( 
get_gametime ( ) < u_map id ] + 600 )
            {
                
ColorChat idGREY"^x04%s^x03 You must wait^4 %i^3 seconds before you can vote map."prefixfloatround u_map id ] + 600 get_gametime ( ) + ) )
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
Startmapvote id )
            }
        }
        case 
9:
        { 
Can anyone fix these errors for me please?

Last edited by Bloods; 05-10-2014 at 20:38.
Bloods is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-10-2014 , 20:45   Re: Error compiling
Reply With Quote #2

Just attach the full code if you want help.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
Bloods
Member
Join Date: Aug 2013
Old 05-10-2014 , 20:47   Re: Error compiling
Reply With Quote #3

Quote:
Originally Posted by wickedd View Post
Just attach the full code if you want help.
Nope I don't want anyone to take it hence why I've uploaded a specific amount of lines, all I need is the new lines to replace my current and if their are any errors I have no problem uploading them again.

Not that I don't trust you or coders I just don't want random people helping themselves to my stuff...
Bloods is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-10-2014 , 21:10   Re: Error compiling
Reply With Quote #4

Then which line is the ones causing the errors?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Bloods
Member
Join Date: Aug 2013
Old 05-10-2014 , 21:16   Re: Error compiling
Reply With Quote #5

Quote:
Originally Posted by YamiKaitou View Post
Then which line is the ones causing the errors?
Warning: Loose indentation on line 262
Error: Invalid expression, assumed zero on line 262
Warning: Loose indentation on line 265
Error: Invalid statement; not in switch on line 265
Warning: Expression has no effect on line 265
Error: Expected token: ";", but found ":" on line 265
Error: Invalid expression, assumed zero on line 265
Error: Too many error messages on one line on line 265

I put this in the first quote, 209-300 should be enough for you to know what to fix. I can mail you the full code but I'm not posting it all here.
Bloods is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-10-2014 , 21:20   Re: Error compiling
Reply With Quote #6

The code you posted does not help us. This is a public forum, not your personal support forum. If you want help post the code or go ask for help elsewhere.

Edit: At least tell us what line is causing the error.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 05-10-2014 at 21:22.
wickedd is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-10-2014 , 21:21   Re: Error compiling
Reply With Quote #7

If you aren't going to give us the exact code, then you need to mark the lines that have the errors
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Bloods
Member
Join Date: Aug 2013
Old 05-10-2014 , 21:27   Re: Error compiling
Reply With Quote #8

I mailed you Yami, the code is all there... Tried to mail you wicked but you have it blocked.
Bloods is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 05-10-2014 , 21:28   Re: Error compiling
Reply With Quote #9

I don't provide private assistance. Either post the entire code here or tell us EXACTLY which line the errors point to
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Bloods
Member
Join Date: Aug 2013
Old 05-10-2014 , 21:30   Re: Error compiling
Reply With Quote #10

I'll post the code until you get it then I'll remove it soon.

Quote:
#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <cstrike>
#include <fakemeta>
#include <engine>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Jailbreak VIP"
#define VERSION "1.0.0"
#define AUTHOR "MiX"
#define KeysSlap (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1< <6)|(1<<7)|(1<<|(1<<9)
#define KeysDrug (1<<0)|(1<<1)

#define MAX_players 32
#define MAX_menudata 1024
#define KeysGlowMenuColor (1<<0)|(1<<1)|(1<<2)|(1<<3)
#define KeysGlowRed (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1< <6)|(1<<7)|(1<<|(1<<9)
#define KeysGlowBlue (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1< <6)|(1<<7)|(1<<|(1<<9)

new MenuPosGlowBlue
new MenuPlayersGlowBlue[32]

new MenuPosGlowRed
new MenuPlayersGlowRed[32]

new ga_PlayerName[MAX_players][32]
new ga_PlayerAuthID[MAX_players][35]
new ga_PlayerID[MAX_players]
new ga_PlayerIP[MAX_players][16]
new ga_MenuData[MAX_menudata]
new ga_Choice[2]
new gi_VoteStarter
new gi_MenuPosition
new gi_Sellection
new gi_TotalPlayers
new gi_SysTimeOffset = 0
new i

new gi_LastTime
new gf_Ratio
new gi_BanTime

new MenuPosSlap
new MenuPlayersSlap[32]

new Float: u_slap [ 33 ]
new Float: u_noclip [ 33 ]
new Float: u_drugs [ 33 ]
new Float: u_map [ 33 ]
new Float: u_kick [ 33 ]
new Float: u_ban [ 33 ]

new u_kit [ 33 ]

new const prefix[] = "";

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_menucmd(register_menuid("GlowBlue"), KeysGlowBlue, "PressedGlowBlue")
register_menucmd(register_menuid("GlowRed"), KeysGlowRed, "PressedGlowRed")
register_menucmd(register_menuid("GlowMenuCol or"), KeysGlowMenuColor, "PressedGlowMenuColor")
register_menucmd(register_menuid("Drug"), KeysDrug, "PressedDrug")
register_menucmd(register_menuid("Slap"), KeysSlap, "PressedSlap")

register_menucmd(register_menuid("ChoosePlaye r"), 1023, "ChooseMenu")
register_menucmd(register_menuid("VoteMenu"), 1023, "CountVotes")

register_menucmd(register_menuid("ChooseKickP layer"), 1023, "ChooseKickMenu")
register_menucmd(register_menuid("VoteKickMen u"), 1023, "CountKickVotes")

register_menucmd(register_menuid("VoteMapMenu "), 1023, "CountMapVotes")

register_clcmd( "say /vm", "VIPMenu" );
register_clcmd( "say_team /vm", "VIPMenu" );

RegisterHam ( Ham_Spawn, "player", "eventPlayerSpawn", 1 )
RegisterHam ( Ham_Killed, "player", "FwdPlayerDeath", 1 )

register_forward ( FM_PlayerPreThink, "fwdPlayerPreThink", 0 )

gi_LastTime=register_cvar("amx_voteban_lastti me","0")
gf_Ratio=register_cvar("amx_member_ratio","0. 70")
gi_BanTime=register_cvar("amx_voteban_bantime ","5")
}

public plugin_precache()
{
precache_sound("fnmusic/vote.wav")
}

public VIPMenu( id )
{
if(get_user_flags(id) & ADMIN_LEVEL_H)
{
if ( cs_get_user_team ( id ) != CS_TEAM_SPECTATOR )
{
new vip_menu = menu_create( "\rFragnation VIP Menu^n\rPage:\d", "MainMenu_handler" );
menu_additem( vip_menu, "\ySlap", "1", 0 );
menu_additem( vip_menu, "\yAutosniper + Kit", "2", 0 );
menu_additem( vip_menu, "\yAWP + Kit", "3", 0 );
menu_additem( vip_menu, "\yM4 + Kit", "4", 0 );
menu_additem( vip_menu, "\yNoclip \w(10 Seconds)", "5", 0 );
menu_additem( vip_menu, "\yGlow Menu", "6", 0 );
menu_additem( vip_menu, "\yDrug Me", "7", 0 );
menu_additem( vip_menu, "\yVote Map", "8", 0 );
menu_additem( vip_menu, "\yVote Kick", "9", 0 );
menu_additem( vip_menu, "\yVote Ban", "10", 0 );

menu_setprop( vip_menu, MPROP_EXIT, MEXIT_ALL );
menu_display( id, vip_menu, 0 );
}
else ColorChat ( id, GREY, "^x04%s^x03 You can't use this menu as^4 Spectator^3!", prefix )
}
else ColorChat(id, GREY, "^x04%s^x03 You need to be a VIP to use this command.", prefix )

return PLUGIN_HANDLED
}

public MainMenu_handler( id, menu, item )
{
if( item == MENU_EXIT )
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;

menu_item_getinfo( menu, item, access, data,5, iName, 63, callback );
new key = str_to_num( data );
switch( key )
{
case 1:
{
if ( get_gametime ( ) < u_slap [ id ] + 15 )
{
ColorChat ( id, GREY, "^x04%s^x03 You must wait^4 %i^3 seconds before you can slap.", prefix, floatround ( u_slap [ id ] + 15 - get_gametime ( ) + 1 ) )
return PLUGIN_HANDLED
}
else
{
ShowSlap(id)
u_slap [ id ] = get_gametime ( )
}
}
case 2:
{
if( is_user_alive( id ) )
{
if( cs_get_user_team( id ) == CS_TEAM_CT )
{
if ( u_kit [ id ] )
{
u_kit [ id ] = 0

new Client[32]
get_user_name(id,Client,31)

give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35);
cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);
give_item(id, "weapon_g3sg1");
cs_set_user_bpammo(id, CSW_G3SG1, 90);
ColorChat(0, GREY, "^x04%s^x03 ' ^4%s^3 ' used the VIP Menu to get an^4 AutoSniper^3!", prefix, Client )
}
else ColorChat(id, GREY, "^x04%s^x03 You have already picked a kit!", prefix )
}
else ColorChat(id, GREY, "^x04%s^x03 You need to be a^04 CT^03 to get^4 Weapons^3.", prefix )
}
else ColorChat(id, GREY, "^x04%s^x03 You're dead, you can't use this command!", prefix )
}
case 3:
{
if( is_user_alive( id ) )
{
if( cs_get_user_team( id ) == CS_TEAM_CT )
{
if ( u_kit [ id ] )
{
u_kit [ id ] = 0

new Client[32]
get_user_name(id,Client,31)

give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35);
cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);
give_item(id, "weapon_awp");
cs_set_user_bpammo(id, CSW_AWP, 30);
ColorChat(0, GREY, "^x04%s^x03 ' ^4%s^3 ' used the VIP Menu to get a^4 AWP^3!", prefix, Client )
}
else ColorChat(id, GREY, "^x04%s^x03 You have already picked a kit!", prefix )
}
else ColorChat(id, GREY, "^x04%s^x03 You need to be a^04 Counter Terrorist^03 to get^4 Weapons^3.", prefix )
}
else ColorChat(id, GREY, "^x04%s^x03 You're dead, you can't use this command!", prefix )
}
case 4:
{
if( is_user_alive( id ) )
{
if( cs_get_user_team( id ) == CS_TEAM_CT )
{
if ( u_kit [ id ] )
{
u_kit [ id ] = 0

new Client[32]
get_user_name(id,Client,31)

give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
give_item(id, "weapon_deagle");
cs_set_user_bpammo(id, CSW_DEAGLE, 35);
cs_set_user_armor(id, 100, CS_ARMOR_VESTHELM);
give_item(id, "weapon_m4a1");
cs_set_user_bpammo(id, CSW_M4A1, 90);
ColorChat(0, GREY, "^x04%s^x03 ' ^4%s^3 ' used the VIP Menu to get a^4 Colt^3!", prefix, Client )
}
else ColorChat(id, GREY, "^x04%s^x03 You have already picked a kit!", prefix )
}
else ColorChat(id, GREY, "^x04%s^x03 You need to be a^04 Counter Terrorist^03 to get^4 Weapons^3.", prefix )
}
else ColorChat(id, GREY, "^x04%s^x03 You're dead, you can't use this command!", prefix )
}
case 5:
{
if ( get_gametime ( ) < u_noclip [ id ] + 60 )
{
ColorChat ( id, GREY, "^x04%s^x03 You must wait^4 %i^3 seconds before you can use noclip.", prefix, floatround ( u_noclip [ id ] + 60 - get_gametime ( ) + 1 ) )
return PLUGIN_HANDLED
}
else
{
if(is_user_alive(id))
{
u_noclip [ id ] = get_gametime ( )

{
set_user_noclip ( id, 1 )

new Client[32]
get_user_name(id,Client,31)

ColorChat ( 0, GREY, "^x04%s^x03 ' ^4%s^3 ' used the VIP Menu to get^4 Noclip^3!", prefix, Client )
set_task ( 10.0, "CmdNoclipOff", id )
}
else ColorChat(id, GREY, "^x04%s^x03 You're dead, you can't use this command!", prefix )
}
}
case 6:
{
ShowGlowMenuColor(id)
}
case 7:
{
if ( get_gametime ( ) < u_drugs [ id ] + 15 )
{
ColorChat ( id, GREY, "^x04%s^x03 You must wait^4 %i^3 seconds before you can use drugs.", prefix, floatround ( u_drugs [ id ] + 15 - get_gametime ( ) + 1 ) )
return PLUGIN_HANDLED
}
else
{
if(is_user_alive(id))
{
u_drugs [ id ] = get_gametime ( )

ShowDrug(id)
}
else ColorChat(id, GREY, "^x04%s^x03 You're dead, you can't use this command!", prefix )
}
}
case 8:
{
if ( get_gametime ( ) < u_map [ id ] + 600 )
{
ColorChat ( id, GREY, "^x04%s^x03 You must wait^4 %i^3 seconds before you can vote map.", prefix, floatround ( u_map [ id ] + 600 - get_gametime ( ) + 1 ) )
return PLUGIN_HANDLED
}
else
{
Startmapvote ( id )
}
}
case 9:
{
if ( get_gametime ( ) < u_kick [ id ] + 300 )
{
ColorChat ( id, GREY, "^x04%s^x03 You must wait^4 %i^3 seconds before you can votekick..", prefix, floatround ( u_kick [ id ] + 300 - get_gametime ( ) + 1 ) )
}
else
{
Startkickvote ( id )
}
}
case 10:
{
if ( get_gametime ( ) < u_ban [ id ] + 300 )
{
ColorChat ( id, GREY, "^x04%s^x03 You must wait^4 %i^3 seconds before you can voteban..", prefix, floatround ( u_ban [ id ] + 300 - get_gametime ( ) + 1 ) )
}
else
{
Startbanvote ( id )
}
}
}
return PLUGIN_CONTINUE
}



public CmdNoclipOff ( id )
{
if ( !is_user_alive ( id ) ) return PLUGIN_HANDLED
else
{
new Client[32]
get_user_name(id,Client,31)
set_user_noclip ( id, 0 )
ColorChat ( 0, GREY, "^x04%s^x03 ' ^4%s^3 ' no longer has^4 Noclip^3", prefix, Client )
}
return PLUGIN_CONTINUE
}

public eventPlayerSpawn ( id )
{
u_kit [ id ] = 1
}

public putinserver ( id )
{
u_slap [ id ] = get_gametime ( ) - 15
u_noclip [ id ] = get_gametime ( ) - 60
}

public client_connect ( id )
{
u_kit [ id ] = 1
}

public FwdPlayerDeath ( id )
{
if ( get_user_noclip ( id ) )
{
new Client[32]
get_user_name(id,Client,31)
ColorChat ( 0, GREY, "^x04%s^x03 ' ^4%s^3 ' no longer has^4 Noclip^3", prefix, Client )
}
set_user_noclip ( id, 0 )
}

public ShowSlap(id) {
ShowMenuSlap(id, MenuPosSlap = 0)
return PLUGIN_HANDLED
}

public ShowMenuSlap(id, position) {
if (position < 0) { return 0; }

new i, k
new MenuBody[255]
new CurrentKey = 0
new Start = position * 7
new Num
new UserName[32]

get_players(MenuPlayersSlap, Num)
if (Start >= Num) { Start = position = MenuPosSlap = 0; }
new Len = format(MenuBody, 255, "\yFragnation\R%d/%d^nSlap Player:^n\w^n", position+1, (Num / 7 + ((Num % 7) ? 1 : 0 )) )
new End = Start + 7
new Keys = (1<<9)
if (End > Num) { End = Num; }

for(i=Start;i<End;i++) {
k = MenuPlayersSlap[i]
get_user_name(k, UserName, 31)
Keys |= (1<<CurrentKey++)
Len += format(MenuBody[Len], (255-Len), "\w%i. %s^n", CurrentKey, UserName)
}
if (End != Num) {
format(MenuBody[Len], (255-Len), "^n\w9. Next^n%s", position ? "\w0. Back" : "\w0. Exit")
Keys |= (1<<
}
else {
format(MenuBody[Len], (255-Len), "^n%s", position ? "\w0. Back" : "\w0. Exit")
}
show_menu(id, Keys, MenuBody, -1, "Slap")
return 0
}

public PressedSlap(id, key) {
switch (key) {
case 8: ShowMenuSlap(id, ++MenuPosSlap)
case 9: ShowMenuSlap(id, --MenuPosSlap)
default: {

new PlayerID = MenuPlayersSlap[MenuPosSlap * 7 + key]
new UserName[32]
get_user_name(PlayerID, UserName, 31)

new Client[32]
get_user_name(id,Client,31)

user_slap(PlayerID,0,0)
user_slap(PlayerID,0,0)

ColorChat( 0, GREY, "^x04%s^x03 ' ^4%s^3 ' was slapped by^4 %s^3!", prefix, UserName, Client )
}
}
return PLUGIN_HANDLED
}

public ShowDrug(id) {
show_menu(id, KeysDrug, "\yFragnation^n^n\r1. \yDrug Me^n\r2. \yUndrug Me^n", -1, "Drug") // Display menu
}

public PressedDrug(id, key)
{
switch (key) {
case 0:
{
if( is_user_alive( id ) )
{
new Client[32]
get_user_name(id,Client,31)

message_begin(MSG_ONE, get_user_msgid("SetFOV"), {0,0,0}, id)
write_byte(170)
message_end()
ColorChat( 0, GREY, "^x04%s^x03 ' ^4%s^3 ' is now on^4 Drugs^3.", prefix, Client )
}
else ColorChat(id, GREY, "^x04%s^x03 You're dead, you can't use this command!", prefix )
}
case 1: { // 2
new Client[32]
get_user_name(id,Client,31)

message_begin(MSG_ONE, get_user_msgid("SetFOV"), {0,0,0}, id)
write_byte(90)
message_end()
}
}
}

/*###### START VOTE BAN ######*/
public Startbanvote(id)
{
get_players( ga_PlayerID, gi_TotalPlayers )
for(i=0; i<gi_TotalPlayers; i++)
{

new TempID = ga_PlayerID[i]

if(TempID == id)
gi_VoteStarter=i

get_user_name( TempID, ga_PlayerName[i], 31 )
get_user_authid( TempID, ga_PlayerAuthID[i], 34 )
get_user_ip( TempID, ga_PlayerIP[i], 15, 1 )
}

gi_MenuPosition = 0
ShowPlayerMenu(id)
return 0
}

public ShowPlayerMenu(id)
{
new arrayloc = 0
new keys = (1<<9)

arrayloc = format(ga_MenuData,(MAX_menudata-1),"\yFragnation Vote Ban^nChoose Player\w ^n^n")
for(i=0; i<8; i++)
if( gi_TotalPlayers>(gi_MenuPosition+i) )
{
arrayloc += format(ga_MenuData[arrayloc],(MAX_menudata-1-arrayloc),"%d. %s^n", i+1, ga_PlayerName[gi_MenuPosition+i])
keys |= (1<<i)
}
if( gi_TotalPlayers>(gi_MenuPosition+ )
{
arrayloc += format(ga_MenuData[arrayloc],(MAX_menudata-1-arrayloc),"^n9. More")
keys |= (1<<
}
arrayloc += format(ga_MenuData[arrayloc],(MAX_menudata-1-arrayloc),"^n0. Exit")

show_menu(id, keys, ga_MenuData, 20, "ChoosePlayer")
return PLUGIN_HANDLED
}

public ChooseMenu(id, key)
{
switch(key)
{
case 8:
{
gi_MenuPosition=gi_MenuPosition+8
ShowPlayerMenu(id)
}
case 9:
{
if(gi_MenuPosition>=
{
gi_MenuPosition=gi_MenuPosition-8
ShowPlayerMenu(id)
}
else
return 0
}
default:
{
gi_Sellection=gi_MenuPosition+key
new Now=get_systime(gi_SysTimeOffset)
set_pcvar_num(gi_LastTime, Now)

run_banvote()
return 0
}
}
return PLUGIN_HANDLED
}

public run_banvote()
{
client_cmd(0, "spk sound/ZHMusic/vote.wav")
log_amx("Vote ban started by %s for %s %s", ga_PlayerName[gi_VoteStarter], ga_PlayerName[gi_Sellection], ga_PlayerAuthID[gi_Sellection])
format(ga_MenuData,(MAX_menudata-1),"\r%s\w wants to ban \r%s\w for \r%d\w minutes^nDo you agree?^n^n\r1.\w Yes^n\r2.\w No", ga_PlayerName[gi_VoteStarter], ga_PlayerName[gi_Sellection], get_pcvar_num(gi_BanTime))
ga_Choice[0] = 0
ga_Choice[1] = 0
show_menu( 0, (1<<0)|(1<<1), ga_MenuData, 15, "VoteMenu" )
set_task(15.0,"outcom")
return 0
}

public CountVotes(id, key)
{
++ga_Choice[key]
return PLUGIN_HANDLED
}

public outcom()
{
new TotalVotes = ga_Choice[0] + ga_Choice[1]
new Float:result = (float(ga_Choice[0]) / float(TotalVotes))

if( result >= get_pcvar_float(gf_Ratio) )
{
ColorChat(0, GREY, "^x04%s^x03 The vote succeeded, %s is banned for %d minutes", prefix, ga_PlayerName[gi_Sellection], get_pcvar_num(gi_BanTime))
log_amx("The vote succeeded: %s is banned for %d minutes", ga_PlayerAuthID[gi_Sellection], get_pcvar_num(gi_BanTime))
ActualBan(gi_Sellection)
}
else
{
ColorChat(0, GREY, "^x04%s^x03 The voteban was un-successful!", prefix)
log_amx("The voteban was un-successful..")
}

ColorChat(0, GREY, "^x04%s^x03 A total of %d players, %d voted yes.", prefix, gi_TotalPlayers, ga_Choice[0])

return 0
}

public ActualBan(Selected)
{
new BanTime = get_pcvar_num ( gi_BanTime )

server_cmd("amx_ban ^"%d^" ^"%s^" ^"Votebanned^" ^"s^"", BanTime, ga_PlayerAuthID [ Selected ] )
ColorChat ( 0, GREY, "^4%s^3 >^4 %s^3 < was votebanned for >^4 %d minutes!^3 <", prefix, ga_PlayerName [ Selected ], BanTime )

return 0
}

public Startkickvote(id)
{
get_players( ga_PlayerID, gi_TotalPlayers )
for(i=0; i<gi_TotalPlayers; i++)
{

new TempID = ga_PlayerID[i]

if(TempID == id)
gi_VoteStarter=i
get_user_name( TempID, ga_PlayerName[i], 31 )
get_user_authid( TempID, ga_PlayerAuthID[i], 34 )
get_user_ip( TempID, ga_PlayerIP[i], 15, 1 )
}
gi_MenuPosition = 0
ShowKickPlayerMenu(id)
return 0
}

public ShowKickPlayerMenu(id)
{
new arrayloc = 0
new keys = (1<<9)

arrayloc = format(ga_MenuData,(MAX_menudata-1),"\yFragnation Vote Kick^nChoose Player\w ^n^n")
for(i=0; i<8; i++)
if( gi_TotalPlayers>(gi_MenuPosition+i) )
{
arrayloc += format(ga_MenuData[arrayloc],(MAX_menudata-1-arrayloc),"%d. %s^n", i+1, ga_PlayerName[gi_MenuPosition+i])
keys |= (1<<i)
}
if( gi_TotalPlayers>(gi_MenuPosition+ )
{
arrayloc += format(ga_MenuData[arrayloc],(MAX_menudata-1-arrayloc),"^n9. More")
keys |= (1<<
}
arrayloc += format(ga_MenuData[arrayloc],(MAX_menudata-1-arrayloc),"^n0. Exit")

show_menu(id, keys, ga_MenuData, 20, "ChooseKickPlayer")
return PLUGIN_HANDLED
}

public ChooseKickMenu(id, key)
{
switch(key)
{
case 8:
{
gi_MenuPosition=gi_MenuPosition+8
ShowKickPlayerMenu(id)
}
case 9:
{
if(gi_MenuPosition>=
{
gi_MenuPosition=gi_MenuPosition-8
ShowKickPlayerMenu(id)
}
else
return 0
}
default:
{
gi_Sellection=gi_MenuPosition+key
new Now=get_systime(gi_SysTimeOffset)
set_pcvar_num(gi_LastTime, Now)

run_kickvote()
return 0
}
}
return PLUGIN_HANDLED
}

public run_kickvote()
{
client_cmd(0, "spk sound/fnmusic/vote.wav")
log_amx("Vote kick started by %s for %s %s", ga_PlayerName[gi_VoteStarter], ga_PlayerName[gi_Sellection], ga_PlayerAuthID[gi_Sellection])
format(ga_MenuData,(MAX_menudata-1),"\r%s\w wants to kick \r%s\w^nDo you agree?^n^n\r1.\w Yes^n\r2.\w No", ga_PlayerName[gi_VoteStarter], ga_PlayerName[gi_Sellection])
ga_Choice[0] = 0
ga_Choice[1] = 0
show_menu( 0, (1<<0)|(1<<1), ga_MenuData, 15, "VoteKickMenu" )
set_task(15.0,"votekickgo")
return 0
}

public CountKickVotes(id, key)
{
++ga_Choice[key]
return PLUGIN_HANDLED
}

public votekickgo()
{
new TotalVotes = ga_Choice[0] + ga_Choice[1]
new Float:result = (float(ga_Choice[0]) / float(TotalVotes))

if( result >= get_pcvar_float(gf_Ratio) )
{
ColorChat(0, GREY, "^x04%s^x03 The vote succeeded, %s was kicked.", prefix, ga_PlayerName[gi_Sellection])
log_amx("The vote succeeded: %s was kicked.", ga_PlayerAuthID[gi_Sellection])
ActualKick(gi_Sellection)
}
else
{
ColorChat(0, GREY, "^x04%s^x03 The votekick was un-successful!", prefix)
log_amx("The votekick was un-successful.")
}

ColorChat(0, GREY, "^x04%s^x03 A total of %d players, %d voted yes.", prefix, gi_TotalPlayers, ga_Choice[0])

return 0
}

public ActualKick(Selected)
{
server_cmd("amx_kick ^"%s^" ^"Votekicked by %s^"", ga_PlayerAuthID[Selected], ga_PlayerName[Selected])
ColorChat ( 0, GREY, "^4%s^3 >^4 %s^3 < was votekicked!", prefix, ga_PlayerName [ Selected ] )

return 0
}
/********************************************* ****************************
*************************** START OF MAP VOTE ****************************
********************************************* *****************************/
public Startmapvote(id)
{
get_players( ga_PlayerID, gi_TotalPlayers )
for(i=0; i<gi_TotalPlayers; i++)
{

new TempID = ga_PlayerID[i]

if(TempID == id)
gi_VoteStarter=i
get_user_name( TempID, ga_PlayerName[i], 31 )
get_user_authid( TempID, ga_PlayerAuthID[i], 34 )
get_user_ip( TempID, ga_PlayerIP[i], 15, 1 )
}
gi_MenuPosition = 0
run_mapvote()
return 0
}

public run_mapvote()
{
client_cmd(0, "spk sound/fnmusic/vote.wav")
log_amx("Vote map started by %s", ga_PlayerName[gi_VoteStarter])
format(ga_MenuData,(MAX_menudata-1),"\r%s\w wants to change map!^nDo you agree?^n^n\r1.\w Yes^n\r2.\w No", ga_PlayerName[gi_VoteStarter], ga_PlayerName[gi_Sellection])
ga_Choice[0] = 0
ga_Choice[1] = 0
show_menu( 0, (1<<0)|(1<<1), ga_MenuData, 15, "VoteMapMenu" )
set_task(15.0,"GoMapResult")
return 0
}

public CountMapVotes(id, key)
{
++ga_Choice[key]
return PLUGIN_HANDLED
}

public GoMapResult()
{
new TotalVotes = ga_Choice[0] + ga_Choice[1]
new Float:result = (float(ga_Choice[0]) / float(TotalVotes))

if( result >= get_pcvar_float(gf_Ratio) )
{
ColorChat(0, GREY, "^x04%s^x03 The vote succeeded, Mapvote is starting!", prefix)
log_amx("The vote succeeded: Mapvote is starting.", ga_PlayerAuthID[gi_Sellection])
ActualMap(gi_Sellection)
}
else
{
ColorChat(0, GREY, "^x04%s^x03 The vote was un-successful!", prefix)
log_amx("The mapvote was un-successful..")
}

ColorChat(0, GREY, "^x04%s^x03 A total of %d players, %d voted yes.", prefix, gi_TotalPlayers, ga_Choice[0])
return 0
}

public ActualMap(Selected)
{
server_cmd("gal_startvote")
return 0
}

public ShowGlowMenuColor(id) {
show_menu(id, KeysGlowMenuColor, "\rGlow Menu:^n^n\r1. \yRed Glow^n\r2. \yBlue Glow^n\r3. \yGlow Yourself (Random Color)^n\r4. \yUnglow Yourself", -1, "GlowMenuColor")
}

public PressedGlowMenuColor(id, key) {
switch (key) {
case 0:
{
ShowMenuGlowRed(id, MenuPosGlowRed = 0)
}
case 1:
{
ShowMenuGlowBlue(id, MenuPosGlowBlue = 0)
}
case 2:
{
GlowYourself(id)
}
case 3:
{
UnGlowYourself(id)
}
}
}

public GlowYourself(id)
{
if( is_user_alive( id ) )
{

set_user_rendering(id, kRenderFxGlowShell, random_num( 0,255 ), random_num( 0,255 ), random_num( 0,255 ), kRenderNormal, 20 )
ColorChat(id, GREY, "^x04%s^x03 You are now glowing!", prefix )

}
return PLUGIN_HANDLED
}

public UnGlowYourself(id)
{
set_user_rendering(id)
ColorChat(id, GREY, "^x04%s^x03 You are no longer glowing!", prefix )
}

public ShowMenuGlowRed(id, position) {
if (position < 0) { return 0; }

new i, k
new MenuBody[255]
new CurrentKey = 0
new Start = position * 7
new Num
new UserName[32]

get_players(MenuPlayersGlowRed, Num, "a")
if (Start >= Num) { Start = position = MenuPosGlowRed = 0; }
new Len = format(MenuBody, 255, "\rFragnation Red Glowmenu\R%d/%d^n\w^n", position+1, (Num / 7 + ((Num % 7) ? 1 : 0 )) )
new End = Start + 7
new Keys = (1<<9)
if (End > Num) { End = Num; }

for(i=Start;i<End;i++) {
k = MenuPlayersGlowRed[i]
get_user_name(k, UserName, 31)
Keys |= (1<<CurrentKey++)
Len += format(MenuBody[Len], (255-Len), "\w%i. %s^n", CurrentKey, UserName)
}
if (End != Num) {
format(MenuBody[Len], (255-Len), "^n\w9. Next^n%s", position ? "\w0. Back" : "\w0. Exit")
Keys |= (1<<
}
else {
format(MenuBody[Len], (255-Len), "^n%s", position ? "\w0. Back" : "\w0. Exit")
}
show_menu(id, Keys, MenuBody, -1, "GlowRed")
return 0
}

public PressedGlowRed(id, key) {
switch (key) {
case 8: ShowMenuGlowRed(id, ++MenuPosGlowRed)
case 9: ShowMenuGlowRed(id, --MenuPosGlowRed)
default: {
new PlayerID = MenuPlayersGlowRed[MenuPosGlowRed * 7 + key]
new UserName[32]
get_user_name(PlayerID, UserName, 31)

set_user_rendering( PlayerID, kRenderFxGlowShell, 250, 0, 0, kRenderNormal, 20)
ColorChat(0, GREY, "^4%s^3 is now glowing red!", UserName)
}
}
return PLUGIN_HANDLED
}

public ShowMenuGlowBlue(id, position) {
if (position < 0) { return 0; }

new i, k
new MenuBody[255]
new CurrentKey = 0
new Start = position * 7
new Num
new UserName[32]

get_players(MenuPlayersGlowBlue, Num, "a")
if (Start >= Num) { Start = position = MenuPosGlowBlue = 0; }
new Len = format(MenuBody, 255, "\rBlue Glowmenu\R%d/%d^n\w^n", position+1, (Num / 7 + ((Num % 7) ? 1 : 0 )) )
new End = Start + 7
new Keys = (1<<9)
if (End > Num) { End = Num; }

for(i=Start;i<End;i++) {
k = MenuPlayersGlowBlue[i]
get_user_name(k, UserName, 31)
Keys |= (1<<CurrentKey++)
Len += format(MenuBody[Len], (255-Len), "\w%i. %s^n", CurrentKey, UserName)
}
if (End != Num) {
format(MenuBody[Len], (255-Len), "^n\w9. Next^n%s", position ? "\w0. Back" : "\w0. Exit")
Keys |= (1<<
}
else {
format(MenuBody[Len], (255-Len), "^n%s", position ? "\w0. Back" : "\w0. Exit")
}
show_menu(id, Keys, MenuBody, -1, "GlowBlue")
return 0
}

public PressedGlowBlue(id, key) {
switch (key) {
case 8: ShowMenuGlowBlue(id, ++MenuPosGlowBlue)
case 9: ShowMenuGlowBlue(id, --MenuPosGlowBlue)
default: {
new PlayerID = MenuPlayersGlowBlue[MenuPosGlowBlue * 7 + key]
new UserName[32]
get_user_name(PlayerID, UserName, 31)

set_user_rendering( PlayerID, kRenderFxGlowShell, 0, 0, 250, kRenderNormal, 20)
ColorChat(0, GREY, "^4%s^3 is now glowing blue!", UserName)
}
}
return PLUGIN_HANDLED
}

Last edited by YamiKaitou; 05-14-2014 at 08:17.
Bloods is offline
Reply



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 09:35.


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