Raised This Month: $ Target: $400
 0% 

Spectator Bug


Post New Thread Reply   
 
Thread Tools Display Modes
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=-
unnyquee
Senior Member
Join Date: Jun 2009
Location: Constanta, Romania
Old 05-24-2010 , 04:46   Re: Spectator Bug
Reply With Quote #2

What bug?
__________________
unnyquee is offline
-=hunter=-
Senior Member
Join Date: Jul 2008
Old 05-24-2010 , 04:54   Re: Spectator Bug
Reply With Quote #3

This bug appears after i was killed.
When i trying to exit from spectate then this does not happen as expected
-=hunter=- is offline
Send a message via ICQ to -=hunter=- Send a message via Skype™ to -=hunter=-
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-24-2010 , 04:59   Re: Spectator Bug
Reply With Quote #4

This is not a proper way to spawn someone...You should use hamsandwich "Spawn" native, and don't know if it's needed to reset player prop also.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
-=hunter=-
Senior Member
Join Date: Jul 2008
Old 05-24-2010 , 05:20   Re: Spectator Bug
Reply With Quote #5

Alka I don't know how to use hamsandwich for fixing this problem. I can't understand what i must to do after
Quote:
RegisterHam(Ham_Spawn, "player", "fwdHamSpawn");
in a function fwdHamSpawn
-=hunter=- is offline
Send a message via ICQ to -=hunter=- Send a message via Skype™ to -=hunter=-
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-24-2010 , 05:29   Re: Spectator Bug
Reply With Quote #6

Don't need to register the forward, just define the include <hamsandwich> then instead of "spawn(id)" put
PHP Code:
ExecuteHam(Ham_CS_RoundRespawnid); 
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
-=hunter=-
Senior Member
Join Date: Jul 2008
Old 05-24-2010 , 07:58   Re: Spectator Bug
Reply With Quote #7

Alka Thank you very much! :-)
-=hunter=- is offline
Send a message via ICQ to -=hunter=- Send a message via Skype™ to -=hunter=-
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:25.


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