Raised This Month: $ Target: $400
 0% 

curweapon+ maxspeed help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
atomic
Veteran Member
Join Date: Jan 2005
Location: What The Foot?
Old 10-20-2005 , 17:11   curweapon+ maxspeed help
Reply With Quote #1

why wont this work?
Code:
 /* Ice Skating Wars plugin! What does it do?: It will change the players friction so that it feels like you are walking in ice! Commands: amx_icewars <1|0> "Activates the plugin" Cvars: amx_friction < 1.0 is default and 0.1 is totally slippy> amx_ice_maxspeed <sets the maxspeed that will  be activated> UPDATE: added INCREDIBLE speed The plugin will be reset every round */  #include <amxmodx>   #include <amxmisc>   #include <engine>   #include <fun>   new iceskate new gCurrentWeapon[33]   public plugin_init() {       register_plugin("Ice skating wars", "1.0", "AtomiC")       register_clcmd ("amx_icewars", "icewars", ADMIN_LEVEL_A,"<1|0>")       register_cvar("amx_friction","0.1")       register_cvar("amx_ice_maxspeed","1000.0")     register_event("CurWeapon","weapon_switch","be","1=1") }   public icewars (id,level,cid)   {       if (!cmd_access(id,level,cid,2))           return PLUGIN_HANDLED       new arg[8] , a     read_argv(1,arg,7)       iceskate = str_to_num(arg)       if(iceskate == 1)         {           new players[32], inum           get_players(players,inum)           for(a = 0; a < inum; a++)           {             entity_set_float(players[a], EV_FL_friction, get_cvar_float("amx_friction"))             set_user_maxspeed (players[a], get_cvar_float("amx_ice_maxspeed"))         }         set_hudmessage(222, 70,0, -1.0, 0.3, 1, 10.0, 10.0, 2.0, 4.0, 8)         show_hudmessage(0,"Ice skating wars is now on")       server_cmd ("sv_maxspeed 1000")     }       if(iceskate == 0)     {           new players[32], inum           get_players(players,inum)           for(a = 0; a < inum; a++)           {             entity_set_float(players[a], EV_FL_friction, 1.0)               set_user_maxspeed (players[a], 250.0)         }         set_hudmessage(222, 70,0, -1.0, 0.3, 1, 10.0, 10.0, 2.0, 4.0, 8)           show_hudmessage(0,"Ice skating wars is now off")       }       return PLUGIN_HANDLED   }   public round_start() {       if(iceskate == 1)     {           entity_set_float(0, EV_FL_friction, 1.0)         set_user_maxspeed (0, 250.0)         iceskate = 0     }     return PLUGIN_CONTINUE   }    public client_connect( id ) {   client_cmd(id, "cl_forwardspeed 1000");   client_cmd(id, "cl_sidespeed 1000");   client_cmd(id, "cl_backspeed 1000"); }   public weapon_switch(id) //this code {     new arg[8] , a     read_argv(1,arg,7)       iceskate = str_to_num(arg)      if(iceskate == 1)    }    new Float:maxSpeed = get_cvar_float("amx_ice_maxspeed");    new weaponid = read_data(2)    if(gCurrentWeapon[id] != weaponid) {       gCurrentWeapon[id] = weaponid       set_user_maxspeed(id,maxSpeed)    } } }
__________________
atomic is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 10-20-2005 , 17:27  
Reply With Quote #2

I believe you want this:
Code:
iceskate = get_cvar_num("amx_icewars");
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 10-20-2005 , 17:50  
Reply With Quote #3

Quote:
Originally Posted by v3x
I believe you want this:
Code:
iceskate = get_cvar_num("amx_icewars");
There's no cvar amx_icewars.

Heres corrected code
Code:
public weapon_switch(id) //this code {    if(iceskate == 1)    {        new Float:maxSpeed = get_cvar_float("amx_ice_maxspeed");        new weaponid = read_data(2)        if(gCurrentWeapon[id] != weaponid) {           gCurrentWeapon[id] = weaponid           set_user_maxspeed(id,maxSpeed)        }     } }
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
atomic
Veteran Member
Join Date: Jan 2005
Location: What The Foot?
Old 10-20-2005 , 18:11  
Reply With Quote #4

nope...they can still get maxspeed 1000 when they change weapon after round start (the plugin is supposed to go back to normal each round)
__________________
atomic is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 10-20-2005 , 18:17  
Reply With Quote #5

Quote:
Originally Posted by atomic
nope...they can still get maxspeed 1000 when they change weapon after round start (the plugin is supposed to go back to normal each round)
Oh..if thats the problem add
Code:
else     set_user_maxspeed(id , 0.0);
after you close the if statement.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
atomic
Veteran Member
Join Date: Jan 2005
Location: What The Foot?
Old 10-20-2005 , 18:19  
Reply With Quote #6

0.0 is stuck right?

EDIT:if statement where? in round start? or weapon switch
__________________
atomic is offline
atomic
Veteran Member
Join Date: Jan 2005
Location: What The Foot?
Old 10-20-2005 , 18:29  
Reply With Quote #7

Code:
 /* Ice Skating Wars plugin! What does it do?: It will change the players friction so that it feels like you are walking in ice! Commands: amx_icewars <1|0> "Activates the plugin" Cvars: amx_friction < 1.0 is default and 0.1 is totally slippy> amx_ice_maxspeed <sets the maxspeed that will  be activated> UPDATE: added INCREDIBLE speed The plugin will be reset every round */  #include <amxmodx>   #include <amxmisc>   #include <engine>   #include <fun>   new iceskate new gCurrentWeapon[33]   public plugin_init() {       register_plugin("Ice skating wars", "1.0", "AtomiC")       register_clcmd ("amx_icewars", "icewars", ADMIN_LEVEL_A,"<1|0>")       register_cvar("amx_friction","0.1")       register_cvar("amx_ice_maxspeed","1000.0")     register_event("CurWeapon","weapon_switch","be","1=1") }   public icewars (id,level,cid)   {       if (!cmd_access(id,level,cid,2))           return PLUGIN_HANDLED       new arg[8] , a     read_argv(1,arg,7)       iceskate = str_to_num(arg)       if(iceskate == 1)         {           new players[32], inum           get_players(players,inum)           for(a = 0; a < inum; a++)           {             entity_set_float(players[a], EV_FL_friction, get_cvar_float("amx_friction"))             set_user_maxspeed (players[a], get_cvar_float("amx_ice_maxspeed"))         }         set_hudmessage(222, 70,0, -1.0, 0.3, 1, 10.0, 10.0, 2.0, 4.0, 8)         show_hudmessage(0,"Ice skating wars is now on")       server_cmd ("sv_maxspeed 1000")     }       if(iceskate == 0)     {           new players[32], inum           get_players(players,inum)           for(a = 0; a < inum; a++)           {             entity_set_float(players[a], EV_FL_friction, 1.0)               set_user_maxspeed (players[a], 250.0)         }         set_hudmessage(222, 70,0, -1.0, 0.3, 1, 10.0, 10.0, 2.0, 4.0, 8)           show_hudmessage(0,"Ice skating wars is now off")       }       return PLUGIN_HANDLED   }   public round_start() {       if(iceskate == 1)     {             entity_set_float(0, EV_FL_friction, 1.0)         set_user_maxspeed (0, 250.0)         iceskate == 0  // HERE-------------------------------------     }     return PLUGIN_CONTINUE   }    public client_connect( id ) {   client_cmd(id, "cl_forwardspeed 1000");   client_cmd(id, "cl_sidespeed 1000");   client_cmd(id, "cl_backspeed 1000"); }  public weapon_switch(id)   {      if(iceskate == 1)    {        new Float:maxSpeed = get_cvar_float("amx_ice_maxspeed");        new weaponid = read_data(2)          if(gCurrentWeapon[id] != weaponid) {             gCurrentWeapon[id] = weaponid             set_user_maxspeed(id,maxSpeed)          }       } }

Code:
/home/users/amxmodx/tmp3/textCA4OyW.sma(69 -- 70) : warning 215: expression has no effect
maybe this is the problem?
__________________
atomic is offline
WaZZeR++
Veteran Member
Join Date: Mar 2005
Location: Sweden
Old 10-20-2005 , 18:54  
Reply With Quote #8

Code:
iceskate == 0

sould only have one =, you use two when you compare numbers...
WaZZeR++ is offline
Send a message via MSN to WaZZeR++
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-20-2005 , 19:29  
Reply With Quote #9

Quote:
Originally Posted by atomic
0.0 is stuck right?
0.0 is regular speed, use 1.0 for stuck.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-20-2005 , 20:17  
Reply With Quote #10

i thought it was 0.1 ?


** EDIT **

Quote:
If you set a user's maxspeed to 0.0 they will be able to run normal speed. Set it to 0.1 if you wish to stop them from moving completely.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 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 23:45.


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