Raised This Month: $51 Target: $400
 12% 

Using player_speedmod entity to players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-23-2013 , 14:51   Using player_speedmod entity to players
Reply With Quote #1

!topic Using player_weaponstrip entity for disarm players
--------------------------------



player_speedmod

- To reset all speedmod effects from player, set speed modify value exactly 1.0 *and all flags
- Add either or both speed and suppress effect, set speed modify any other value than 1.0

- These suppress effect will stay on player until he reconnect to server.
- Speed affect as long as player spawn.

PHP Code:
/*
1 : Suppress weapons
2 : Suppress HUD
4 : Suppress jump
8 : Suppress duck
16 : Suppress use
32 : Suppress sprint
64 : Suppress attack
128 : Suppress zoom
*/
#define    Suppress_weapons    (1<<0)
#define    Suppress_HUD        (1<<1)
#define    Suppress_jump        (1<<2)
#define    Suppress_duck        (1<<3)
#define    Suppress_use        (1<<4)
#define    Suppress_sprint    (1<<5)
#define    Suppress_attack    (1<<6)
#define    Suppress_zoom        (1<<7)
#define    Suppress_all        Suppress_weapons|Suppress_HUD|Suppress_jump|Suppress_duck|Suppress_use|Suppress_sprint|Suppress_attack|Suppress_zoom


perform_speedmod(clienttargetlist[], numtargetsFloat:speed=1.0suppress=0)
{
    new 
player_speedmod CreateEntityByName("player_speedmod");

    if(
player_speedmod MaxClients)
    {
        new 
String:buffer[45];
        
Format(buffersizeof(buffer), "%i"suppress);
        
DispatchKeyValue(player_speedmod"spawnflags" buffer);

        
Format(buffersizeof(buffer), "OnUser1 !caller,ModifySpeed,%0.3f,0.1,-1"speed);
        
SetVariantString(buffer);
        
AcceptEntityInput(player_speedmod"AddOutput");

        
SetVariantString("OnUser2 !self,Kill,,0.2,-1");
        
AcceptEntityInput(player_speedmod"AddOutput");
        
AcceptEntityInput(player_speedmod"FireUser2");

        for(new 
0numtargetsi++)
        {
            
AcceptEntityInput(player_speedmod"FireUser1"targetlist[i], client);
        }
    }

+ With this you can block few player actions easily

Last edited by Bacardi; 12-24-2013 at 14:13. Reason: moar info
Bacardi is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 12-23-2013 , 14:55   Re: Using player_speedmod entity to players
Reply With Quote #2

Very useful stuff, thanks for finding and sharing it
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-24-2013 , 14:01   Re: Using player_speedmod entity to players
Reply With Quote #3

hmmm, seems Suppress_zoom not work in cs:s :/
*edit
when reset player affecting suppresses, better use all flags on him.

Last edited by Bacardi; 12-24-2013 at 14:14.
Bacardi is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 12-25-2013 , 03:10   Re: Using player_speedmod entity to players
Reply With Quote #4

Finally something come up.. thanks for sharing..
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
-Absolute-
Member
Join Date: Mar 2010
Old 12-28-2013 , 15:33   Re: Using player_speedmod entity to players
Reply With Quote #5

You can dispatch Outputs by adding them as keyvalues like so:
PHP Code:
Format(buffersizeof(buffer), "!caller,ModifySpeed,%0.3f,0.1,-1"speed);
DispatchKeyValue(player_speedmod"OnUser1" buffer); 
__________________
-Absolute- 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 12:18.


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