Raised This Month: $32 Target: $400
 8% 

WHYY!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-21-2004 , 11:02   WHYY!
Reply With Quote #1

alright, im still trying to get maxspeed to work, but it wont! Heres my code:

Code:
/* *    Pistol Arena by Knekter2000 (c) 2004 *    This file is provided as is (no warranties). * *    Commands: * *    amx_arena <on | off> will enable/disable Pistol Arena * *    Cvars: * *    arena_lowgrav <1=on | 0=off> *    arena_glow <1=on | 0=off> *    arena_health <amount> *    arena_respawn <1=on | 0=off> *    arena_speed <1=on | 0=off> * *    Info: * *    When you turn the arena on the round will restart.  Everyone *    will get every pistol in the game with full ammo.  If you die  *    you will imediatley respawn.  Also, everyone will get a grenade, *    200 HP, low gravity, and will start to glow.  This will continue *    every new round until amx_arena is set to off.  Have Fun! * *    Change Log: * *    V0.3 - added cvar arena_speed *    V0.2 - added cvars to ENABLE/DISABLE fun commands *    V0.1 - plugin release */ //////////////////// #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> //////////////////// new bool:ArenaOn = false //////////////////// public plugin_init() {     register_plugin("Insane Pistol Arena","0.3","Knekter2000")     register_clcmd("amx_arena","amx_arena",ADMIN_KICK,"amx_arena: <on |off>")     register_logevent("StartRound",2,"1=Round_Start")     register_event("DeathMsg","death_msg","a")     register_cvar("arena_lowgrav","1")     register_cvar("arena_glow","1")     register_cvar("arena_health","200")     register_cvar("arena_respawn","1")     register_cvar("arena_speed","1") } public amx_arena(id) {     if(!(get_user_flags(id)&ADMIN_KICK))  // checks if user has ACCESS ADMIN_KICK     {     client_print(id,print_chat,"[AMX] You Have No Access To This Command")     return PLUGIN_HANDLED     }     if(read_argc()<2)  // reads if number of arguments are less than 2     {     new onoff[4]     if(ArenaOn == true)  // if the arena is on, display ON, else display OFF     {         copy(onoff,4,"ON")     }     else     {         copy(onoff,4,"OFF")     }     client_print(id,print_chat,"[AMX] Usage: amx_arena <on | off>")     return PLUGIN_HANDLED     }     new arg[10]     read_argv(1,arg,10)     if((equal(arg,"on",2)) || (equal(arg,"1",1)))  // if the argument is on or 1 turn arena on     {         ArenaOn = true         set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 1.0, 5.0, 0.1, 0.2, 4)         show_hudmessage(0,"ADMIN has ENABLED Pistol Arena!")     set_cvar_num("mp_freezetime",0)         set_cvar_num("sv_restart",5)     if(get_cvar_num("arena_speed")==1)     {         set_cvar_num("sv_maxspeed",1000)             return PLUGIN_CONTINUE     }         return PLUGIN_HANDLED     }     else  // else turn if argument isn't ON or 1 turn arena off     {     ArenaOn = false         set_cvar_num("mp_freezetime",5)     set_hudmessage(0, 255, 0, -1.0, 0.3, 0, 1.0, 5.0, 0.1, 0.2, 4)         show_hudmessage(0,"ADMIN has DISABLED Pistol Arena!")         set_cvar_num("sv_restart",5)     set_cvar_num("sv_maxspeed",320)     return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } public StartRound()  // called at start of new round {     if(ArenaOn == true)  // if arena is on start the commands below     {     new players[32], numberofplayers, i, cur_id  // gets number of players in server         get_players(players,numberofplayers)         // and use the commands below on them         for (i=0;i<numberofplayers;i++)         {         cur_id = players[i]             if(get_cvar_num("arena_glow")==1)         {           new red = random_num(50,255)  // randomizes the color red                 new green = random_num(50,255)  // randomizes the color green                 new blue = random_num(50,255)  // randomizes the color blue             set_user_rendering(cur_id,kRenderFxGlowShell,red,green,blue,kRenderNormal,16)             return PLUGIN_CONTINUE         }             client_cmd(cur_id,"drop weapon_shield")  // if they have a shield it will drop it             cs_set_user_money(cur_id,0)  // set their money to 0             give_item(cur_id,"weapon_deagle")             give_item(cur_id,"ammo_50ae")             give_item(cur_id,"ammo_50ae")              give_item(cur_id,"ammo_50ae")                  give_item(cur_id,"ammo_50ae")                  give_item(cur_id,"ammo_50ae")                  give_item(cur_id,"ammo_50ae")                    give_item(cur_id,"ammo_50ae")                      give_item(cur_id,"weapon_glock18")                    give_item(cur_id,"ammo_9mm")                      give_item(cur_id,"ammo_9mm")                      give_item(cur_id,"ammo_9mm")                      give_item(cur_id,"ammo_9mm")                      give_item(cur_id,"ammo_9mm")                      give_item(cur_id,"ammo_9mm")                      give_item(cur_id,"ammo_9mm")                      give_item(cur_id,"ammo_9mm")                      give_item(cur_id,"weapon_usp")                    give_item(cur_id,"ammo_45acp")                      give_item(cur_id,"ammo_45acp")                      give_item(cur_id,"ammo_45acp")                      give_item(cur_id,"ammo_45acp")                      give_item(cur_id,"ammo_45acp")                      give_item(cur_id,"ammo_45acp")                      give_item(cur_id,"ammo_45acp")                      give_item(cur_id,"ammo_45acp")                      give_item(cur_id,"weapon_p228")                    give_item(cur_id,"ammo_357sig")                give_item(cur_id,"ammo_357sig")                give_item(cur_id,"ammo_357sig")                give_item(cur_id,"ammo_357sig")                  give_item(cur_id,"ammo_357sig")                  give_item(cur_id,"ammo_357sig")                    give_item(cur_id,"weapon_fiveseven")                give_item(cur_id,"ammo_57mm")                give_item(cur_id,"ammo_57mm")                give_item(cur_id,"ammo_57mm")                give_item(cur_id,"ammo_57mm")                  give_item(cur_id,"weapon_elite")              give_item(cur_id,"ammo_9mm")                    give_item(cur_id,"ammo_9mm")                    give_item(cur_id,"ammo_9mm")                    give_item(cur_id,"ammo_9mm")                    give_item(cur_id,"item_assaultsuit")         give_item(cur_id,"weapon_hegrenade")         if(get_cvar_num("arena_speed")==1)         {             set_user_maxspeed(cur_id,1000)  // sets users maxspeed             client_cmd(cur_id,"cl_forwardspeed 1000")  // sets users forward speed             client_cmd(cur_id,"cl_sidespeed 1000")  // sets users sidespeed             client_cmd(cur_id,"cl_backspeed 1000")  // sets users backspeed             return PLUGIN_CONTINUE         }         set_user_health(cur_id,get_cvar_num("arena_health"))  // set their health             if(get_cvar_num("arena_lowgrav")==1)         {             set_user_gravity(cur_id,0.5)  // lowers their gravity         return PLUGIN_CONTINUE         }         }         return PLUGIN_HANDLED     }     return PLUGIN_HANDLED } public death_msg() {     if(ArenaOn == true && get_cvar_num("arena_respawn")==1)     {         new vIndex = read_data(2)         spawn(vIndex)  // will respawn the player if he dies     spawn(vIndex)         return PLUGIN_CONTINUE     }     return PLUGIN_HANDLED }

WHATS WRONG! and why the f*** does it mess up my identations!
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-21-2004 , 11:11  
Reply With Quote #2

took this out, was too big....
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
[RED-Designs]
Senior Member
Join Date: Mar 2004
Location: .us
Old 03-21-2004 , 11:22  
Reply With Quote #3

Quote:
Originally Posted by knekter
LOOk at my idents here:



LOL

Indents dont stop it from compiling, they are just warnings of bad coding
__________________
.My personal Blog
."If the country were open on its borders, new
forms would certainly immigrate, and this also
would seriously disturb the relations of some
of the former inhabitants." - Charles Darwin
[RED-Designs] is offline
Send a message via AIM to [RED-Designs] Send a message via MSN to [RED-Designs] Send a message via Yahoo to [RED-Designs]
BAILOPAN
Join Date: Jan 2004
Old 03-21-2004 , 11:24  
Reply With Quote #4

I would one of the 3,000 editors better than notepad.

If set_user_maxspeed doesn't work, it will in the next release because I added some stuff to it. But I will note it takes a float not an integer. Do this instead:

Code:
set_user_maxspeed(id, float(1000))
__________________
egg
BAILOPAN is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-21-2004 , 12:01   new problem...
Reply With Quote #5

now when the round restarts, it won't give anyone the pistols..... It restarts, people start to glow, then no pistols, no client_cmds WTF IS GOING WRONG?
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
|Mike|
Junior Member
Join Date: Mar 2004
Location: Minnesota
Old 03-26-2004 , 21:00  
Reply With Quote #6

ok im really not sure if this will help at all, but one thing you could try is changing
Code:
register_logevent("StartRound",2,"1=Round_Start")
to
Code:
register_event("ResetHUD","StartRound","b","1=1")

i really have no idea if that will help you... first thing that comes to mind tho

EDIT:

one more thing, if i know anything about coding (which i really dont, im seriously stupid and i hate me for it) it might work if you change
Code:
cur_id = players[i]
to
Code:
cur_id = i
but again just a hopeful guess... im probably wrong
__________________
-Mike, a.k.a. retard (no im not a real retard)
|Mike| is offline
Send a message via AIM to |Mike|
|Mike|
Junior Member
Join Date: Mar 2004
Location: Minnesota
Old 03-26-2004 , 21:17  
Reply With Quote #7

nm nm nm im stupid ignore that
__________________
-Mike, a.k.a. retard (no im not a real retard)
|Mike| is offline
Send a message via AIM to |Mike|
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 03-27-2004 , 08:23   LOL
Reply With Quote #8

its okay, the log_event is much more efficient then using the event ResetHUD in my opinion, but everyone likes it their own way.
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
|Mike|
Junior Member
Join Date: Mar 2004
Location: Minnesota
Old 03-27-2004 , 13:34  
Reply With Quote #9

yup, hence me = retard
__________________
-Mike, a.k.a. retard (no im not a real retard)
|Mike| is offline
Send a message via AIM to |Mike|
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 12:41.


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