Raised This Month: $ Target: $400
 0% 

Movement


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-30-2009 , 10:34   Movement
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN "Reload Radio MSG"
#define VERSION "1.0"
#define AUTHOR "One"

new const gRadioCommands[][] = 
{
    
    
"+back; wait; wait; -back; wait",
    
"+moveleft; wait; wait; -moveleft; wait",
    
"+moveright; wait; wait; -moveright; wait",
    
"+forward; wait; wait; -forward; wait",
    
"+duck; wait; -duck; wait; +jump; wait; -jump; wait"
};

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forwardFM_PlayerPreThink"client_prethink" )
}
public 
client_prethink(id)
{
    new 
button pev(id,pev_button)
 
    if(
button IN_FORWARD)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    if(
button IN_BACK)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    if(
button IN_MOVELEFT)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    if(
button IN_MOVERIGHT)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }

the problem :if user use for example +forward, hey will be moved for example "+back; wait; wait; -back; wait". but the problem is, in this script, is again move back command & this willbe move player random & again & again & again.

if +forward use, will be used "+back; wait; wait; -back; wait" & if +back, will be used another script & by another script is the same
i hope you know what i mean (( is there anyway to fix this?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-30-2009 , 13:27   Re: Movement
Reply With Quote #2

What is the purpose of this? Also, is there a reason why you cant set a minuscule velocity?
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-30-2009 , 13:34   Re: Movement
Reply With Quote #3

Quote:
Originally Posted by Emp` View Post
What is the purpose of this? Also, is there a reason why you cant set a minuscule velocity?
this works..

problem :

imagin, you press W to go forward. this changed your +forward to my script.imaging this willbe replaced to +moveleft!

but in plugin is already a replace for +moveleft & this will active if(button & IN_MOVELEFT)!!

so your new moveleft willbe replaced with random cmd. example +moveright & again your +moveright willbe replaced with another & another & another...
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-30-2009 , 13:58   Re: Movement
Reply With Quote #4

I realize what your problem is, but what are you trying to solve? There is most likely a better way to do whatever you are trying to do.

If you really really want to do it this way though, you can create a command, within the command set a global variable for the player to 1 or 0 (depending on what it already is), then within the prethink, if the global for the player is set to 1 ignore it. You would then also have to add the command before and after your gRadioCommands.

But that would be really silly...
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-30-2009 , 14:09   Re: Movement
Reply With Quote #5

Quote:
Originally Posted by Emp` View Post
I realize what your problem is, but what are you trying to solve? There is most likely a better way to do whatever you are trying to do.

If you really really want to do it this way though, you can create a command, within the command set a global variable for the player to 1 or 0 (depending on what it already is), then within the prethink, if the global for the player is set to 1 ignore it. You would then also have to add the command before and after your gRadioCommands.

But that would be really silly...


could u give me a code or example for start? cuz i cant imaging how to code that what u said
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-30-2009 , 14:12   Re: Movement
Reply With Quote #6

Nope, I'm not that silly.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 03-30-2009 , 14:14   Re: Movement
Reply With Quote #7

But i need this its bull shit if its silly or not ( damn.i´m thinking about this but no idea
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-03-2009 , 19:03   Re: Movement
Reply With Quote #8

nobody any ideas?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 04-04-2009 , 08:56   Re: Movement
Reply With Quote #9

PHP Code:
public client_prethink(id)
{
    if (
moving[id]) return;
    
    new 
button pev(id,pev_button)
 
    if(
button IN_FORWARD)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    if(
button IN_BACK)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    if(
button IN_MOVELEFT)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    if(
button IN_MOVERIGHT)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    
    
moving[id] = true;
    
set_task(x,reset,id)
}  

public 
reset(id)
{
    
moving[id] = false;

Something like this.
You'll have to find x in "set_task(x,reset,id)" by yourself (x is a delay before reset, float). Good luck!
__________________

SonicSonedit is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-04-2009 , 10:06   Re: Movement
Reply With Quote #10

Quote:
Originally Posted by SonicSonedit View Post
PHP Code:
public client_prethink(id)
{
    if (
moving[id]) return;
    
    new 
button pev(id,pev_button)
 
    if(
button IN_FORWARD)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    if(
button IN_BACK)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    if(
button IN_MOVELEFT)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    if(
button IN_MOVERIGHT)
    {
        
client_cmd(id,"%s"gRadioCommandsrandom_num0charsmaxgRadioCommands ) ) ] );
    }
    
    
moving[id] = true;
    
set_task(x,reset,id)
}  

public 
reset(id)
{
    
moving[id] = false;

Something like this.
You'll have to find x in "set_task(x,reset,id)" by yourself (x is a delay before reset, float). Good luck!
omg, this sounds awesome. i try this. i hope this wi work. Ty
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 08:52.


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