Raised This Month: $ Target: $400
 0% 

Invalid player 8


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KamiN
Senior Member
Join Date: Jun 2011
Old 06-20-2012 , 18:50   Invalid player 8
Reply With Quote #1

Code:
public showStatus(id)
{
    if(get_pcvar_num(cvar_playerinfo)) {
        if(is_user_alive(id)) {
            static name[33], pid 
            pid = read_data(2)
            
            get_user_name(pid, name, 32)
            
            switch(cs_get_user_team(pid)) {
                case CS_TEAM_T: {
                    set_hudmessage(100, 255, 0, -1.0, 0.80, 0, 0.01, 3.0, 0.01, 0.01, -1)
                    ShowSyncHudMsg(id, hudmessage4, "Kaliniai: %s [%d HP]", name, get_user_health(pid))
                    
                }
                case CS_TEAM_CT: {
                    set_hudmessage(0, 255, 100, -1.0, 0.80, 0, 0.01, 3.0, 0.01, 0.01, -1)
                    ShowSyncHudMsg(id, hudmessage4, "Priziuretojai: %s [%d HP]", name, get_user_health(pid))                
                }
            }
        }
    }
}

Code:
L 06/20/2012 - 15:22:05: [CSTRIKE] Invalid player 8
L 06/20/2012 - 15:22:05: [AMXX] Displaying debug trace (plugin "jailbreak_manager_en.amxx")
L 06/20/2012 - 15:22:05: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 06/20/2012 - 15:22:05: [AMXX]    [0] cjailbreak_manager_en.sma::showStatus (line 255)
this is 255 line
Code:
            switch(cs_get_user_team(pid)) {

What's wrong? :O
KamiN is offline
Liverwiz
Veteran Member
Join Date: Feb 2010
Location: Maryland
Old 06-20-2012 , 21:48   Re: Invalid player 8
Reply With Quote #2

how do you call showStatus?
__________________
What an elegant solution to a problem that doesn't need solving....
Liverwiz is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-20-2012 , 22:27   Re: Invalid player 8
Reply With Quote #3

I'm going to assume that your trying to use StatusValue. Your not running any checks on your target player. Check if they're alive, also you should you use the 3rd piece of data for health since its sent anyway.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 06-21-2012 , 02:16   Re: Invalid player 8
Reply With Quote #4

PHP Code:
public showStatus(id)
{
    if(
get_pcvar_num(cvar_playerinfo)) {
        if(
is_user_alive(id)) {
           
            static 
name[33], pid 
            pid 
read_data(2)
            if( !
is_user_alivepid ) )
                 return 
PLUGIN_HANDLED
            
get_user_name(pidname32)
            
            switch(
cs_get_user_team(pid)) {
                case 
CS_TEAM_T: {
                    
set_hudmessage(1002550, -1.00.8000.013.00.010.01, -1)
                    
ShowSyncHudMsg(idhudmessage4"Kaliniai: %s [%d HP]"nameget_user_health(pid))
                    
                }
                case 
CS_TEAM_CT: {
                    
set_hudmessage(0255100, -1.00.8000.013.00.010.01, -1)
                    
ShowSyncHudMsg(idhudmessage4"Priziuretojai: %s [%d HP]"nameget_user_health(pid))                
                }
            }
        }
    }
    return 
PLUGIN_HANDLED;

Edit: I didn't read hornet's post :/
__________________

Last edited by Neeeeeeeeeel.-; 06-21-2012 at 02:18.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
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 06:10.


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