Raised This Month: $ Target: $400
 0% 

[ Solved ] fwHamPlayerSpawnPost


Post New Thread Reply   
 
Thread Tools Display Modes
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
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 08-01-2008 , 12:20   Re: fwHamPlayerSpawnPost
Reply With Quote #2

PHP Code:
set_user_healthidget_user_health(id) + 50 ); 
</SPAN>
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-01-2008 , 12:26   Re: fwHamPlayerSpawnPost
Reply With Quote #3

wont work, server crushes with error: Host_error: WriteDest_Parm: not a client
xPaw is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 08-01-2008 , 12:40   Re: fwHamPlayerSpawnPost
Reply With Quote #4

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)
{   
// 0 - nothing, 1 - dead, 2 - bomb 
   
message_begin(MSG_ALLget_user_msgid("ScoreAttrib"),{0,0,0},0
   
write_byte(id
   
write_byte(4
   
message_end() 
   return 
PLUGIN_HANDLED 

public 
fwHamPlayerSpawnPost(id

    if(!
is_user_alive(id)) return PLUGIN_HANDLED
 
    if(
get_user_flags(id) & VIP_ACCES
    { 
        
set_user_healthidget_user_health(id) + 50); 
        
cs_set_user_money(idcs_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(); 
    } 
 

I change that and any error I have
__________________
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-01-2008 , 12:57   Re: fwHamPlayerSpawnPost
Reply With Quote #5

+k for fixing all loose indifications, going to test

[EDIT]Thanks! for fine now ;)[/EDIT]

Last edited by xPaw; 08-01-2008 at 14:04.
xPaw 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:33.


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