[TTT] Items
#26
Disculpen, alguien tendria el models/ttt/camera.mdl ???
PD: no esta en el zip
Gracias..
Responder
#27
Se me habrá olvidado, lo siento. No te lo puedo adjuntar ni tampoco puedo actualizar el zip del tema principal, el foro tiene algún problemilla con los adjuntos... te lo dejo por MediaFire.

PD: En su momento cuando configuraba un TTT, me funcionaba mal el plugin de las advertencias que venía con el TTT e hice otro aparte. Como veo que algunos andan buscando lo dejo; no es un item pero... es una utilidad. Debo advertir que saqué varias natives y forwards, por lo que también las van a tener que sacar donde el TTT las esté usando (las utiliza innecesariamente de todas formas).

Código PHP:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <ttt>

/* =================================================================================
*               [ Global stuff ]
* ================================================================================= */

#define GetPlayerBit(%1,%2) ( %1 & ( 1 << ( %2 & 31 ) ) )
#define SetPlayerBit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
#define ClearPlayerBit(%1,%2) ( %1 &= ~( 1 << ( %2 & 31 ) ) )

#define IsPlayerValid(%0) ( 1 <= %0 <= 32 )
#define IsStateValid(%0) ( PC_TRAITOR < %0 < PC_INNOCENT )

const MAX_SHOTS 8;
const 
MIN_KARMA 390;
const 
MAX_WARNINGS 3;
const 
BAN_DURATION 30;

new const 
BAN_REASON[ ] = "Maximo numero de advertencias alcanzado";

new 
Trie:g_tList;

new 
g_iConnected;
new 
g_iAlive;
new 
g_iPunish;
new 
g_iScreenFade;
new 
g_iCommand_Warnings;

new 
g_iPlayerShots33 ];
new 
g_iPlayerWarnings33 ];
new 
g_szPlayerIp33 ][ 32 ];
new 
Float:g_flPlayerLastShot33 ];

/* =================================================================================
*               [ Initialization ]
* ================================================================================= */

public plugin_natives( )
{
    
register_library"ttt" );
}

public 
plugin_init( )
{
    
register_plugin"[TTT] Warning System""1.0""Manu" );
    
    
RegisterHamHam_TakeDamage"player""Forward_PlayerTakeDamage_Post"true );
    
RegisterHamHam_Killed"player""Forward_PlayerKilled_Post"true );
    
RegisterHamHam_Spawn"player""Forward_PlayerSpawn_Post"true );
    
    
g_tList                    TrieCreate( );
    
g_iScreenFade            get_user_msgid"ScreenFade" );
    
g_iCommand_Warnings     ttt_command_add"Advertencias" );
}

/* =================================================================================
*               [ Cross-plugin communication ]
* ================================================================================= */

public ttt_gamemodeiGamemode )
{
    if( 
iGamemode == GAME_STARTED )
    {
        for( new 
iId 1iId <= MAX_PLAYERSiId++ )
        {
            if( !
GetPlayerBitg_iConnectediId ) || ( ttt_get_playerdataiIdPD_KARMATEMP ) > MIN_KARMA ) )
            {
                continue;
            }
            
            
BanPlayeriId );
        }
    }
}

public 
ttt_command_selectediIdiMenuIdszName[ ] )
{
    if( 
iMenuId == g_iCommand_Warnings )
    {
        
PrintWarningsiId );
    }
}

/* =================================================================================
*               [ Hamsandwich forwards ]
* ================================================================================= */

public Forward_PlayerSpawn_PostiId )
{
    
SetPlayerBitg_iAliveiId );
    
    if( 
GetPlayerBitg_iPunishiId ) )
    {
        
ClearPlayerBitg_iPunishiId );
        
        
set_task5.0"Task_SlayPlayer"iId );
    }
    
    
PrintWarningsiId );
}

public 
Forward_PlayerTakeDamage_PostiVictimiInflictoriAttackerFloat:flDamageiBits )
{
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED || !is_user_connectediAttacker ) || ( flDamage 1.0 ) || iAttacker == iVictim )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iAttackerStateiAttackerState ttt_get_alivestateiAttacker );
    static 
iVictimStateiVictimState ttt_get_alivestateiVictim );
    
    if( !
IsStateValidiAttackerState ) || !IsStateValidiVictimState ) )
    {
        return 
HAM_IGNORED;
    }
    
    if ( 
iAttackerState == iVictimState
    
|| ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE )
    || ( 
iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) )
    {
        static 
Float:flGameTimeflGameTime get_gametime( );
        
        if( ( 
flGameTime g_flPlayerLastShotiAttacker ] ) > 1.0 )
        {
            if( ++
g_iPlayerShotsiAttacker ] >= MAX_SHOTS )
            {
                
SetPlayerBitg_iPunishiAttacker );
            }
        }
        
        
g_flPlayerLastShotiAttacker ] = flGameTime;
    }
    
    return 
HAM_IGNORED;
}

public 
Forward_PlayerKilled_PostiVictimiAttackeriShouldGib )
{
    
ClearPlayerBitg_iAliveiVictim );
    
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED || !IsPlayerValidiAttacker ) || !GetPlayerBitg_iConnectediAttacker ) || iAttacker == iVictim )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iAttackerStateiAttackerState ttt_get_alivestateiAttacker );
    static 
iVictimStateiVictimState ttt_get_alivestateiVictim );
    
    if( !
IsStateValidiAttackerState ) || !IsStateValidiVictimState ) )
    {
        return 
HAM_IGNORED;
    }
    
    if ( 
iAttackerState == iVictimState
    
|| ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE )
    || ( 
iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) )
    {
        if( ++
g_iPlayerWarningsiAttacker ] >= MAX_WARNINGS )
        {
            
BanPlayeriAttacker );
        }
        else
        {
            
WarningScreenFadeiAttacker );
        }
    }
    
    return 
HAM_IGNORED;
}

/* =================================================================================
*               [ Client-related ]
* ================================================================================= */

public client_putinserveriId )
{
    
SetPlayerBitg_iConnectediId );
    
    
LoadPlayerDataiId );
}

public 
client_disconnectediId )
{
    
SavePlayerDataiId );
    
    
ClearPlayerBitg_iConnectediId );
    
ClearPlayerBitg_iAliveiId );
    
ClearPlayerBitg_iPunishiId );
}

public 
ClientCommand_WarningsiId )
{
    
PrintWarningsiId );
    
    return 
PLUGIN_HANDLED;
}

public 
BanPlayeriId )
{
    if( !
GetPlayerBitg_iConnectediId ) )
    {
        return;
    }
    
    new 
szName32 ]; get_user_nameiIdszNamecharsmaxszName ) );
    
    
client_print_color0print_team_default"^4[TTT]^1 Atencion:^3 %s^1 fue expulsado por^4 %s^1."szNameBAN_REASON );
    
    
server_cmd"amx_addban ^"%s^" %d ^"%s^""g_szPlayerIpiId ], BAN_DURATIONBAN_REASON );
    
server_exec( );
}

public 
Task_SlayPlayeriId )
{
    if( !
GetPlayerBitg_iAliveiId ) )
    {
        return;
    }
    
    static 
iOrigin];
    
    
g_iPlayerShotsiId ] = 0
    
    
user_killiId );
    
get_user_originiIdiOrigin );
    
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_LAVASPLASH );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
message_end( );
    
    
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Superaste el maximo de disparos sin razon y fuiste castigado." );
}

/* =================================================================================
*               [ Private functions ]
* ================================================================================= */

SavePlayerData( const iId )
{
    new 
iValues];
    
    
iValues] = ttt_get_playerdataiIdPD_KARMATEMP );
    
iValues] = g_iPlayerShotsiId ];
    
iValues] = g_iPlayerWarningsiId ];
    
    
TrieSetArrayg_tListg_szPlayerIpiId ], iValuessizeofiValues ) );
}

LoadPlayerData( const iId )
{
    
get_user_ipiIdg_szPlayerIpiId ], charsmaxg_szPlayerIp[ ] ), true );
    
    if( 
TrieKeyExistsg_tListg_szPlayerIpiId ] ) )
    {
        new 
iValues];
        
        
TrieGetArrayg_tListg_szPlayerIpiId ], iValues);
        
TrieDeleteKeyg_tListg_szPlayerIpiId ] );

        
ttt_set_playerdataiIdPD_KARMATEMPiValues] );
        
ttt_set_playerdataiIdPD_KARMAiValues] );
        
        
g_iPlayerShotsiId ] = iValues];
        
g_iPlayerWarningsiId ] = iValues];
        
        if( 
g_iPlayerShotsiId ] >= MAX_SHOTS )
        {
            
SetPlayerBitg_iPunishiId );
        }
    }
    else
    {
        
g_iPlayerShotsiId ] = 0;
        
g_iPlayerWarningsiId ] = 0;
    }
}

PrintWarningsiId )
{
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED )
    {
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Advertencias: ^x03%d de %d^x01 - Disparos sin razon: ^x03%d de %d^x01.^n"g_iPlayerWarningsiId ], MAX_WARNINGSg_iPlayerShotsiId ], MAX_SHOTS );
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Si alcanzas el maximo seras castigado con ban u/o slay!" );
    }
}

WarningScreenFade( const iId )
{
    
message_beginMSG_ONE_UNRELIABLEg_iScreenFade_iId );
    
write_short1<<12 );
    
write_short( (1<<12) );
    
write_short0x1000 );
    
write_byte255 );
    
write_byte);
    
write_byte);
    
write_byte50 );
    
message_end( );

No hago trabajos privados. Si necesitás ayuda, abrí un nuevo tema.
¿Buscás un ejemplo o algún modo de juego? Podés echarle un vistazo a mis aportes
.
Responder
#28
(19/11/2017, 12:51 AM)Treki escribió: Se me habrá olvidado, lo siento. No te lo puedo adjuntar ni tampoco puedo actualizar el zip del tema principal, el foro tiene algún problemilla con los adjuntos... te lo dejo por MediaFire.

PD: En su momento cuando configuraba un TTT, me funcionaba mal el plugin de las advertencias que venía con el TTT e hice otro aparte. Como veo que algunos andan buscando lo dejo; no es un item pero... es una utilidad. Debo advertir que saqué varias natives y forwards, por lo que también las van a tener que sacar donde el TTT las esté usando (las utiliza innecesariamente de todas formas).

Código PHP:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <ttt>

/* =================================================================================
*               [ Global stuff ]
* ================================================================================= */

#define GetPlayerBit(%1,%2) ( %1 & ( 1 << ( %2 & 31 ) ) )
#define SetPlayerBit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
#define ClearPlayerBit(%1,%2) ( %1 &= ~( 1 << ( %2 & 31 ) ) )

#define IsPlayerValid(%0) ( 1 <= %0 <= 32 )
#define IsStateValid(%0) ( PC_TRAITOR < %0 < PC_INNOCENT )

const MAX_SHOTS 8;
const 
MIN_KARMA 390;
const 
MAX_WARNINGS 3;
const 
BAN_DURATION 30;

new const 
BAN_REASON[ ] = "Maximo numero de advertencias alcanzado";

new 
Trie:g_tList;

new 
g_iConnected;
new 
g_iAlive;
new 
g_iPunish;
new 
g_iScreenFade;
new 
g_iCommand_Warnings;

new 
g_iPlayerShots33 ];
new 
g_iPlayerWarnings33 ];
new 
g_szPlayerIp33 ][ 32 ];
new 
Float:g_flPlayerLastShot33 ];

/* =================================================================================
*               [ Initialization ]
* ================================================================================= */

public plugin_natives( )
{
    
register_library"ttt" );
}

public 
plugin_init( )
{
    
register_plugin"[TTT] Warning System""1.0""Manu" );
    
    
RegisterHamHam_TakeDamage"player""Forward_PlayerTakeDamage_Post"true );
    
RegisterHamHam_Killed"player""Forward_PlayerKilled_Post"true );
    
RegisterHamHam_Spawn"player""Forward_PlayerSpawn_Post"true );
    
    
g_tList                    TrieCreate( );
    
g_iScreenFade            get_user_msgid"ScreenFade" );
    
g_iCommand_Warnings     ttt_command_add"Advertencias" );
}

/* =================================================================================
*               [ Cross-plugin communication ]
* ================================================================================= */

public ttt_gamemodeiGamemode )
{
    if( 
iGamemode == GAME_STARTED )
    {
        for( new 
iId 1iId <= MAX_PLAYERSiId++ )
        {
            if( !
GetPlayerBitg_iConnectediId ) || ( ttt_get_playerdataiIdPD_KARMATEMP ) > MIN_KARMA ) )
            {
                continue;
            }
            
            
BanPlayeriId );
        }
    }
}

public 
ttt_command_selectediIdiMenuIdszName[ ] )
{
    if( 
iMenuId == g_iCommand_Warnings )
    {
        
PrintWarningsiId );
    }
}

/* =================================================================================
*               [ Hamsandwich forwards ]
* ================================================================================= */

public Forward_PlayerSpawn_PostiId )
{
    
SetPlayerBitg_iAliveiId );
    
    if( 
GetPlayerBitg_iPunishiId ) )
    {
        
ClearPlayerBitg_iPunishiId );
        
        
set_task5.0"Task_SlayPlayer"iId );
    }
    
    
PrintWarningsiId );
}

public 
Forward_PlayerTakeDamage_PostiVictimiInflictoriAttackerFloat:flDamageiBits )
{
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED || !is_user_connectediAttacker ) || ( flDamage 1.0 ) || iAttacker == iVictim )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iAttackerStateiAttackerState ttt_get_alivestateiAttacker );
    static 
iVictimStateiVictimState ttt_get_alivestateiVictim );
    
    if( !
IsStateValidiAttackerState ) || !IsStateValidiVictimState ) )
    {
        return 
HAM_IGNORED;
    }
    
    if ( 
iAttackerState == iVictimState
    
|| ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE )
    || ( 
iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) )
    {
        static 
Float:flGameTimeflGameTime get_gametime( );
        
        if( ( 
flGameTime g_flPlayerLastShotiAttacker ] ) > 1.0 )
        {
            if( ++
g_iPlayerShotsiAttacker ] >= MAX_SHOTS )
            {
                
SetPlayerBitg_iPunishiAttacker );
            }
        }
        
        
g_flPlayerLastShotiAttacker ] = flGameTime;
    }
    
    return 
HAM_IGNORED;
}

public 
Forward_PlayerKilled_PostiVictimiAttackeriShouldGib )
{
    
ClearPlayerBitg_iAliveiVictim );
    
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED || !IsPlayerValidiAttacker ) || !GetPlayerBitg_iConnectediAttacker ) || iAttacker == iVictim )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iAttackerStateiAttackerState ttt_get_alivestateiAttacker );
    static 
iVictimStateiVictimState ttt_get_alivestateiVictim );
    
    if( !
IsStateValidiAttackerState ) || !IsStateValidiVictimState ) )
    {
        return 
HAM_IGNORED;
    }
    
    if ( 
iAttackerState == iVictimState
    
|| ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE )
    || ( 
iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) )
    {
        if( ++
g_iPlayerWarningsiAttacker ] >= MAX_WARNINGS )
        {
            
BanPlayeriAttacker );
        }
        else
        {
            
WarningScreenFadeiAttacker );
        }
    }
    
    return 
HAM_IGNORED;
}

/* =================================================================================
*               [ Client-related ]
* ================================================================================= */

public client_putinserveriId )
{
    
SetPlayerBitg_iConnectediId );
    
    
LoadPlayerDataiId );
}

public 
client_disconnectediId )
{
    
SavePlayerDataiId );
    
    
ClearPlayerBitg_iConnectediId );
    
ClearPlayerBitg_iAliveiId );
    
ClearPlayerBitg_iPunishiId );
}

public 
ClientCommand_WarningsiId )
{
    
PrintWarningsiId );
    
    return 
PLUGIN_HANDLED;
}

public 
BanPlayeriId )
{
    if( !
GetPlayerBitg_iConnectediId ) )
    {
        return;
    }
    
    new 
szName32 ]; get_user_nameiIdszNamecharsmaxszName ) );
    
    
client_print_color0print_team_default"^4[TTT]^1 Atencion:^3 %s^1 fue expulsado por^4 %s^1."szNameBAN_REASON );
    
    
server_cmd"amx_addban ^"%s^" %d ^"%s^""g_szPlayerIpiId ], BAN_DURATIONBAN_REASON );
    
server_exec( );
}

public 
Task_SlayPlayeriId )
{
    if( !
GetPlayerBitg_iAliveiId ) )
    {
        return;
    }
    
    static 
iOrigin];
    
    
g_iPlayerShotsiId ] = 0
    
    
user_killiId );
    
get_user_originiIdiOrigin );
    
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_LAVASPLASH );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
message_end( );
    
    
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Superaste el maximo de disparos sin razon y fuiste castigado." );
}

/* =================================================================================
*               [ Private functions ]
* ================================================================================= */

SavePlayerData( const iId )
{
    new 
iValues];
    
    
iValues] = ttt_get_playerdataiIdPD_KARMATEMP );
    
iValues] = g_iPlayerShotsiId ];
    
iValues] = g_iPlayerWarningsiId ];
    
    
TrieSetArrayg_tListg_szPlayerIpiId ], iValuessizeofiValues ) );
}

LoadPlayerData( const iId )
{
    
get_user_ipiIdg_szPlayerIpiId ], charsmaxg_szPlayerIp[ ] ), true );
    
    if( 
TrieKeyExistsg_tListg_szPlayerIpiId ] ) )
    {
        new 
iValues];
        
        
TrieGetArrayg_tListg_szPlayerIpiId ], iValues);
        
TrieDeleteKeyg_tListg_szPlayerIpiId ] );

        
ttt_set_playerdataiIdPD_KARMATEMPiValues] );
        
ttt_set_playerdataiIdPD_KARMAiValues] );
        
        
g_iPlayerShotsiId ] = iValues];
        
g_iPlayerWarningsiId ] = iValues];
        
        if( 
g_iPlayerShotsiId ] >= MAX_SHOTS )
        {
            
SetPlayerBitg_iPunishiId );
        }
    }
    else
    {
        
g_iPlayerShotsiId ] = 0;
        
g_iPlayerWarningsiId ] = 0;
    }
}

PrintWarningsiId )
{
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED )
    {
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Advertencias: ^x03%d de %d^x01 - Disparos sin razon: ^x03%d de %d^x01.^n"g_iPlayerWarningsiId ], MAX_WARNINGSg_iPlayerShotsiId ], MAX_SHOTS );
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Si alcanzas el maximo seras castigado con ban u/o slay!" );
    }
}

WarningScreenFade( const iId )
{
    
message_beginMSG_ONE_UNRELIABLEg_iScreenFade_iId );
    
write_short1<<12 );
    
write_short( (1<<12) );
    
write_short0x1000 );
    
write_byte255 );
    
write_byte);
    
write_byte);
    
write_byte50 );
    
message_end( );


No tenés una versión para el 1.8.2 por ahí?
Responder
#29
(20/11/2017, 06:46 AM)Ballers escribió:
(19/11/2017, 12:51 AM)Treki escribió: Se me habrá olvidado, lo siento. No te lo puedo adjuntar ni tampoco puedo actualizar el zip del tema principal, el foro tiene algún problemilla con los adjuntos... te lo dejo por MediaFire.

PD: En su momento cuando configuraba un TTT, me funcionaba mal el plugin de las advertencias que venía con el TTT e hice otro aparte. Como veo que algunos andan buscando lo dejo; no es un item pero... es una utilidad. Debo advertir que saqué varias natives y forwards, por lo que también las van a tener que sacar donde el TTT las esté usando (las utiliza innecesariamente de todas formas).

Código PHP:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <ttt>

/* =================================================================================
*               [ Global stuff ]
* ================================================================================= */

#define GetPlayerBit(%1,%2) ( %1 & ( 1 << ( %2 & 31 ) ) )
#define SetPlayerBit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
#define ClearPlayerBit(%1,%2) ( %1 &= ~( 1 << ( %2 & 31 ) ) )

#define IsPlayerValid(%0) ( 1 <= %0 <= 32 )
#define IsStateValid(%0) ( PC_TRAITOR < %0 < PC_INNOCENT )

const MAX_SHOTS 8;
const 
MIN_KARMA 390;
const 
MAX_WARNINGS 3;
const 
BAN_DURATION 30;

new const 
BAN_REASON[ ] = "Maximo numero de advertencias alcanzado";

new 
Trie:g_tList;

new 
g_iConnected;
new 
g_iAlive;
new 
g_iPunish;
new 
g_iScreenFade;
new 
g_iCommand_Warnings;

new 
g_iPlayerShots33 ];
new 
g_iPlayerWarnings33 ];
new 
g_szPlayerIp33 ][ 32 ];
new 
Float:g_flPlayerLastShot33 ];

/* =================================================================================
*               [ Initialization ]
* ================================================================================= */

public plugin_natives( )
{
    
register_library"ttt" );
}

public 
plugin_init( )
{
    
register_plugin"[TTT] Warning System""1.0""Manu" );
    
    
RegisterHamHam_TakeDamage"player""Forward_PlayerTakeDamage_Post"true );
    
RegisterHamHam_Killed"player""Forward_PlayerKilled_Post"true );
    
RegisterHamHam_Spawn"player""Forward_PlayerSpawn_Post"true );
    
    
g_tList                    TrieCreate( );
    
g_iScreenFade            get_user_msgid"ScreenFade" );
    
g_iCommand_Warnings     ttt_command_add"Advertencias" );
}

/* =================================================================================
*               [ Cross-plugin communication ]
* ================================================================================= */

public ttt_gamemodeiGamemode )
{
    if( 
iGamemode == GAME_STARTED )
    {
        for( new 
iId 1iId <= MAX_PLAYERSiId++ )
        {
            if( !
GetPlayerBitg_iConnectediId ) || ( ttt_get_playerdataiIdPD_KARMATEMP ) > MIN_KARMA ) )
            {
                continue;
            }
            
            
BanPlayeriId );
        }
    }
}

public 
ttt_command_selectediIdiMenuIdszName[ ] )
{
    if( 
iMenuId == g_iCommand_Warnings )
    {
        
PrintWarningsiId );
    }
}

/* =================================================================================
*               [ Hamsandwich forwards ]
* ================================================================================= */

public Forward_PlayerSpawn_PostiId )
{
    
SetPlayerBitg_iAliveiId );
    
    if( 
GetPlayerBitg_iPunishiId ) )
    {
        
ClearPlayerBitg_iPunishiId );
        
        
set_task5.0"Task_SlayPlayer"iId );
    }
    
    
PrintWarningsiId );
}

public 
Forward_PlayerTakeDamage_PostiVictimiInflictoriAttackerFloat:flDamageiBits )
{
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED || !is_user_connectediAttacker ) || ( flDamage 1.0 ) || iAttacker == iVictim )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iAttackerStateiAttackerState ttt_get_alivestateiAttacker );
    static 
iVictimStateiVictimState ttt_get_alivestateiVictim );
    
    if( !
IsStateValidiAttackerState ) || !IsStateValidiVictimState ) )
    {
        return 
HAM_IGNORED;
    }
    
    if ( 
iAttackerState == iVictimState
    
|| ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE )
    || ( 
iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) )
    {
        static 
Float:flGameTimeflGameTime get_gametime( );
        
        if( ( 
flGameTime g_flPlayerLastShotiAttacker ] ) > 1.0 )
        {
            if( ++
g_iPlayerShotsiAttacker ] >= MAX_SHOTS )
            {
                
SetPlayerBitg_iPunishiAttacker );
            }
        }
        
        
g_flPlayerLastShotiAttacker ] = flGameTime;
    }
    
    return 
HAM_IGNORED;
}

public 
Forward_PlayerKilled_PostiVictimiAttackeriShouldGib )
{
    
ClearPlayerBitg_iAliveiVictim );
    
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED || !IsPlayerValidiAttacker ) || !GetPlayerBitg_iConnectediAttacker ) || iAttacker == iVictim )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iAttackerStateiAttackerState ttt_get_alivestateiAttacker );
    static 
iVictimStateiVictimState ttt_get_alivestateiVictim );
    
    if( !
IsStateValidiAttackerState ) || !IsStateValidiVictimState ) )
    {
        return 
HAM_IGNORED;
    }
    
    if ( 
iAttackerState == iVictimState
    
|| ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE )
    || ( 
iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) )
    {
        if( ++
g_iPlayerWarningsiAttacker ] >= MAX_WARNINGS )
        {
            
BanPlayeriAttacker );
        }
        else
        {
            
WarningScreenFadeiAttacker );
        }
    }
    
    return 
HAM_IGNORED;
}

/* =================================================================================
*               [ Client-related ]
* ================================================================================= */

public client_putinserveriId )
{
    
SetPlayerBitg_iConnectediId );
    
    
LoadPlayerDataiId );
}

public 
client_disconnectediId )
{
    
SavePlayerDataiId );
    
    
ClearPlayerBitg_iConnectediId );
    
ClearPlayerBitg_iAliveiId );
    
ClearPlayerBitg_iPunishiId );
}

public 
ClientCommand_WarningsiId )
{
    
PrintWarningsiId );
    
    return 
PLUGIN_HANDLED;
}

public 
BanPlayeriId )
{
    if( !
GetPlayerBitg_iConnectediId ) )
    {
        return;
    }
    
    new 
szName32 ]; get_user_nameiIdszNamecharsmaxszName ) );
    
    
client_print_color0print_team_default"^4[TTT]^1 Atencion:^3 %s^1 fue expulsado por^4 %s^1."szNameBAN_REASON );
    
    
server_cmd"amx_addban ^"%s^" %d ^"%s^""g_szPlayerIpiId ], BAN_DURATIONBAN_REASON );
    
server_exec( );
}

public 
Task_SlayPlayeriId )
{
    if( !
GetPlayerBitg_iAliveiId ) )
    {
        return;
    }
    
    static 
iOrigin];
    
    
g_iPlayerShotsiId ] = 0
    
    
user_killiId );
    
get_user_originiIdiOrigin );
    
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_LAVASPLASH );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
message_end( );
    
    
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Superaste el maximo de disparos sin razon y fuiste castigado." );
}

/* =================================================================================
*               [ Private functions ]
* ================================================================================= */

SavePlayerData( const iId )
{
    new 
iValues];
    
    
iValues] = ttt_get_playerdataiIdPD_KARMATEMP );
    
iValues] = g_iPlayerShotsiId ];
    
iValues] = g_iPlayerWarningsiId ];
    
    
TrieSetArrayg_tListg_szPlayerIpiId ], iValuessizeofiValues ) );
}

LoadPlayerData( const iId )
{
    
get_user_ipiIdg_szPlayerIpiId ], charsmaxg_szPlayerIp[ ] ), true );
    
    if( 
TrieKeyExistsg_tListg_szPlayerIpiId ] ) )
    {
        new 
iValues];
        
        
TrieGetArrayg_tListg_szPlayerIpiId ], iValues);
        
TrieDeleteKeyg_tListg_szPlayerIpiId ] );

        
ttt_set_playerdataiIdPD_KARMATEMPiValues] );
        
ttt_set_playerdataiIdPD_KARMAiValues] );
        
        
g_iPlayerShotsiId ] = iValues];
        
g_iPlayerWarningsiId ] = iValues];
        
        if( 
g_iPlayerShotsiId ] >= MAX_SHOTS )
        {
            
SetPlayerBitg_iPunishiId );
        }
    }
    else
    {
        
g_iPlayerShotsiId ] = 0;
        
g_iPlayerWarningsiId ] = 0;
    }
}

PrintWarningsiId )
{
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED )
    {
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Advertencias: ^x03%d de %d^x01 - Disparos sin razon: ^x03%d de %d^x01.^n"g_iPlayerWarningsiId ], MAX_WARNINGSg_iPlayerShotsiId ], MAX_SHOTS );
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Si alcanzas el maximo seras castigado con ban u/o slay!" );
    }
}

WarningScreenFade( const iId )
{
    
message_beginMSG_ONE_UNRELIABLEg_iScreenFade_iId );
    
write_short1<<12 );
    
write_short( (1<<12) );
    
write_short0x1000 );
    
write_byte255 );
    
write_byte);
    
write_byte);
    
write_byte50 );
    
message_end( );


No tenés una versión para el 1.8.2 por ahí?

Código PHP:
public ttt_gamemodeiGamemode )
{
    if( 
iGamemode == GAME_STARTED )
    {
        for( new 
iId 1iId <= MAX_PLAYERSiId++ )
        {
            if( !
GetPlayerBitg_iConnectediId ) || ( ttt_get_playerdataiIdPD_KARMATEMP ) > MIN_KARMA ) )
            {
                continue;
            }
            
            
BanPlayeriId );
        }
    }


---->

Código PHP:
public ttt_gamemodeiGamemode )
{
    if( 
iGamemode == GAME_STARTED )
    {
        for( new 
iId 1iId <= get_maxplayers(); iId++ )
        {
            if( !
GetPlayerBitg_iConnectediId ) || ( ttt_get_playerdataiIdPD_KARMATEMP ) > MIN_KARMA ) )
            {
                continue;
            }
            
            
BanPlayeriId );
        }
    }


(20/11/2017, 06:46 AM)Ballers escribió:
(19/11/2017, 12:51 AM)Treki escribió: Se me habrá olvidado, lo siento. No te lo puedo adjuntar ni tampoco puedo actualizar el zip del tema principal, el foro tiene algún problemilla con los adjuntos... te lo dejo por MediaFire.

PD: En su momento cuando configuraba un TTT, me funcionaba mal el plugin de las advertencias que venía con el TTT e hice otro aparte. Como veo que algunos andan buscando lo dejo; no es un item pero... es una utilidad. Debo advertir que saqué varias natives y forwards, por lo que también las van a tener que sacar donde el TTT las esté usando (las utiliza innecesariamente de todas formas).

Código PHP:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <ttt>

/* =================================================================================
*               [ Global stuff ]
* ================================================================================= */

#define GetPlayerBit(%1,%2) ( %1 & ( 1 << ( %2 & 31 ) ) )
#define SetPlayerBit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
#define ClearPlayerBit(%1,%2) ( %1 &= ~( 1 << ( %2 & 31 ) ) )

#define IsPlayerValid(%0) ( 1 <= %0 <= 32 )
#define IsStateValid(%0) ( PC_TRAITOR < %0 < PC_INNOCENT )

const MAX_SHOTS 8;
const 
MIN_KARMA 390;
const 
MAX_WARNINGS 3;
const 
BAN_DURATION 30;

new const 
BAN_REASON[ ] = "Maximo numero de advertencias alcanzado";

new 
Trie:g_tList;

new 
g_iConnected;
new 
g_iAlive;
new 
g_iPunish;
new 
g_iScreenFade;
new 
g_iCommand_Warnings;

new 
g_iPlayerShots33 ];
new 
g_iPlayerWarnings33 ];
new 
g_szPlayerIp33 ][ 32 ];
new 
Float:g_flPlayerLastShot33 ];

/* =================================================================================
*               [ Initialization ]
* ================================================================================= */

public plugin_natives( )
{
    
register_library"ttt" );
}

public 
plugin_init( )
{
    
register_plugin"[TTT] Warning System""1.0""Manu" );
    
    
RegisterHamHam_TakeDamage"player""Forward_PlayerTakeDamage_Post"true );
    
RegisterHamHam_Killed"player""Forward_PlayerKilled_Post"true );
    
RegisterHamHam_Spawn"player""Forward_PlayerSpawn_Post"true );
    
    
g_tList                    TrieCreate( );
    
g_iScreenFade            get_user_msgid"ScreenFade" );
    
g_iCommand_Warnings     ttt_command_add"Advertencias" );
}

/* =================================================================================
*               [ Cross-plugin communication ]
* ================================================================================= */

public ttt_gamemodeiGamemode )
{
    if( 
iGamemode == GAME_STARTED )
    {
        for( new 
iId 1iId <= MAX_PLAYERSiId++ )
        {
            if( !
GetPlayerBitg_iConnectediId ) || ( ttt_get_playerdataiIdPD_KARMATEMP ) > MIN_KARMA ) )
            {
                continue;
            }
            
            
BanPlayeriId );
        }
    }
}

public 
ttt_command_selectediIdiMenuIdszName[ ] )
{
    if( 
iMenuId == g_iCommand_Warnings )
    {
        
PrintWarningsiId );
    }
}

/* =================================================================================
*               [ Hamsandwich forwards ]
* ================================================================================= */

public Forward_PlayerSpawn_PostiId )
{
    
SetPlayerBitg_iAliveiId );
    
    if( 
GetPlayerBitg_iPunishiId ) )
    {
        
ClearPlayerBitg_iPunishiId );
        
        
set_task5.0"Task_SlayPlayer"iId );
    }
    
    
PrintWarningsiId );
}

public 
Forward_PlayerTakeDamage_PostiVictimiInflictoriAttackerFloat:flDamageiBits )
{
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED || !is_user_connectediAttacker ) || ( flDamage 1.0 ) || iAttacker == iVictim )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iAttackerStateiAttackerState ttt_get_alivestateiAttacker );
    static 
iVictimStateiVictimState ttt_get_alivestateiVictim );
    
    if( !
IsStateValidiAttackerState ) || !IsStateValidiVictimState ) )
    {
        return 
HAM_IGNORED;
    }
    
    if ( 
iAttackerState == iVictimState
    
|| ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE )
    || ( 
iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) )
    {
        static 
Float:flGameTimeflGameTime get_gametime( );
        
        if( ( 
flGameTime g_flPlayerLastShotiAttacker ] ) > 1.0 )
        {
            if( ++
g_iPlayerShotsiAttacker ] >= MAX_SHOTS )
            {
                
SetPlayerBitg_iPunishiAttacker );
            }
        }
        
        
g_flPlayerLastShotiAttacker ] = flGameTime;
    }
    
    return 
HAM_IGNORED;
}

public 
Forward_PlayerKilled_PostiVictimiAttackeriShouldGib )
{
    
ClearPlayerBitg_iAliveiVictim );
    
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED || !IsPlayerValidiAttacker ) || !GetPlayerBitg_iConnectediAttacker ) || iAttacker == iVictim )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iAttackerStateiAttackerState ttt_get_alivestateiAttacker );
    static 
iVictimStateiVictimState ttt_get_alivestateiVictim );
    
    if( !
IsStateValidiAttackerState ) || !IsStateValidiVictimState ) )
    {
        return 
HAM_IGNORED;
    }
    
    if ( 
iAttackerState == iVictimState
    
|| ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE )
    || ( 
iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) )
    {
        if( ++
g_iPlayerWarningsiAttacker ] >= MAX_WARNINGS )
        {
            
BanPlayeriAttacker );
        }
        else
        {
            
WarningScreenFadeiAttacker );
        }
    }
    
    return 
HAM_IGNORED;
}

/* =================================================================================
*               [ Client-related ]
* ================================================================================= */

public client_putinserveriId )
{
    
SetPlayerBitg_iConnectediId );
    
    
LoadPlayerDataiId );
}

public 
client_disconnectediId )
{
    
SavePlayerDataiId );
    
    
ClearPlayerBitg_iConnectediId );
    
ClearPlayerBitg_iAliveiId );
    
ClearPlayerBitg_iPunishiId );
}

public 
ClientCommand_WarningsiId )
{
    
PrintWarningsiId );
    
    return 
PLUGIN_HANDLED;
}

public 
BanPlayeriId )
{
    if( !
GetPlayerBitg_iConnectediId ) )
    {
        return;
    }
    
    new 
szName32 ]; get_user_nameiIdszNamecharsmaxszName ) );
    
    
client_print_color0print_team_default"^4[TTT]^1 Atencion:^3 %s^1 fue expulsado por^4 %s^1."szNameBAN_REASON );
    
    
server_cmd"amx_addban ^"%s^" %d ^"%s^""g_szPlayerIpiId ], BAN_DURATIONBAN_REASON );
    
server_exec( );
}

public 
Task_SlayPlayeriId )
{
    if( !
GetPlayerBitg_iAliveiId ) )
    {
        return;
    }
    
    static 
iOrigin];
    
    
g_iPlayerShotsiId ] = 0
    
    
user_killiId );
    
get_user_originiIdiOrigin );
    
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_LAVASPLASH );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
message_end( );
    
    
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Superaste el maximo de disparos sin razon y fuiste castigado." );
}

/* =================================================================================
*               [ Private functions ]
* ================================================================================= */

SavePlayerData( const iId )
{
    new 
iValues];
    
    
iValues] = ttt_get_playerdataiIdPD_KARMATEMP );
    
iValues] = g_iPlayerShotsiId ];
    
iValues] = g_iPlayerWarningsiId ];
    
    
TrieSetArrayg_tListg_szPlayerIpiId ], iValuessizeofiValues ) );
}

LoadPlayerData( const iId )
{
    
get_user_ipiIdg_szPlayerIpiId ], charsmaxg_szPlayerIp[ ] ), true );
    
    if( 
TrieKeyExistsg_tListg_szPlayerIpiId ] ) )
    {
        new 
iValues];
        
        
TrieGetArrayg_tListg_szPlayerIpiId ], iValues);
        
TrieDeleteKeyg_tListg_szPlayerIpiId ] );

        
ttt_set_playerdataiIdPD_KARMATEMPiValues] );
        
ttt_set_playerdataiIdPD_KARMAiValues] );
        
        
g_iPlayerShotsiId ] = iValues];
        
g_iPlayerWarningsiId ] = iValues];
        
        if( 
g_iPlayerShotsiId ] >= MAX_SHOTS )
        {
            
SetPlayerBitg_iPunishiId );
        }
    }
    else
    {
        
g_iPlayerShotsiId ] = 0;
        
g_iPlayerWarningsiId ] = 0;
    }
}

PrintWarningsiId )
{
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED )
    {
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Advertencias: ^x03%d de %d^x01 - Disparos sin razon: ^x03%d de %d^x01.^n"g_iPlayerWarningsiId ], MAX_WARNINGSg_iPlayerShotsiId ], MAX_SHOTS );
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Si alcanzas el maximo seras castigado con ban u/o slay!" );
    }
}

WarningScreenFade( const iId )
{
    
message_beginMSG_ONE_UNRELIABLEg_iScreenFade_iId );
    
write_short1<<12 );
    
write_short( (1<<12) );
    
write_short0x1000 );
    
write_byte255 );
    
write_byte);
    
write_byte);
    
write_byte50 );
    
message_end( );


No tenés una versión para el 1.8.2 por ahí?

Nothingdohere

Código PHP:
public ttt_gamemodeiGamemode )
{
    if( 
iGamemode == GAME_STARTED )
    {
        for( new 
iId 1iId <= MAX_PLAYERSiId++ )
        {
            if( !
GetPlayerBitg_iConnectediId ) || ( ttt_get_playerdataiIdPD_KARMATEMP ) > MIN_KARMA ) )
            {
                continue;
            }
            
            
BanPlayeriId );
        }
    }


---->

Código PHP:
public ttt_gamemodeiGamemode )
{
    if( 
iGamemode == GAME_STARTED )
    {
        for( new 
iId 1iId <= get_maxplayers(); iId++ )
        {
            if( !
GetPlayerBitg_iConnectediId ) || ( ttt_get_playerdataiIdPD_KARMATEMP ) > MIN_KARMA ) )
            {
                continue;
            }
            
            
BanPlayeriId );
        }
    }

Responder
#30
(20/11/2017, 06:46 AM)Ballers escribió:
(19/11/2017, 12:51 AM)Treki escribió: Se me habrá olvidado, lo siento. No te lo puedo adjuntar ni tampoco puedo actualizar el zip del tema principal, el foro tiene algún problemilla con los adjuntos... te lo dejo por MediaFire.

PD: En su momento cuando configuraba un TTT, me funcionaba mal el plugin de las advertencias que venía con el TTT e hice otro aparte. Como veo que algunos andan buscando lo dejo; no es un item pero... es una utilidad. Debo advertir que saqué varias natives y forwards, por lo que también las van a tener que sacar donde el TTT las esté usando (las utiliza innecesariamente de todas formas).

Código PHP:
#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <ttt>

/* =================================================================================
*               [ Global stuff ]
* ================================================================================= */

#define GetPlayerBit(%1,%2) ( %1 & ( 1 << ( %2 & 31 ) ) )
#define SetPlayerBit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
#define ClearPlayerBit(%1,%2) ( %1 &= ~( 1 << ( %2 & 31 ) ) )

#define IsPlayerValid(%0) ( 1 <= %0 <= 32 )
#define IsStateValid(%0) ( PC_TRAITOR < %0 < PC_INNOCENT )

const MAX_SHOTS 8;
const 
MIN_KARMA 390;
const 
MAX_WARNINGS 3;
const 
BAN_DURATION 30;

new const 
BAN_REASON[ ] = "Maximo numero de advertencias alcanzado";

new 
Trie:g_tList;

new 
g_iConnected;
new 
g_iAlive;
new 
g_iPunish;
new 
g_iScreenFade;
new 
g_iCommand_Warnings;

new 
g_iPlayerShots33 ];
new 
g_iPlayerWarnings33 ];
new 
g_szPlayerIp33 ][ 32 ];
new 
Float:g_flPlayerLastShot33 ];

/* =================================================================================
*               [ Initialization ]
* ================================================================================= */

public plugin_natives( )
{
    
register_library"ttt" );
}

public 
plugin_init( )
{
    
register_plugin"[TTT] Warning System""1.0""Manu" );
    
    
RegisterHamHam_TakeDamage"player""Forward_PlayerTakeDamage_Post"true );
    
RegisterHamHam_Killed"player""Forward_PlayerKilled_Post"true );
    
RegisterHamHam_Spawn"player""Forward_PlayerSpawn_Post"true );
    
    
g_tList                    TrieCreate( );
    
g_iScreenFade            get_user_msgid"ScreenFade" );
    
g_iCommand_Warnings     ttt_command_add"Advertencias" );
}

/* =================================================================================
*               [ Cross-plugin communication ]
* ================================================================================= */

public ttt_gamemodeiGamemode )
{
    if( 
iGamemode == GAME_STARTED )
    {
        for( new 
iId 1iId <= MAX_PLAYERSiId++ )
        {
            if( !
GetPlayerBitg_iConnectediId ) || ( ttt_get_playerdataiIdPD_KARMATEMP ) > MIN_KARMA ) )
            {
                continue;
            }
            
            
BanPlayeriId );
        }
    }
}

public 
ttt_command_selectediIdiMenuIdszName[ ] )
{
    if( 
iMenuId == g_iCommand_Warnings )
    {
        
PrintWarningsiId );
    }
}

/* =================================================================================
*               [ Hamsandwich forwards ]
* ================================================================================= */

public Forward_PlayerSpawn_PostiId )
{
    
SetPlayerBitg_iAliveiId );
    
    if( 
GetPlayerBitg_iPunishiId ) )
    {
        
ClearPlayerBitg_iPunishiId );
        
        
set_task5.0"Task_SlayPlayer"iId );
    }
    
    
PrintWarningsiId );
}

public 
Forward_PlayerTakeDamage_PostiVictimiInflictoriAttackerFloat:flDamageiBits )
{
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED || !is_user_connectediAttacker ) || ( flDamage 1.0 ) || iAttacker == iVictim )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iAttackerStateiAttackerState ttt_get_alivestateiAttacker );
    static 
iVictimStateiVictimState ttt_get_alivestateiVictim );
    
    if( !
IsStateValidiAttackerState ) || !IsStateValidiVictimState ) )
    {
        return 
HAM_IGNORED;
    }
    
    if ( 
iAttackerState == iVictimState
    
|| ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE )
    || ( 
iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) )
    {
        static 
Float:flGameTimeflGameTime get_gametime( );
        
        if( ( 
flGameTime g_flPlayerLastShotiAttacker ] ) > 1.0 )
        {
            if( ++
g_iPlayerShotsiAttacker ] >= MAX_SHOTS )
            {
                
SetPlayerBitg_iPunishiAttacker );
            }
        }
        
        
g_flPlayerLastShotiAttacker ] = flGameTime;
    }
    
    return 
HAM_IGNORED;
}

public 
Forward_PlayerKilled_PostiVictimiAttackeriShouldGib )
{
    
ClearPlayerBitg_iAliveiVictim );
    
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED || !IsPlayerValidiAttacker ) || !GetPlayerBitg_iConnectediAttacker ) || iAttacker == iVictim )
    {
        return 
HAM_IGNORED;
    }
    
    static 
iAttackerStateiAttackerState ttt_get_alivestateiAttacker );
    static 
iVictimStateiVictimState ttt_get_alivestateiVictim );
    
    if( !
IsStateValidiAttackerState ) || !IsStateValidiVictimState ) )
    {
        return 
HAM_IGNORED;
    }
    
    if ( 
iAttackerState == iVictimState
    
|| ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE )
    || ( 
iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) )
    {
        if( ++
g_iPlayerWarningsiAttacker ] >= MAX_WARNINGS )
        {
            
BanPlayeriAttacker );
        }
        else
        {
            
WarningScreenFadeiAttacker );
        }
    }
    
    return 
HAM_IGNORED;
}

/* =================================================================================
*               [ Client-related ]
* ================================================================================= */

public client_putinserveriId )
{
    
SetPlayerBitg_iConnectediId );
    
    
LoadPlayerDataiId );
}

public 
client_disconnectediId )
{
    
SavePlayerDataiId );
    
    
ClearPlayerBitg_iConnectediId );
    
ClearPlayerBitg_iAliveiId );
    
ClearPlayerBitg_iPunishiId );
}

public 
ClientCommand_WarningsiId )
{
    
PrintWarningsiId );
    
    return 
PLUGIN_HANDLED;
}

public 
BanPlayeriId )
{
    if( !
GetPlayerBitg_iConnectediId ) )
    {
        return;
    }
    
    new 
szName32 ]; get_user_nameiIdszNamecharsmaxszName ) );
    
    
client_print_color0print_team_default"^4[TTT]^1 Atencion:^3 %s^1 fue expulsado por^4 %s^1."szNameBAN_REASON );
    
    
server_cmd"amx_addban ^"%s^" %d ^"%s^""g_szPlayerIpiId ], BAN_DURATIONBAN_REASON );
    
server_exec( );
}

public 
Task_SlayPlayeriId )
{
    if( !
GetPlayerBitg_iAliveiId ) )
    {
        return;
    }
    
    static 
iOrigin];
    
    
g_iPlayerShotsiId ] = 0
    
    
user_killiId );
    
get_user_originiIdiOrigin );
    
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
    
write_byteTE_LAVASPLASH );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
write_coordiOrigin] );
    
message_end( );
    
    
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Superaste el maximo de disparos sin razon y fuiste castigado." );
}

/* =================================================================================
*               [ Private functions ]
* ================================================================================= */

SavePlayerData( const iId )
{
    new 
iValues];
    
    
iValues] = ttt_get_playerdataiIdPD_KARMATEMP );
    
iValues] = g_iPlayerShotsiId ];
    
iValues] = g_iPlayerWarningsiId ];
    
    
TrieSetArrayg_tListg_szPlayerIpiId ], iValuessizeofiValues ) );
}

LoadPlayerData( const iId )
{
    
get_user_ipiIdg_szPlayerIpiId ], charsmaxg_szPlayerIp[ ] ), true );
    
    if( 
TrieKeyExistsg_tListg_szPlayerIpiId ] ) )
    {
        new 
iValues];
        
        
TrieGetArrayg_tListg_szPlayerIpiId ], iValues);
        
TrieDeleteKeyg_tListg_szPlayerIpiId ] );

        
ttt_set_playerdataiIdPD_KARMATEMPiValues] );
        
ttt_set_playerdataiIdPD_KARMAiValues] );
        
        
g_iPlayerShotsiId ] = iValues];
        
g_iPlayerWarningsiId ] = iValues];
        
        if( 
g_iPlayerShotsiId ] >= MAX_SHOTS )
        {
            
SetPlayerBitg_iPunishiId );
        }
    }
    else
    {
        
g_iPlayerShotsiId ] = 0;
        
g_iPlayerWarningsiId ] = 0;
    }
}

PrintWarningsiId )
{
    if( 
ttt_get_globalinfoGI_GAMEMODE ) != GAME_STARTED )
    {
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Advertencias: ^x03%d de %d^x01 - Disparos sin razon: ^x03%d de %d^x01.^n"g_iPlayerWarningsiId ], MAX_WARNINGSg_iPlayerShotsiId ], MAX_SHOTS );
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Si alcanzas el maximo seras castigado con ban u/o slay!" );
    }
}

WarningScreenFade( const iId )
{
    
message_beginMSG_ONE_UNRELIABLEg_iScreenFade_iId );
    
write_short1<<12 );
    
write_short( (1<<12) );
    
write_short0x1000 );
    
write_byte255 );
    
write_byte);
    
write_byte);
    
write_byte50 );
    
message_end( );


No tenés una versión para el 1.8.2 por ahí?

Para pasarlo a 1.8.2, la forma fácil podría ser:

- Pasar las funciones client_print_color() a una de ColorChat común.
- Agregar #define MAX_PLAYERS 32.

PD: Como dije anteriormente, el Warning System default tiene algunas natives a las que yo no les dí soporte en este plugin. Pueden agregárselas o remover el uso de esas natives donde sea que se utilicen.
No hago trabajos privados. Si necesitás ayuda, abrí un nuevo tema.
¿Buscás un ejemplo o algún modo de juego? Podés echarle un vistazo a mis aportes
.
Responder
#31
Hola queria saber como agrego el "Detective Falso" a la tienda de Traidores porque el plugin lo tengo pero aun asi no aparece, me fije en el Archivo de configuracion "ttt_mod" (Donde estan la mayoria de items) y no esta
Responder
#32
(02/01/2018, 08:01 PM)Eze Lagoss escribió: Hola queria saber como agrego el "Detective Falso" a la tienda de Traidores porque el plugin lo tengo pero aun asi no aparece, me fije en el Archivo de configuracion "ttt_mod" (Donde estan la mayoria de items) y no esta

y, lo tenés que agregar vos en plugins-ttt.ini
Responder
#33
Hay un problema con el item Arma Falsa, el último model en la lista nunca funciona, no aparece nunca (Acabo de comprobarlo agregando un model delante, el último model nunca es utilizado por el plugin)
Responder
#34
Código PHP:
entity_set_modeliEntg_szFakeWeaponModelrandomsizeofg_szFakeWeaponModel ) - ) ] ); 

Efectivamente. Para solucionarlo hay que remover el -1 que esta después del sizeof( ).
No hago trabajos privados. Si necesitás ayuda, abrí un nuevo tema.
¿Buscás un ejemplo o algún modo de juego? Podés echarle un vistazo a mis aportes
.
Responder
#35
Hola quisiera saber como instalar el PHP de Arma falsa en mi servidor de TTT por favor. Gracias!
Responder
#36
bajate el amxx studio
lo guardas como .sma, te bajas los includes necesarios y apachas F9 y te da un .amxx y lo subes a tu sv Whatever
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#37
(03/12/2018, 08:35 PM)Hypnotize escribió: bajate el amxx studio
lo guardas como .sma, te bajas los includes necesarios y apachas F9 y te da un .amxx y lo subes a tu sv Whatever

y como se llama el plugin?, como y de donde bajo los includes?. Perdon por las preguntas. Es que tengo un servidor de TTT y me falta este plugin. Gracias!
Responder
#38
Código PHP:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
#include <ttt>
#include <xs>

#define isPlayerValid(%0) ( 1 <= %0 <= 32 )

enum _:Place_Data
{
    
Place_Map32 ],
    
Float:Place_Coords]
}

new const 
Float:g_ePlaces[ ][ Place_Data ] =
{
    { 
"aim_crazyjump_2015", { 448.4641411224.42822237.031250 } },
    { 
"aim_crazyjump_2015", { 568.875549, -854.46173037.031250 } },
    { 
"cs_familyguy", { -529.234802915.91851836.031250 } },
    { 
"ttt_towers_fix", { -64.000000, -1184.00000020.031250 } }
};

new const 
g_szFakeWeaponClassname[ ] = "FakeWeap";
new const 
g_szFakeWeaponModel[ ][ ] = { "models/w_ump45.mdl","models/w_m3.mdl","models/w_mac10.mdl","models/w_xm1014.mdl","models/w_p90.mdl" };

new 
g_iItembool:g_bBlockg_szCurrentMap32 ];

public 
plugin_precache( )
{
    for( new 
i;sizeof g_szFakeWeaponModel;i++ )
        
precache_modelg_szFakeWeaponModel] );
}
    
public 
plugin_init( )
{
    
register_plugin"[TTT] Item: Mine"TTT_VERSION"Manu" );
    
    
register_thinkg_szFakeWeaponClassname"think_FakeWeapon" );
    
register_touchg_szFakeWeaponClassname"player""touch_FakeWeapon" );
    
    
get_mapnameg_szCurrentMapcharsmaxg_szCurrentMap ) );
    
    for( new 
isizeof g_ePlacesi++ )
    {
        if( 
equalg_szCurrentMapg_ePlaces][ Place_Map ] ) )
        {
            
g_bBlock true;
            
            break;
        }
    }
}

public 
ttt_plugin_cfg( ) g_iItem ttt_buymenu_add"Arma falsa"2PC_TRAITOR );

public 
ttt_item_selectediIdiItemszName[ ], iPrice )
{
    if( 
g_iItem == iItem )
    {
        
CreateFakeWeaponiId );
        
        return 
PLUGIN_HANDLED;
    }

    return 
PLUGIN_CONTINUE;
}

public 
ttt_gamemodeiGameMode )
{
    if( 
iGameMode == GAME_ENDED )
    {
        new 
iEnt;
        
        while( ( 
iEnt find_ent_by_classiEntg_szFakeWeaponClassname ) ) != )
        {
            
entity_set_intiEntEV_INT_iuser1);
            
entity_set_floatiEntEV_FL_nextthinkget_gametime( ) + 0.1 );
        }
    }
}

public 
touch_FakeWeaponiEntiId )
{
    if( 
is_valid_entiEnt ) && isPlayerValidiId ) )
    {
        if( 
entity_get_intiEntEV_INT_iuser1 ) <= && is_user_aliveiId ) && ttt_get_playerstateiId ) != PC_TRAITOR )
            
CreateExplosioniEntiId );
    }
}

public 
think_FakeWeaponiEnt )
{
    if( 
is_valid_entiEnt ) )
        
remove_entityiEnt );
}

CreateExplosion( const iEnt, const iId )
{
    static 
iOwneriExplosioniOrigin], Float:flOrigin];
    
    
iOwner entity_get_edictiEntEV_ENT_owner );
    
    if( !
is_user_connectediOwner ) )
    {
        
entity_set_intiEntEV_INT_iuser1);
        
entity_set_floatiEntEV_FL_nextthinkget_gametime( ) + 0.1 );
        
        return 
0;
    }
    
    
iExplosion create_entity"env_explosion" );
    
entity_get_vectoriEntEV_VEC_originflOrigin ); FVecIVecflOriginiOrigin );
    
    if( !
is_valid_entiExplosion ) )
        return 
0;
    
    
entity_set_originiExplosionflOrigin );
    
entity_set_intiExplosionEV_INT_spawnflagsentity_get_intiExplosionEV_INT_spawnflags ) | SF_ENVEXPLOSION_NODAMAGE );
    
    
DispatchKeyValueiExplosion"iMagnitude""100" );
    
DispatchSpawniExplosion );
    
    
force_useiExplosioniExplosion );
    
remove_entityiExplosion );
    
    
ExecuteHamBHam_KillediIdiOwner);
    
    return 
1;
}

CreateFakeWeapon( const iId )
{
    static 
iEntFloat:flOrigin]; iEnt create_entity"info_target" );
    
    if( !
is_valid_entiEnt ) || ( g_bBlock && isPlaceBlockediId ) ) )
    {
        
client_print_coloriIdprint_team_default"^x04[TTT]^x01 No puedes crear un arma falsa en los teleports." );
        
        return 
0;
    }
    
    
entity_set_stringiEntEV_SZ_classnameg_szFakeWeaponClassname );
    
    
entity_set_modeliEntg_szFakeWeaponModelrandomsizeofg_szFakeWeaponModel ) - ) ] );
    
entity_set_sizeiEntFloat:{ -5.0,-5.0,-1.0 }, Float:{ 5.0,5.0,1.0 } );
    
    
entity_set_intiEntEV_INT_movetypeMOVETYPE_TOSS );
    
entity_set_intiEntEV_INT_solidSOLID_TRIGGER );
    
    
entity_get_vectoriIdEV_VEC_originflOrigin );
    
entity_set_originiEntflOrigin );
    
    
entity_set_floatiEntEV_FL_health100.0 );
    
entity_set_floatiEntEV_FL_takedamageDAMAGE_NO );
    
entity_set_edictiEntEV_ENT_owneriId );
    
    
entity_set_floatiEntEV_FL_nextthinkget_gametime( ) + 35.0 );
    
    
drop_to_flooriEnt );
    
    
client_print_coloriIdprint_team_default"^x04[TTT]^x01 Compraste un arma falsa, quien la toque explotara." );
    
    return 
1;
}

isPlaceBlocked( const iId )
{
    static 
Float:flOrigin], Float:flPoint]; entity_get_vectoriIdEV_VEC_originflOrigin );
    
    for( new 
isizeofg_ePlaces ); i++ )
    {
        if( 
equalg_szCurrentMapg_ePlaces][ Place_Map ] ) )
        {
            
xs_vec_copyg_ePlaces][ Place_Coords ], flPoint );
            
            if( 
get_distance_fflOriginflPoint ) < 128.0 )
                return 
true;
        }
    }
    
    return 
false;


los includes ttt y eso los trae el mod de donde los bajaste
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#39
para el caso de la dinamita:

engclient_cmd( iOwner, "drop", "weapon_c4" );

si usan regame y rejapi lo reemplazan por rg_remove_item(iOwner, WEAPON_NAME, true);
Ingeniero agrónomo y desarrollador de Software.

tutoriales-allied
buscas un zp?

"La imitación es la forma más sincera de admiración con la que puede pagar la mediocridad a la grandeza"

Merci Alliedmodders pour m'introduire dans la programmation.
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)