Raised This Month: $51 Target: $400
 12% 

how to transfer all CT to T?


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-01-2012 , 09:44   Re: how to transfer all CT to T?
Reply With Quote #11

You don't understand what i mean, try this :

T slots are removed and changed into CT slots, so no one can join T team.

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define VERSION "0.0.1"
#define PLUGIN "Change T spawns in CT spawns"

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    new 
iEnt FM_NULLENT
    
while( (iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname""info_player_deathmatch")) )
    {
        
engfunc(EngFunc_RemoveEntityiEnt)
    }
}

public 
plugin_precache()
{
    
enum _:SpawnsDatas
    
{
        
m_szAngles[18],
        
m_szOrigins[18]
    }
    new Array:
aSpawns ArrayCreate(SpawnsDatas)
    new 
mTempDatas[SpawnsDatas]

    
enum
    
{
        
iAngles,
        
iOrigins,
        
iClassName
    
}
    new 
Trie:tKeyType TrieCreate()
    
TrieSetCell(tKeyType"angles"iAngles)
    
TrieSetCell(tKeyType"origin"iOrigins)
    
TrieSetCell(tKeyType"classname"iClassName)

    new 
szMapFile[64]
    
get_mapname(szMapFilecharsmax(szMapFile))
    
format(szMapFilecharsmax(szMapFile), "maps/%s.bsp"szMapFile)

    new 
szBuffer[64], szKey[16], szValue[32], iType
    
new bool:bInEntityDatasbool:bIsInfoPlayerStartEntity
    
new fp fopen(szMapFile"rb")

    new 
iOffsetiLengthiMaxPos
    fseek
(fp4SEEK_SET)
    
fread(fpiOffsetBLOCK_INT)
    
fread(fpiLengthBLOCK_INT)
    
iMaxPos iOffset iLength
    fseek
(fpiOffsetSEEK_SET)

    while( 
ftell(fp) < iMaxPos )
    {
        
fgets(fpszBuffercharsmax(szBuffer))
        
trim(szBuffer)

        if( 
bInEntityDatas )
        {
            if( 
szBuffer[0] == '}' )
            {
                
bInEntityDatas false
                
if( bIsInfoPlayerStartEntity )
                {
                    
ArrayPushArray(aSpawnsmTempDatas)
                }
            }
            else
            {
                
parse(szBufferszKeycharsmax(szKey), szValuecharsmax(szValue))
                if( 
TrieGetCell(tKeyTypeszKeyiType) )
                {
                    switch( 
iType )
                    {
                        case 
iAngles:
                        {
                            
copy(mTempDatas[m_szAngles], charsmax(mTempDatas[m_szAngles]), szValue)
                        }
                        case 
iOrigins:
                        {
                            
copy(mTempDatas[m_szOrigins], charsmax(mTempDatas[m_szOrigins]), szValue)
                        }
                        case 
iClassName:
                        {
                            if( 
equal(szValue"info_player_deathmatch") )
                            {
                                
bIsInfoPlayerStartEntity true
                            
}
                        }
                    }
                }
            }
        }
        else if( 
szBuffer[0] == '{' )
        {
            
bInEntityDatas true
            bIsInfoPlayerStartEntity 
false
        
}
    }
    
fclose(fp)

    new 
iSpawnsNum ArraySizeaSpawns )

    new 
iszClassName engfunc(EngFunc_AllocString"info_player_start")

    
set_kvd(0KV_ClassName"info_player_start")
    
set_kvd(0KV_fHandled0)
    for(new 
iiEnti<iSpawnsNumi++)
    {
        
ArrayGetArray(aSpawnsimTempDatas)

        
iEnt engfunc(EngFunc_CreateNamedEntityiszClassName)
        
DispatchKeyValueCustom(iEnt"angles"mTempDatas[m_szAngles])
        
DispatchKeyValueCustom(iEnt"origin"mTempDatas[m_szOrigins])
        
dllfunc(DLLFunc_SpawniEnt)
    }

    
ArrayDestroyaSpawns )
    
TrieDestroytKeyType )
}

DispatchKeyValueCustom(iEntityszKey[], szValue[])
{
    
set_kvd(0KV_KeyNameszKey)
    
set_kvd(0KV_ValueszValue)
    
dllfunc(DLLFunc_KeyValueiEntity0)

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-01-2012 at 13:22.
ConnorMcLeod is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 01-01-2012 , 10:54   Re: how to transfer all CT to T?
Reply With Quote #12

for terrorist ?

EDIT : Just tested your code and it works . I tried to join CT but it says the CT team is full . anyway , I wrote the tittle wrong .. I want all people in the server to be in CT not T . very sorry
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.

Last edited by JoKeR LauGh; 01-01-2012 at 11:02.
JoKeR LauGh is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-01-2012 , 13:22   Re: how to transfer all CT to T?
Reply With Quote #13

Edited.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 01-02-2012 , 00:32   Re: how to transfer all CT to T?
Reply With Quote #14

Quote:
Originally Posted by JoKeR LauGh View Post
I tried to join CT but it says the CT team is full
That cause by spawnpoint is reach limit. For example in a small maps. You need to add more custom spawn point to prevent this message spamming in your console.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019
yokomo is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-02-2012 , 01:47   Re: how to transfer all CT to T?
Reply With Quote #15

Quote:
Originally Posted by yokomo View Post
That cause by spawnpoint is reach limit. For example in a small maps. You need to add more custom spawn point to prevent this message spamming in your console.
No, it was because i was removing all CT spawns.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 01-02-2012 , 04:13   Re: how to transfer all CT to T?
Reply With Quote #16

If you don't want that message to pop-up, use humans_join_team "ct", I think it will automatically assign that team to them and not show the selection.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 01-02-2012 , 07:27   Re: how to transfer all CT to T?
Reply With Quote #17

Code:
L 01/01/2012 - 23:17:13: Start of error session.
L 01/01/2012 - 23:17:13: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20120101.log")
L 01/01/2012 - 23:17:13: [AMXX] Displaying debug trace (plugin "Monster_Mod.amxx")
L 01/01/2012 - 23:17:13: [AMXX] Run time error 4: index out of bounds 
L 01/01/2012 - 23:17:13: [AMXX]    [0] Monster_Mod.sma::PickMonster (line 105)
L 01/01/2012 - 23:17:13: [AMXX] Displaying debug trace (plugin "Monster_Mod.amxx")
L 01/01/2012 - 23:17:13: [AMXX] Run time error 4: index out of bounds 
L 01/01/2012 - 23:17:13: [AMXX]    [0] Monster_Mod.sma::PickMonster (line 105)
L 01/01/2012 - 23:17:13: [AMXX] Displaying debug trace (plugin "Monster_Mod.amxx")
L 01/01/2012 - 23:17:13: [AMXX] Run time error 4: index out of bounds 
L 01/01/2012 - 23:17:13: [AMXX]    [0] Monster_Mod.sma::PickMonster (line 105)
L 01/01/2012 - 23:17:13: [AMXX] Displaying debug trace (plugin "Monster_Mod.amxx")
L 01/01/2012 - 23:17:13: [AMXX] Run time error 4: index out of bounds 
L 01/01/2012 - 23:17:13: [AMXX]    [0] Monster_Mod.sma::PickMonster (line 105)
L 01/01/2012 - 23:17:13: [AMXX] Displaying debug trace (plugin "Monster_Mod.amxx")
L 01/01/2012 - 23:17:13: [AMXX] Run time error 4: index out of bounds 
L 01/01/2012 - 23:17:13: [AMXX]    [0] Monster_Mod.sma::PickMonster (line 105)
L 01/01/2012 - 23:17:13: [AMXX] Displaying debug trace (plugin "Monster_Mod.amxx")
L 01/01/2012 - 23:17:13: [AMXX] Run time error 4: index out of bounds 
L 01/01/2012 - 23:17:13: [AMXX]    [0] Monster_Mod.sma::PickMonster (line 105)
L 01/01/2012 - 23:17:13: [AMXX] Displaying debug trace (plugin "Monster_Mod.amxx")
L 01/01/2012 - 23:17:13: [AMXX] Run time error 4: index out of bounds 
L 01/01/2012 - 23:17:13: [AMXX]    [0] Monster_Mod.sma::PickMoMonster (line 105)
this line ...
PHP Code:
fread(fpiLengthBLOCK_INT
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-02-2012 , 13:30   Re: how to transfer all CT to T?
Reply With Quote #18

Quote:
Originally Posted by JoKeR LauGh View Post
this line ...
Can't be that line, that line is executed only 1 time (you have multiple errors) and the line doesn't contain any array.
This code is ripped from another plugin i have released and that doesn't generate any errors.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 00:31.


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