Raised This Month: $ Target: $400
 0% 

need help with seeting CVARS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 11-10-2005 , 07:04   need help with seeting CVARS
Reply With Quote #1

Was putting a script together to set CVARS when i types amx_surf...didn't know exactly wat to do with the cvars though....

Code:
#include <amxmodx> #include <amxmisc> #include <fun> public plugin_init() {     register_srvcmd("amx_surf","cmd_surf",ADMIN_LEVEL_B,"<Surf Enabled>")     register_srvcmd("surf_config","cmd_surf",ADMIN_LEVEL_B,"<Surf Enabled>") } public cmd_surf(id, level, cid) {     if ( !cmd_access( id, level, cid, 2 ) )         return PLUGIN_HANDLED;             amx_cvar sv_accelerate 100     amx_cvar sv_airaccelerate 800     amx_cvar sv_gravity 800 } {     client_print(0, print_chat, "[AMXX]Surf Mode Enabled");     return PLUGIN_HANDLED; }

THX
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 11-10-2005 , 07:08  
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?go=func&id=242
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 11-10-2005 , 08:10  
Reply With Quote #3

OK so this?

Code:
#include <amxmodx>   #include <amxmisc>   #include <fun>   public plugin_init() {     register_srvcmd("amx_surf","cmd_surf",ADMIN_LEVEL_B,"<Surf Enabled>")     register_srvcmd("surf_config","cmd_surf",ADMIN_LEVEL_B,"<Surf Enabled>") } public cmd_surf(id, level, cid) {     if ( !cmd_access( id, level, cid, 2 ) )         return PLUGIN_HANDLED;               set_cvar_num ( const sv_accelerate [],100 )     set_cvar_num ( const sv_airaccelerate [],800 )     set_cvar_num ( const sv_gravity [],800 ) } {     client_print(0, print_chat, "[AMXX]Surf Mode Enabled");       return PLUGIN_HANDLED;   }
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 11-10-2005 , 08:14  
Reply With Quote #4

Nope. When you see ( const String[] , ....) it just means you put a string in there.
Code:
 #include <amxmodx>   #include <amxmisc>   #include <fun>   public plugin_init()   {       register_srvcmd("amx_surf","cmd_surf",ADMIN_LEVEL_B,"<Surf Enabled>")       register_srvcmd("surf_config","cmd_surf",ADMIN_LEVEL_B,"<Surf Enabled>")   }   public cmd_surf(id, level, cid)   {       if ( !cmd_access( id, level, cid, 2 ) )           return PLUGIN_HANDLED;                 set_cvar_num ( "sv_accelerate",100 )     set_cvar_num ( "sv_airaccelerate",800 )     set_cvar_num ( "sv_gravity",800 ) }   {       client_print(0, print_chat, "[AMXX]Surf Mode Enabled");       return PLUGIN_HANDLED;   }
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 11-10-2005 , 15:59  
Reply With Quote #5

/home/users/amxmodx/tmp3/textcLOqLY.sma(19) : warning 209: function "cmd_surf" should return a value
/home/users/amxmodx/tmp3/textcLOqLY.sma(20) : error 055: start of function body without function header
/home/users/amxmodx/tmp3/textcLOqLY.sma(22) : error 010: invalid function or declaration
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Zenith77
Veteran Member
Join Date: Aug 2005
Old 11-10-2005 , 16:05  
Reply With Quote #6

You cant just place ' { ' in places :p ( Not sure if your new at this )


Code:
#include <amxmodx>   #include <amxmisc>   #include <fun>   public plugin_init()   {       register_srvcmd("amx_surf","cmd_surf",ADMIN_LEVEL_B,"<Surf Enabled>")       register_srvcmd("surf_config","cmd_surf",ADMIN_LEVEL_B,"<Surf Enabled>")   }   public cmd_surf(id, level, cid)   {       if ( !cmd_access( id, level, cid, 2 ) )           return PLUGIN_HANDLED;                 set_cvar_num ( "sv_accelerate",100 )     set_cvar_num ( "sv_airaccelerate",800 )     set_cvar_num ( "sv_gravity",800 )     client_print(0, print_chat, "[AMXX]Surf Mode Enabled");       return PLUGIN_HANDLED;   }
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-10-2005 , 20:33  
Reply With Quote #7

brb

EDIT:

http://forums.alliedmods.net/showthread.php?p=138464
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
SweatyBanana
BANNED
Join Date: Sep 2005
Location: LOL
Old 11-10-2005 , 20:56  
Reply With Quote #8

tried that be4...couldnt get it to work...
SweatyBanana is offline
Send a message via AIM to SweatyBanana Send a message via Yahoo to SweatyBanana
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-10-2005 , 21:13  
Reply With Quote #9

The 1.60 compiler for the site is broken, download the already compiled package.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 05-27-2013 , 10:24   Re: need help with seeting CVARS
Reply With Quote #10

Why ADMIN_LEVEL_B?
register_srvcmd("amx_surf","cmd_surf",ADMIN_LEVEL_B,"<Surf Enabled>")

SrvCmd can be executed only from server console (hlds console / amx_rcon / rcon)? Or not?
__________________
sorry my bad english...
alonelive 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 13:00.


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