Raised This Month: $ Target: $400
 0% 

RegisterHam Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-05-2010 , 11:05   Re: RegisterHam Problem
Reply With Quote #1

Quote:
Originally Posted by Bugsy View Post
No, the is_user_alive() check is required to detect spawn in Ham_Spawn post.
Thank you. Never knew that.

Now since I'm executing commands on different teams, can I do this?

PHP Code:
public player_spawned(iPlayer)
{
    if(
is_user_alive(iPlayer)
    {
        if(
cs_get_user_team(iPlayer) == CS_TEAM_T)
        {
            
fm_set_user_rendering(iPlayerkRenderFxNone255255255kRenderTransAlpha0);
        }
        if(
cs_get_user_team(iPlayer) == CS_TEAM_CT)
        {
            
give_item(iPlayer"weapon_hegrenade");
            
give_item(iPlayer"weapon_knife");
            
set_user_armor(iPlayerget_pcvar_num(humanarmor));
        }
    }

__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-05-2010 , 11:22   Re: RegisterHam Problem
Reply With Quote #2

PHP Code:
if(is_user_alive(iPlayer
=>
PHP Code:
if(is_user_alive(iPlayer)) 
Also, you can switch() the cs_get_user_team function or at least use else if.
Backstabnoob is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-05-2010 , 11:29   Re: RegisterHam Problem
Reply With Quote #3

Quote:
Originally Posted by Backstabnoob View Post
PHP Code:
if(is_user_alive(iPlayer
=>
PHP Code:
if(is_user_alive(iPlayer)) 
Also, you can switch() the cs_get_user_team function or at least use else if.
I have no experience with else if :/ Would you please use an example?
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-05-2010 , 11:31   Re: RegisterHam Problem
Reply With Quote #4

As backstab noob said... Also, you can user set_user_rendering() since you are using fun module. You also should use cs_set_user_armor().
PHP Code:
public player_spawned(iPlayer)
{
    if( 
is_user_aliveiPlayer ) )
    {
        if( 
cs_get_user_team(iPlayer) == CS_TEAM_T )
        {    
            
set_user_renderingiPlayer kRenderFxNone 255 255 255 kRenderTransAlpha );
        }
        else
        {
            
give_itemiPlayer "weapon_hegrenade" );
            
give_itemiPlayer "weapon_knife" );
            
set_user_armoriPlayer get_pcvar_numhumanarmor ) );
        }
    }

__________________

Last edited by Bugsy; 06-05-2010 at 11:33.
Bugsy 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 05:22.


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