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

Using player_weaponstrip entity for disarm players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-17-2013 , 09:17   Using player_weaponstrip entity for disarm players
Reply With Quote #1

!topic Using player_speedmod entity to players
-----------------------------------------



player_weaponstrip
cmds:
Strip
StripWeaponsAndSuit


Quick example:
- Creates temporary entity = player_weaponstrip
- Targetname !caller in entity ouput "OnUser1", are targets who fire that input "FireUser1"
- Using client indexs to fire entity input "FireUser1"

- Not necessary need add activators in others AcceptEntityInput... just into firing input.

rest of plugin codes

PHP Code:
perform_weaponstrip(clienttargets[], numtargets)
{
    new 
player_weaponstrip CreateEntityByName("player_weaponstrip");

    if(
player_weaponstrip MaxClients)
    {
        
// In this enity output "OnUser1",
        // a !caller is entity which fire this entity input "FireUser1"
        
SetVariantString("OnUser1 !caller,Strip,,0.1,-1");
        
AcceptEntityInput(player_weaponstrip"AddOutput"player_weaponstrip);

        
// Entity kill itself in under second
        
SetVariantString("OnUser2 !self,Kill,,0.2,-1");
        
AcceptEntityInput(player_weaponstrip"AddOutput"player_weaponstrip);
        
AcceptEntityInput(player_weaponstrip"FireUser2"player_weaponstrip);

        
// In this loop,
        // I fire entity player_weaponstrip input "FireUser1",
        // using my targets as a !caller.
        
for(new 0numtargetsi++)
        {
            
AcceptEntityInput(player_weaponstrip"FireUser1"targets[i], client);
        }
    }

- Have tested in Counter Strike:Source,
maybe works in other games what support this entity.
You can test by open the game, set sv_cheats 1 and load map, type in console input:
ent_info player_weaponstrip
you should get output list in your console.

+ Using this you avoid gamedata files + searching rigth offsets, you know what I mean
+ Let's say, less gamedata file and offsets finding

Last edited by Bacardi; 12-23-2013 at 15:06.
Bacardi is offline
pride95
Senior Member
Join Date: Aug 2015
Old 03-07-2018 , 17:08   Re: Using player_weaponstrip entity for disarm players
Reply With Quote #2

PHP Code:

stock void RemoveWeapons
()
{
    
int Strip CreateEntityByName("player_weaponstrip");
    
    for(
int Client 1Client <= MaxClientsClient++)
    {
        if(
IsClientInGame(Client))
        {    
            if(
GetClientTeam(Client) > CS_TEAM_SPECTATOR)
            {
                
AcceptEntityInput(Strip"strip"Client);
            }
        }
    }
    
    
AcceptEntityInput(Strip"kill");

tested in CS:GO. This removes all weapons from all players.
pride95 is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 03-07-2018 , 17:10   Re: Using player_weaponstrip entity for disarm players
Reply With Quote #3

player_weaponstrip has been obsolete for several years now... especially in cs:go use game_player_equip
Mitchell is offline
pride95
Senior Member
Join Date: Aug 2015
Old 03-07-2018 , 17:50   Re: Using player_weaponstrip entity for disarm players
Reply With Quote #4

Quote:
Originally Posted by Mitchell View Post
player_weaponstrip has been obsolete for several years now... especially in cs:go use game_player_equip
PHP Code:
    int Strip CreateEntityByName("game_player_equip");
    
DispatchKeyValue(Strip"spawnflags""2");
    
AcceptEntityInput(Strip"TriggerForAllPlayers");
    
AcceptEntityInput(Strip"kill"); 
done.
pride95 is offline
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 07:10.


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