AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Using player_speedmod entity to players (https://forums.alliedmods.net/showthread.php?t=231989)

Bacardi 12-23-2013 14:51

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


:bee:
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 :3

Root_ 12-23-2013 14:55

Re: Using player_speedmod entity to players
 
Very useful stuff, thanks for finding and sharing it :D

Bacardi 12-24-2013 14:01

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

GsiX 12-25-2013 03:10

Re: Using player_speedmod entity to players
 
Finally something come up.. thanks for sharing..

-Absolute- 12-28-2013 15:33

Re: Using player_speedmod entity to players
 
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); 



All times are GMT -4. The time now is 18:28.

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