Raised This Month: $ Target: $400
 0% 

Spectator Bug


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
-=hunter=-
Senior Member
Join Date: Jul 2008
Old 05-24-2010 , 04:33   Spectator Bug
Reply With Quote #1

Hello all. I found bug but i can't understand how to fix it. This plugin allows to enter spectate without killing and changing team. But if i kill myself and then try to go to the spectator and leave, there will be a bug. How can I fix it?

PHP Code:
#include <amxmodx>
#include <engine>
#include <fun>

public plugin_init() {
    
register_plugin("Plugin""1.0""AUTHOR")
    
register_clcmd("chooseteam""spectate" );
    
    
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET );
}

public 
spectate(id)
{    
    if (
is_user_alive(id)) { // enter to spectate        
        
strip_user_weapons(id);        
        
entity_set_int(id,EV_INT_movetype,MOVETYPE_NOCLIP)        
        
entity_set_int(id,EV_INT_deadflag,DEAD_DEAD)
    } else { 
// exit from spectate    
        
spawn(id)        
        
give_item(id"weapon_knife")
        
give_item(id"weapon_usp")
    }    
    return 
PLUGIN_HANDLED;

-=hunter=- is offline
Send a message via ICQ to -=hunter=- Send a message via Skype™ to -=hunter=-
 


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:25.


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