AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set player's hand model when no weapon (https://forums.alliedmods.net/showthread.php?t=128751)

Backstabnoob 06-05-2010 05:08

Set player's hand model when no weapon
 
Is it possible to set player's hand sequence to knife or something when he doesn't have any weapon? It would be better, cause this way we can easily detect who has weapon and who hasn't. It's bugged like that if a player hasn't got any weapon, his hands are "modelled" to the weapon he used last time. I need it to always be knife animation.

FlyingHorse 06-05-2010 09:28

Re: Set player's hand model when no weapon
 
Quote:

his hands are "modelled" to the weapon he used last time. I need it to always be knife animation.

w....w... what? .. I didnt get any of that

Arkshine 06-05-2010 09:34

Re: Set player's hand model when no weapon
 
Backstabnoob, you better try to explain in others words, because right now, it doesn't make sense at all. ;)

Backstabnoob 06-05-2010 09:46

Re: Set player's hand model when no weapon
 
1 Attachment(s)
It's hard to explain.

Look.

When you have no weapon in your hands, the player model looks like you are holding the last one, but without it in the hands. Just the model is changed.

What I need is, when there are no weapons in hands of an user, to set his animation to look like he had a knife.

Look on the screenshot.

On the first image, he had glock or something before.
On the second one, he had knife.

That is what I want. I need to set model of hands to always look like he used knife, no matter what weapon he had before.

infek 06-05-2010 13:14

Re: Set player's hand model when no weapon
 
What hes trying to say is that, he doesnt want the players hands looking like he's holding a weapon that he was holding before as you can see in his screenshot the first one looks like hes holding a Glock and second looks like hes holding a knife... he doesnt want it to appear like that

ConnorMcLeod 06-05-2010 13:25

Re: Set player's hand model when no weapon
 
Try to replace in plugins strip_user_weapons(id) with Cs_Strip_User_Weapons( id )

Put this stock at the end of .sma

PHP Code:

Cs_Strip_User_Weaponsid )
{
    
engclient_cmd(id"weapon_knife")
    
strip_user_weapons(id)
    
set_pdata_int(id11605)


And then recompile.

Backstabnoob 06-05-2010 18:00

Re: Set player's hand model when no weapon
 
I'm not using strip_user_weapons, I just have a plugin that makes players able to drop the knife. Will it be fine to check if player has no weapon on CurWeapon event, then do that set_pdata_int thing?

Edit: Like this?

PHP Code:

#include < amxmodx >
#include < engine >
#include < hamsandwich >

new g_iCurrentWeapon33 ]


public 
plugin_init( )
{
    
register_event"CurWeapon""event_CurWeapon""be""1=0""2=0""3=0" )
    
RegisterHam(Ham_Spawn"player""player_spawn"1);
}

public 
plugin_precache( )
{
    
precache_modelp_model )
}


public 
player_spawn(id)
    
event_CurWeapon(id)


public 
event_CurWeaponid )
{
    if( !
is_user_aliveid ) )
        return
        
    
g_iCurrentWeaponid ] = read_data)
    
    if( 
g_iCurrentWeaponid ] )
        return
        
        
set_pdata_int(id11605


I'm calling the event on respawn cause when the player respawns, he holds no weapon.

ConnorMcLeod 06-06-2010 04:49

Re: Set player's hand model when no weapon
 
Set the private data has no effect on animation.
Should be another way to force animation.

Can you post that plugin that allow knife drop ?
Is is for jail break server ?

Backstabnoob 06-06-2010 11:09

Re: Set player's hand model when no weapon
 
1 Attachment(s)
I use advanced respawn and I only edited that when you respawn, the plugin doesn't give you default weapons(USP/glock, knife). The knife drop plugin is here: http://forums.alliedmods.net/showthread.php?p=935486

What about setting players model to one without knife? It's jailbreak's bknuckles p_ animation. It's in attachments.


All times are GMT -4. The time now is 05:21.

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