AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   MAXSPEED (https://forums.alliedmods.net/showthread.php?t=105501)

Kryzu 10-05-2009 09:15

MAXSPEED
 
Hello!

I know this has been already asked and helped, i found the topics, but couldn't mix it into my script:S

Could anyone help me making this code working:

PHP Code:

public GiveStuffid ) {
    if( 
is_user_aliveid ) ) {
        
strip_user_weaponsid )
        
give_itemid"weapon_flashbang" );
        
give_itemid"weapon_smokegrenade" );
        
give_itemid"weapon_knife" );
        
give_itemid"weapon_usp" );
        
        new 
iUsp find_ent_by_owner( -1"weapon_usp"id );
        
        if( 
iUsp ){
            
cs_set_weapon_ammoiUsp10 );
            }
        

          new 
iCurWeapon read_data(2)
            if( 
iCurWeapon != g_iCurWeapon[id] )
         {
                
g_iCurWeapon[id] = iCurWeapon
                    set_user_maxspeed
(id270.0)
            }

    }


Atm this maxspeed isn't working at all. It worked untill i tried to make it to change player's maxspeed permentaly not untill weapon change. So could anyone make it working even if player changes weapons.
+karma

TY!

Exolent[jNr] 10-05-2009 09:17

Re: MAXSPEED
 
There are several threads that change a player's maxspeed and keep it that way on weapon change.
Search.

Kryzu 10-05-2009 09:19

Re: MAXSPEED
 
Quote:

Originally Posted by Exolent[jNr] (Post 952952)
There are several threads that change a player's maxspeed and keep it that way on weapon change.
Search.


Ye i know. As u can see, i wrote it into my topic too.

I took the Curweapon code from http://forums.alliedmods.net/showthread.php?t=94331

BUT

FAiled adding it:s


I have to add this:
PHP Code:

public Event_CurWeapon_Activeid )
{
    new 
iCurWeapon read_data(2)
    if( 
iCurWeapon != g_iCurWeapon[id] )
    {
        
g_iCurWeapon[id] = iCurWeapon
        
new Float:flCustomMaxSpeed g_flCustomMaxSpeed[id]
        if( 
flCustomMaxSpeed != 0.0 )
        {
            
set_user_maxspeed(idflCustomMaxSpeed)
        }
    }



Exolent[jNr] 10-05-2009 09:30

Re: MAXSPEED
 
I know you failed at adding it to your code, but having someone do it for you won't help you learn.
Understand what the other code is doing before you think about copy/pasting, and I don't mean understand the whole purpose.
Understand each individual line.

xPaw 10-05-2009 09:31

Re: MAXSPEED
 
Register the CurWeapon event, and in the function fix the speed.

Kryzu 10-05-2009 09:35

Re: MAXSPEED
 
Quote:

Originally Posted by xPaw (Post 952964)
Register the CurWeapon event, and in the function fix the speed.

Someone had to be VERY busy...

PHP Code:

public GiveStuffid ) {
    if( 
is_user_aliveid ) ) {
        
strip_user_weaponsid )
        
give_itemid"weapon_flashbang" );
        
give_itemid"weapon_smokegrenade" );
        
give_itemid"weapon_knife" );
        
give_itemid"weapon_usp" );
        
        new 
iUsp find_ent_by_owner( -1"weapon_usp"id );
        
        if( 
iUsp ){
            
cs_set_weapon_ammoiUsp10 );
            }
        
        
Event_CurWeapon_Activeid )

        new 
iCurWeapon read_data(2)
        if( 
iCurWeapon != g_iCurWeapon[id] )
        {
            
g_iCurWeapon[id] = iCurWeapon
        set_user_maxspeed
(id270.0)
        }    

    }


I did everything by this:

http://forums.alliedmods.net/showpos...02&postcount=5

xPaw 10-05-2009 09:40

Re: MAXSPEED
 
Stop coding

Exolent[jNr] 10-05-2009 09:42

Re: MAXSPEED
 
Quote:

Originally Posted by xPaw (Post 952972)
Stop coding

No need for that. He just needs to learn more before asking for help.

Kryzu 10-05-2009 09:43

Re: MAXSPEED
 
Well, i am not going to be any "pluginer" or something. I don't want to...
I just want to complete one and only plugin and thats all:S

So, please, i ask,
can someone make it for me, so i can read and discuss about it= i learn=i'll not make these mistakes anymore:)

Exolent[jNr] 10-05-2009 09:46

Re: MAXSPEED
 
Well it's still better to learn so you can make something yourself if you ever decide to later on.


All times are GMT -4. The time now is 22:34.

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