Raised This Month: $ Target: $400
 0% 

Speeeeeed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-12-2010 , 07:45   Speeeeeed
Reply With Quote #1

So i don't know how do person run faster.
I try set_maxpseed but person only stay in spot and don't move (he's can't move).
So i wanna your help
-EDIT-
Okey i solved that problem but when i run fast and change a weapon speed is gone!

Last edited by zirualas; 08-12-2010 at 07:54.
zirualas is offline
Send a message via Skype™ to zirualas
DaxProxy
Senior Member
Join Date: Sep 2007
Old 08-12-2010 , 08:12   Re: Speeeeeed
Reply With Quote #2

Hook weapon change event, and change speed there...
__________________

Want ApolloRP for Counter-Strike? Show your support: http://forums.alliedmods.net/showthr...39#post1264739
DaxProxy is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-12-2010 , 08:49   Re: Speeeeeed
Reply With Quote #3

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

public plugin_init()
    
register_event("CurWeapon""Event_CurWeapon""be");

public 
Event_CurWeapon(id)
{
    if(
is_user_alive(id))
        
set_user_maxspeed(id, <speed here>);

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-12-2010 , 09:21   Re: Speeeeeed
Reply With Quote #4

I use another code
PHP Code:
        new Float:speed get_user_maxspeed(id) + 500.0;
        
set_user_maxspeed(id speed); 
zirualas is offline
Send a message via Skype™ to zirualas
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-12-2010 , 09:44   Re: Speeeeeed
Reply With Quote #5

Quote:
Originally Posted by zirualas View Post
I use another code
PHP Code:
        new Float:speed get_user_maxspeed(id) + 500.0;
        
set_user_maxspeed(id speed); 
Then why would you ask for help?
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Kreation
Veteran Member
Join Date: Jan 2010
Location: Illinois
Old 08-12-2010 , 09:44   Re: Speeeeeed
Reply With Quote #6

Just use that how drekes showed you with CurWeapon.
__________________
Hi.
Kreation is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-12-2010 , 09:47   Re: Speeeeeed
Reply With Quote #7

I do something wrong?
My code:
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <colorchat>
#include <fun>

#define PLUGIN "Fun Buy"
#define VERSION "1.0"
#define AUTHOR "ZiruAl"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd"say /funbuy""FunBuy" );
    
register_clcmd"say_team /funbuy""FunBuy" );
    
register_event("CurWeapon""Event_CurWeapon""be");

public 
Event_CurWeapon(id)
{
    if(
is_user_alive(id))
        
set_user_maxspeed(id700);
}  

}
    public  
plugin_precache ( )
    {
    
precache_model("models/player/gign/gign.mdl")
    
precache_model("models/player/guerilla/guerilla.mdl")
    
precache_model("models/player/sas/sas.mdl")
    
precache_model("models/player/terror/terror.mdl")
    
precache_model("models/player/leet/leet.mdl")
    
precache_model("models/player/gsg9/gsg9.mdl")

    }

public 
FunBuy(id)
{
    new 
menu menu_create("\gFun Buy Menu:""menu_handler");

    
menu_additem(menu"\w Low Gravity - \r4000""1"0);
    
menu_additem(menu"\w Buy C4 - \r16000""2"0);
    
menu_additem(menu"\w CT skin - \r14500""3"0);
    
menu_additem(menu"\w T skin - \r14500""4"0);
    
menu_additem(menu"\w Speed - \r4000""5"0);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0);
}

public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
acesscallback;

    
menu_item_getinfo(menuitemacessdata,6iName63callback);
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
//gravity
        
{
            new 
name[32];
            
            if (
cs_get_user_money(id) < 4000)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 4000 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a gravitation"name)
                
set_user_gravity(id0.5)
                
cs_set_user_money(id cs_get_user_money(id) - 40000)
            }
        }
        case 
:
        {
            new 
name[32];
            
            if (
cs_get_user_money(id) < 16000)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 16000 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a C4"name)
                
give_item(id"weapon_c4")
        
cs_set_user_plant(id11)
                
cs_set_user_money(id cs_get_user_money(id) - 160000)
            }
        }
        case 
:
        {
            new 
name[32];
            
            if (
cs_get_user_money(id) < 14500)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 14500 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a CT skin"name)
                
cs_set_user_model(id"gign")
                
cs_set_user_model(id"sas")
                
cs_set_user_model(id"sas")
                
cs_set_user_money(id cs_get_user_money(id) - 145000)
            }
        }
        case 
:
        {
            new 
name[32];
            
            if (
cs_get_user_money(id) < 14500)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 14500 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a T skin"name)
                
cs_set_user_model(id"guerilla")
                
cs_set_user_model(id"terror")
                
cs_set_user_model(id"leet")
                
cs_set_user_money(id cs_get_user_money(id) - 145000)
            }
        }
        case 
:
        {
            new 
name[32];
            
            if (
cs_get_user_money(id) < 4000)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 4000 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a T skin"name)
        new 
Float:speed get_user_maxspeed(id) + 500.0;
        
set_user_maxspeed(id speed); 
                
cs_set_user_money(id cs_get_user_money(id) - 40000)
            }
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 
My error:
PHP Code:
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// testas.sma
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(1
8) : warning 217loose indentation
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(1
8) : error 029invalid expressionassumed zero
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(1
8) : error 017undefined symbol "Event_CurWeapon"
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
0) : error 017undefined symbol "id"
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
1) : error 017undefined symbol "id"
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
1) : warning 217loose indentation
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
1) : error 017undefined symbol "here"
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
1) : error 029invalid expressionassumed zero
// C:\Program Files\Counter-strike\cstrike\addons\amxmodx\scripting\testas.sma(2
1) : fatal error 107too many error messages on one line
//
// Compilation aborted.
// 7 Errors.
// Could not locate output file C:\Program Files\Counter-strike\cstrike\addons\a
mxmodx\scripting\compiled\testas.amx (compile failed).
//
// Compilation Time: 0.06 sec
// ----------------------------------------

Press enter to exit ... 

Last edited by zirualas; 08-12-2010 at 10:13.
zirualas is offline
Send a message via Skype™ to zirualas
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-12-2010 , 10:40   Re: Speeeeeed
Reply With Quote #8

PHP Code:
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_clcmd"say /funbuy""FunBuy" );
    
register_clcmd"say_team /funbuy""FunBuy" );
    
register_event("CurWeapon""Event_CurWeapon""be");
}
public 
Event_CurWeapon(id)
{
    if(
is_user_alive(id))
    {
        new 
Float:speed get_user_maxspeed(id) + 500.0;
        
set_user_maxspeed(id speed); 
    }
}  

public  
plugin_precache ( )
{
    
precache_model("models/player/gign/gign.mdl")
    
precache_model("models/player/guerilla/guerilla.mdl")
    
precache_model("models/player/sas/sas.mdl")
    
precache_model("models/player/terror/terror.mdl")
    
precache_model("models/player/leet/leet.mdl")
    
precache_model("models/player/gsg9/gsg9.mdl")

}

public 
FunBuy(id)
{
    new 
menu menu_create("\gFun Buy Menu:""menu_handler");

    
menu_additem(menu"\w Low Gravity - \r4000""1"0);
    
menu_additem(menu"\w Buy C4 - \r16000""2"0);
    
menu_additem(menu"\w CT skin - \r14500""3"0);
    
menu_additem(menu"\w T skin - \r14500""4"0);
    
menu_additem(menu"\w Speed - \r4000""5"0);

    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0);
}

public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
acesscallback;

    
menu_item_getinfo(menuitemacessdata,6iName63callback);
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
//gravity
        
{
            new 
name[32];
            
            if (
cs_get_user_money(id) < 4000)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 4000 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a gravitation"name)
                
set_user_gravity(id0.5)
                
cs_set_user_money(id cs_get_user_money(id) - 40000)
            }
        }
        case 
:
        {
            new 
name[32];
            
            if (
cs_get_user_money(id) < 16000)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 16000 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a C4"name)
                
give_item(id"weapon_c4")
                
cs_set_user_plant(id11)
                
cs_set_user_money(id cs_get_user_money(id) - 160000)
            }
        }
        case 
:
        {
            new 
name[32];
            
            if (
cs_get_user_money(id) < 14500)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 14500 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a CT skin"name)
                
cs_set_user_model(id"gign")
                
cs_set_user_model(id"sas")
                
cs_set_user_model(id"sas")
                
cs_set_user_money(id cs_get_user_money(id) - 145000)
            }
        }
        case 
:
        {
            new 
name[32];
            
            if (
cs_get_user_money(id) < 14500)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 14500 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a T skin"name)
                
cs_set_user_model(id"guerilla")
                
cs_set_user_model(id"terror")
                
cs_set_user_model(id"leet")
                
cs_set_user_money(id cs_get_user_money(id) - 145000)
            }
        }
        case 
:
        {
            new 
name[32];
            
            if (
cs_get_user_money(id) < 4000)
            {
                
get_user_name(idname31)
                
ColorChat(idGREEN"%s ^x03-Don't have enought money"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (!
is_user_alive(id))
            {
                
ColorChat(idGREEN"%s ^x03-need to be alive"name)
                return 
PLUGIN_HANDLED;
            }
            
            if (
cs_get_user_money(id) >= 4000 )
            {
                
get_user_name(idname31)
                
ColorChat(0GREEN"%s ^x03-Buy a T skin"name)
                new 
Float:speed get_user_maxspeed(id) + 500.0;
                
set_user_maxspeed(id speed); 
                
cs_set_user_money(id cs_get_user_money(id) - 40000)
            }
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
 } 
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 08-12-2010 , 11:12   Re: Speeeeeed
Reply With Quote #9

But i don't buy it! Then i spawn i have +500 speed .
I wanna it have then i buy it ;)
zirualas is offline
Send a message via Skype™ to zirualas
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-12-2010 , 12:12   Re: Speeeeeed
Reply With Quote #10

do a bool at the top like:

new bool:buyedspeed[33]

then when the player buyed the speed u set buyspeed[id] = true

in curweaon u check if the bool is true; when yea set the speed.

Now, try it alone and if you dont get it ask.
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
Reply


Thread Tools
Display Modes

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 21:53.


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