!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(client, targetlist[], numtargets, Float:speed=1.0, suppress=0)
{
new player_speedmod = CreateEntityByName("player_speedmod");
if(player_speedmod > MaxClients)
{
new String:buffer[45];
Format(buffer, sizeof(buffer), "%i", suppress);
DispatchKeyValue(player_speedmod, "spawnflags" , buffer);
Format(buffer, sizeof(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 i = 0; i < numtargets; i++)
{
AcceptEntityInput(player_speedmod, "FireUser1", targetlist[i], client);
}
}
}
+ With this you can block few player actions easily