Raised This Month: $ Target: $400
 0% 

[DM] Spectator -> Team | Not Spawning


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devWaleed
Member
Join Date: Apr 2013
Location: Karachi, Pakistan
Old 07-15-2013 , 16:53   [DM] Spectator -> Team | Not Spawning
Reply With Quote #1

Hey, I think from the title you know what I am talking about. If you go to spectator mode, You can't join any team again i.e: Only 1 team change is allowed. Is there a way for spawning a player if he wants to join a team from spectator mode?
devWaleed is offline
Send a message via Skype™ to devWaleed
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 07-15-2013 , 17:37   Re: [DM] Spectator -> Team | Not Spawning
Reply With Quote #2

I found this code to prevent this problem.

PHP Code:
set_pdata_int(id125, (get_pdata_int(id1255) & ~(1<<8)), 5
if you would search it, you can find it too. Anyway, here you go

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

new CurrentTeam[33] = 'U';
public 
plugin_init() {
    
register_plugin("Plugin""1.0""akcaliberg")
    
    
register_event("TeamInfo""eTeamChange""a")
}
public 
eTeamChange() {
    
    static 
idszTeam[2];
    
    
id read_data(1);
    
read_data(2,szTeam,1)
    
    if(
CurrentTeam[id] != szTeam[0]) {
        
CurrentTeam[id] = szTeam[0];
        
        if(
szTeam[0] == 'S'set_pdata_int(id125, (get_pdata_int(id1255) & ~(1<<8)), 5)
    }


Last edited by akcaliberg; 07-15-2013 at 17:37.
akcaliberg is offline
devWaleed
Member
Join Date: Apr 2013
Location: Karachi, Pakistan
Old 07-15-2013 , 19:00   Re: [DM] Spectator -> Team | Not Spawning
Reply With Quote #3

umm.....I am sorry but my knowledge is not good enough to understand that :\
devWaleed is offline
Send a message via Skype™ to devWaleed
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 07-15-2013 , 20:16   Re: [DM] Spectator -> Team | Not Spawning
Reply With Quote #4

Hook the "chooseteam" command and put that first code to hook function That's all.

But the plugin that I've already given you is better. It will only let the spectators immediate team change.
akcaliberg is offline
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:24.


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