Raised This Month: $ Target: $400
 0% 

[ Solved ] fwHamPlayerSpawnPost


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-01-2008 , 10:19   [ Solved ] fwHamPlayerSpawnPost
Reply With Quote #1

L 08/01/2008 - 17:13:58: [FUN] Invalid player 2
L 08/01/2008 - 17:13:58: [AMXX] Displaying debug trace (plugin "vip.amxx")
L 08/01/2008 - 17:13:58: [AMXX] Run time error 10: native error (native "set_user_health")
L 08/01/2008 - 17:13:58: [AMXX] [0] vip.sma::fwHamPlayerSpawnPost (line 52)


how to fix it ? here code
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fakemeta_util>
#include <ColorChat>
#include <fun>

#define VIP_ACCES ADMIN_LEVEL_B

new iconstatus;

public 
plugin_init() {
    
register_plugin("VIP Plugin""1.1""xPaw")

    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
register_forward(FM_PlayerPreThink"fw_prethink")
    
iconstatus get_user_msgid("StatusIcon");
}

public 
client_putinserver(id)
{
    if(
get_user_flags(id) & VIP_ACCES)
    {
        
set_task(5.0"welcome_vip"id);
    }
}

public 
welcome_vip(id) {
        new 
vipname[33]
        
get_user_name(idvipname32)
        
        
client_cmd(0"spk buttons/bell1")
        
ColorChat(0RED"^x01**^x04 VIP^x03 %s^x04 has connected."vipname)
        
client_print(idprint_center"Welcome %s."vipname)
        
set_user_vip_xpaw(id)
}

public 
set_user_vip_xpaw(id){
    
message_beginMSG_ONEget_user_msgid("ScoreAttrib") )
    
write_byteid 
    
write_byte
    
message_end()
}

public 
fwHamPlayerSpawnPost(id)
{
    if(!
is_user_alive(id)) return PLUGIN_HANDLED;
    
    if(
get_user_flags(id) & VIP_ACCES)
    {
        new 
viphealth get_user_health(id);
            
set_user_healthidviphealth+50 )
            
cs_set_user_moneyidcs_get_user_money(id)+1000 )
            
fm_give_item(id"item_assaultsuit");
            
fm_give_item(id"weapon_hegrenade")
            
set_user_vip_xpaw(id)
            
            return 
PLUGIN_CONTINUE;
    }
    return 
PLUGIN_CONTINUE;
}

public 
fw_prethink(id)
{
    if(!(
pev(id,pev_button) & FL_ONGROUND) && get_user_flags(id) & VIP_ACCES)
    {    
        
message_begin(MSG_ONE,iconstatus,{0,0,0},id);
        
write_byte(1); // status (0=hide, 1=show, 2=flash)
        
write_string("vipsafety"); // sprite name
        
write_byte(0); // red
        
write_byte(255); // green
        
write_byte(0); // blue
        
message_end();
    }
    


Last edited by xPaw; 08-26-2008 at 09:04.
xPaw is offline
 


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 05:33.


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