AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [DM] Spectator -> Team | Not Spawning (https://forums.alliedmods.net/showthread.php?t=220909)

devWaleed 07-15-2013 16:53

[DM] Spectator -> Team | Not Spawning
 
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?

akcaliberg 07-15-2013 17:37

Re: [DM] Spectator -> Team | Not Spawning
 
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)
    }



devWaleed 07-15-2013 19:00

Re: [DM] Spectator -> Team | Not Spawning
 
umm.....I am sorry but my knowledge is not good enough to understand that :\

akcaliberg 07-15-2013 20:16

Re: [DM] Spectator -> Team | Not Spawning
 
Hook the "chooseteam" command and put that first code to hook function :D That's all.

But the plugin that I've already given you is better. It will only let the spectators immediate team change.


All times are GMT -4. The time now is 06:24.

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