Mensajes: 229
Temas: 59
Registro en: Jun 2015
Reputación:
0
Disculpen, alguien tendria el models/ttt/camera.mdl ???
PD: no esta en el zip
Gracias..
Mensajes: 2,454
Temas: 14
Registro en: Oct 2013
Reputación:
51
19/11/2017, 12:51 AM
(Última modificación: 19/11/2017, 01:03 AM por Manu .)
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_iPlayerShots [ 33 ]; new g_iPlayerWarnings [ 33 ]; new g_szPlayerIp [ 33 ][ 32 ]; new Float : g_flPlayerLastShot [ 33 ]; /* ================================================================================= * [ Initialization ] * ================================================================================= */ public plugin_natives ( ) { register_library ( "ttt" ); } public plugin_init ( ) { register_plugin ( "[TTT] Warning System" , "1.0" , "Manu" ); RegisterHam ( Ham_TakeDamage , "player" , "Forward_PlayerTakeDamage_Post" , true ); RegisterHam ( Ham_Killed , "player" , "Forward_PlayerKilled_Post" , true ); RegisterHam ( Ham_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_gamemode ( iGamemode ) { if( iGamemode == GAME_STARTED ) { for( new iId = 1 ; iId <= MAX_PLAYERS ; iId ++ ) { if( ! GetPlayerBit ( g_iConnected , iId ) || ( ttt_get_playerdata ( iId , PD_KARMATEMP ) > MIN_KARMA ) ) { continue; } BanPlayer ( iId ); } } } public ttt_command_selected ( iId , iMenuId , szName [ ] ) { if( iMenuId == g_iCommand_Warnings ) { PrintWarnings ( iId ); } } /* ================================================================================= * [ Hamsandwich forwards ] * ================================================================================= */ public Forward_PlayerSpawn_Post ( iId ) { SetPlayerBit ( g_iAlive , iId ); if( GetPlayerBit ( g_iPunish , iId ) ) { ClearPlayerBit ( g_iPunish , iId ); set_task ( 5.0 , "Task_SlayPlayer" , iId ); } PrintWarnings ( iId ); } public Forward_PlayerTakeDamage_Post ( iVictim , iInflictor , iAttacker , Float : flDamage , iBits ) { if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED || ! is_user_connected ( iAttacker ) || ( flDamage < 1.0 ) || iAttacker == iVictim ) { return HAM_IGNORED ; } static iAttackerState ; iAttackerState = ttt_get_alivestate ( iAttacker ); static iVictimState ; iVictimState = ttt_get_alivestate ( iVictim ); if( ! IsStateValid ( iAttackerState ) || ! IsStateValid ( iVictimState ) ) { return HAM_IGNORED ; } if ( iAttackerState == iVictimState || ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE ) || ( iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) ) { static Float : flGameTime ; flGameTime = get_gametime ( ); if( ( flGameTime - g_flPlayerLastShot [ iAttacker ] ) > 1.0 ) { if( ++ g_iPlayerShots [ iAttacker ] >= MAX_SHOTS ) { SetPlayerBit ( g_iPunish , iAttacker ); } } g_flPlayerLastShot [ iAttacker ] = flGameTime ; } return HAM_IGNORED ; } public Forward_PlayerKilled_Post ( iVictim , iAttacker , iShouldGib ) { ClearPlayerBit ( g_iAlive , iVictim ); if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED || ! IsPlayerValid ( iAttacker ) || ! GetPlayerBit ( g_iConnected , iAttacker ) || iAttacker == iVictim ) { return HAM_IGNORED ; } static iAttackerState ; iAttackerState = ttt_get_alivestate ( iAttacker ); static iVictimState ; iVictimState = ttt_get_alivestate ( iVictim ); if( ! IsStateValid ( iAttackerState ) || ! IsStateValid ( iVictimState ) ) { return HAM_IGNORED ; } if ( iAttackerState == iVictimState || ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE ) || ( iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) ) { if( ++ g_iPlayerWarnings [ iAttacker ] >= MAX_WARNINGS ) { BanPlayer ( iAttacker ); } else { WarningScreenFade ( iAttacker ); } } return HAM_IGNORED ; } /* ================================================================================= * [ Client-related ] * ================================================================================= */ public client_putinserver ( iId ) { SetPlayerBit ( g_iConnected , iId ); LoadPlayerData ( iId ); } public client_disconnected ( iId ) { SavePlayerData ( iId ); ClearPlayerBit ( g_iConnected , iId ); ClearPlayerBit ( g_iAlive , iId ); ClearPlayerBit ( g_iPunish , iId ); } public ClientCommand_Warnings ( iId ) { PrintWarnings ( iId ); return PLUGIN_HANDLED ; } public BanPlayer ( iId ) { if( ! GetPlayerBit ( g_iConnected , iId ) ) { return; } new szName [ 32 ]; get_user_name ( iId , szName , charsmax ( szName ) ); client_print_color ( 0 , print_team_default , "^4[TTT]^1 Atencion:^3 %s^1 fue expulsado por^4 %s^1." , szName , BAN_REASON ); server_cmd ( "amx_addban ^" % s ^ " %d ^" % s ^ "" , g_szPlayerIp [ iId ], BAN_DURATION , BAN_REASON ); server_exec ( ); } public Task_SlayPlayer ( iId ) { if( ! GetPlayerBit ( g_iAlive , iId ) ) { return; } static iOrigin [ 3 ]; g_iPlayerShots [ iId ] = 0 ; user_kill ( iId ); get_user_origin ( iId , iOrigin ); message_begin ( MSG_BROADCAST , SVC_TEMPENTITY ); write_byte ( TE_LAVASPLASH ); write_coord ( iOrigin [ 0 ] ); write_coord ( iOrigin [ 1 ] ); write_coord ( iOrigin [ 2 ] ); message_end ( ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Superaste el maximo de disparos sin razon y fuiste castigado." ); } /* ================================================================================= * [ Private functions ] * ================================================================================= */ SavePlayerData ( const iId ) { new iValues [ 3 ]; iValues [ 0 ] = ttt_get_playerdata ( iId , PD_KARMATEMP ); iValues [ 1 ] = g_iPlayerShots [ iId ]; iValues [ 2 ] = g_iPlayerWarnings [ iId ]; TrieSetArray ( g_tList , g_szPlayerIp [ iId ], iValues , sizeof ( iValues ) ); } LoadPlayerData ( const iId ) { get_user_ip ( iId , g_szPlayerIp [ iId ], charsmax ( g_szPlayerIp [ ] ), true ); if( TrieKeyExists ( g_tList , g_szPlayerIp [ iId ] ) ) { new iValues [ 3 ]; TrieGetArray ( g_tList , g_szPlayerIp [ iId ], iValues , 3 ); TrieDeleteKey ( g_tList , g_szPlayerIp [ iId ] ); ttt_set_playerdata ( iId , PD_KARMATEMP , iValues [ 0 ] ); ttt_set_playerdata ( iId , PD_KARMA , iValues [ 0 ] ); g_iPlayerShots [ iId ] = iValues [ 1 ]; g_iPlayerWarnings [ iId ] = iValues [ 2 ]; if( g_iPlayerShots [ iId ] >= MAX_SHOTS ) { SetPlayerBit ( g_iPunish , iId ); } } else { g_iPlayerShots [ iId ] = 0 ; g_iPlayerWarnings [ iId ] = 0 ; } } PrintWarnings ( iId ) { if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED ) { client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Advertencias: ^x03%d de %d^x01 - Disparos sin razon: ^x03%d de %d^x01.^n" , g_iPlayerWarnings [ iId ], MAX_WARNINGS , g_iPlayerShots [ iId ], MAX_SHOTS ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Si alcanzas el maximo seras castigado con ban u/o slay!" ); } } WarningScreenFade ( const iId ) { message_begin ( MSG_ONE_UNRELIABLE , g_iScreenFade , _ , iId ); write_short ( 1 << 12 ); write_short ( ( 1 << 12 ) ); write_short ( 0x1000 ); write_byte ( 255 ); write_byte ( 0 ); write_byte ( 0 ); write_byte ( 50 ); 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 .
Mensajes: 791
Temas: 84
Registro en: Sep 2016
Reputación:
6
(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_iPlayerShots [ 33 ]; new g_iPlayerWarnings [ 33 ]; new g_szPlayerIp [ 33 ][ 32 ]; new Float : g_flPlayerLastShot [ 33 ]; /* ================================================================================= * [ Initialization ] * ================================================================================= */ public plugin_natives ( ) { register_library ( "ttt" ); } public plugin_init ( ) { register_plugin ( "[TTT] Warning System" , "1.0" , "Manu" ); RegisterHam ( Ham_TakeDamage , "player" , "Forward_PlayerTakeDamage_Post" , true ); RegisterHam ( Ham_Killed , "player" , "Forward_PlayerKilled_Post" , true ); RegisterHam ( Ham_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_gamemode ( iGamemode ) { if( iGamemode == GAME_STARTED ) { for( new iId = 1 ; iId <= MAX_PLAYERS ; iId ++ ) { if( ! GetPlayerBit ( g_iConnected , iId ) || ( ttt_get_playerdata ( iId , PD_KARMATEMP ) > MIN_KARMA ) ) { continue; } BanPlayer ( iId ); } } } public ttt_command_selected ( iId , iMenuId , szName [ ] ) { if( iMenuId == g_iCommand_Warnings ) { PrintWarnings ( iId ); } } /* ================================================================================= * [ Hamsandwich forwards ] * ================================================================================= */ public Forward_PlayerSpawn_Post ( iId ) { SetPlayerBit ( g_iAlive , iId ); if( GetPlayerBit ( g_iPunish , iId ) ) { ClearPlayerBit ( g_iPunish , iId ); set_task ( 5.0 , "Task_SlayPlayer" , iId ); } PrintWarnings ( iId ); } public Forward_PlayerTakeDamage_Post ( iVictim , iInflictor , iAttacker , Float : flDamage , iBits ) { if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED || ! is_user_connected ( iAttacker ) || ( flDamage < 1.0 ) || iAttacker == iVictim ) { return HAM_IGNORED ; } static iAttackerState ; iAttackerState = ttt_get_alivestate ( iAttacker ); static iVictimState ; iVictimState = ttt_get_alivestate ( iVictim ); if( ! IsStateValid ( iAttackerState ) || ! IsStateValid ( iVictimState ) ) { return HAM_IGNORED ; } if ( iAttackerState == iVictimState || ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE ) || ( iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) ) { static Float : flGameTime ; flGameTime = get_gametime ( ); if( ( flGameTime - g_flPlayerLastShot [ iAttacker ] ) > 1.0 ) { if( ++ g_iPlayerShots [ iAttacker ] >= MAX_SHOTS ) { SetPlayerBit ( g_iPunish , iAttacker ); } } g_flPlayerLastShot [ iAttacker ] = flGameTime ; } return HAM_IGNORED ; } public Forward_PlayerKilled_Post ( iVictim , iAttacker , iShouldGib ) { ClearPlayerBit ( g_iAlive , iVictim ); if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED || ! IsPlayerValid ( iAttacker ) || ! GetPlayerBit ( g_iConnected , iAttacker ) || iAttacker == iVictim ) { return HAM_IGNORED ; } static iAttackerState ; iAttackerState = ttt_get_alivestate ( iAttacker ); static iVictimState ; iVictimState = ttt_get_alivestate ( iVictim ); if( ! IsStateValid ( iAttackerState ) || ! IsStateValid ( iVictimState ) ) { return HAM_IGNORED ; } if ( iAttackerState == iVictimState || ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE ) || ( iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) ) { if( ++ g_iPlayerWarnings [ iAttacker ] >= MAX_WARNINGS ) { BanPlayer ( iAttacker ); } else { WarningScreenFade ( iAttacker ); } } return HAM_IGNORED ; } /* ================================================================================= * [ Client-related ] * ================================================================================= */ public client_putinserver ( iId ) { SetPlayerBit ( g_iConnected , iId ); LoadPlayerData ( iId ); } public client_disconnected ( iId ) { SavePlayerData ( iId ); ClearPlayerBit ( g_iConnected , iId ); ClearPlayerBit ( g_iAlive , iId ); ClearPlayerBit ( g_iPunish , iId ); } public ClientCommand_Warnings ( iId ) { PrintWarnings ( iId ); return PLUGIN_HANDLED ; } public BanPlayer ( iId ) { if( ! GetPlayerBit ( g_iConnected , iId ) ) { return; } new szName [ 32 ]; get_user_name ( iId , szName , charsmax ( szName ) ); client_print_color ( 0 , print_team_default , "^4[TTT]^1 Atencion:^3 %s^1 fue expulsado por^4 %s^1." , szName , BAN_REASON ); server_cmd ( "amx_addban ^" % s ^ " %d ^" % s ^ "" , g_szPlayerIp [ iId ], BAN_DURATION , BAN_REASON ); server_exec ( ); } public Task_SlayPlayer ( iId ) { if( ! GetPlayerBit ( g_iAlive , iId ) ) { return; } static iOrigin [ 3 ]; g_iPlayerShots [ iId ] = 0 ; user_kill ( iId ); get_user_origin ( iId , iOrigin ); message_begin ( MSG_BROADCAST , SVC_TEMPENTITY ); write_byte ( TE_LAVASPLASH ); write_coord ( iOrigin [ 0 ] ); write_coord ( iOrigin [ 1 ] ); write_coord ( iOrigin [ 2 ] ); message_end ( ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Superaste el maximo de disparos sin razon y fuiste castigado." ); } /* ================================================================================= * [ Private functions ] * ================================================================================= */ SavePlayerData ( const iId ) { new iValues [ 3 ]; iValues [ 0 ] = ttt_get_playerdata ( iId , PD_KARMATEMP ); iValues [ 1 ] = g_iPlayerShots [ iId ]; iValues [ 2 ] = g_iPlayerWarnings [ iId ]; TrieSetArray ( g_tList , g_szPlayerIp [ iId ], iValues , sizeof ( iValues ) ); } LoadPlayerData ( const iId ) { get_user_ip ( iId , g_szPlayerIp [ iId ], charsmax ( g_szPlayerIp [ ] ), true ); if( TrieKeyExists ( g_tList , g_szPlayerIp [ iId ] ) ) { new iValues [ 3 ]; TrieGetArray ( g_tList , g_szPlayerIp [ iId ], iValues , 3 ); TrieDeleteKey ( g_tList , g_szPlayerIp [ iId ] ); ttt_set_playerdata ( iId , PD_KARMATEMP , iValues [ 0 ] ); ttt_set_playerdata ( iId , PD_KARMA , iValues [ 0 ] ); g_iPlayerShots [ iId ] = iValues [ 1 ]; g_iPlayerWarnings [ iId ] = iValues [ 2 ]; if( g_iPlayerShots [ iId ] >= MAX_SHOTS ) { SetPlayerBit ( g_iPunish , iId ); } } else { g_iPlayerShots [ iId ] = 0 ; g_iPlayerWarnings [ iId ] = 0 ; } } PrintWarnings ( iId ) { if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED ) { client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Advertencias: ^x03%d de %d^x01 - Disparos sin razon: ^x03%d de %d^x01.^n" , g_iPlayerWarnings [ iId ], MAX_WARNINGS , g_iPlayerShots [ iId ], MAX_SHOTS ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Si alcanzas el maximo seras castigado con ban u/o slay!" ); } } WarningScreenFade ( const iId ) { message_begin ( MSG_ONE_UNRELIABLE , g_iScreenFade , _ , iId ); write_short ( 1 << 12 ); write_short ( ( 1 << 12 ) ); write_short ( 0x1000 ); write_byte ( 255 ); write_byte ( 0 ); write_byte ( 0 ); write_byte ( 50 ); message_end ( ); }
No tenés una versión para el 1.8.2 por ahí?
Mensajes: 3,077
Temas: 33
Registro en: May 2017
Reputación:
34
20/11/2017, 11:24 PM
(Última modificación: 20/11/2017, 11:25 PM por Valentina. .)
(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_iPlayerShots [ 33 ]; new g_iPlayerWarnings [ 33 ]; new g_szPlayerIp [ 33 ][ 32 ]; new Float : g_flPlayerLastShot [ 33 ]; /* ================================================================================= * [ Initialization ] * ================================================================================= */ public plugin_natives ( ) { register_library ( "ttt" ); } public plugin_init ( ) { register_plugin ( "[TTT] Warning System" , "1.0" , "Manu" ); RegisterHam ( Ham_TakeDamage , "player" , "Forward_PlayerTakeDamage_Post" , true ); RegisterHam ( Ham_Killed , "player" , "Forward_PlayerKilled_Post" , true ); RegisterHam ( Ham_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_gamemode ( iGamemode ) { if( iGamemode == GAME_STARTED ) { for( new iId = 1 ; iId <= MAX_PLAYERS ; iId ++ ) { if( ! GetPlayerBit ( g_iConnected , iId ) || ( ttt_get_playerdata ( iId , PD_KARMATEMP ) > MIN_KARMA ) ) { continue; } BanPlayer ( iId ); } } } public ttt_command_selected ( iId , iMenuId , szName [ ] ) { if( iMenuId == g_iCommand_Warnings ) { PrintWarnings ( iId ); } } /* ================================================================================= * [ Hamsandwich forwards ] * ================================================================================= */ public Forward_PlayerSpawn_Post ( iId ) { SetPlayerBit ( g_iAlive , iId ); if( GetPlayerBit ( g_iPunish , iId ) ) { ClearPlayerBit ( g_iPunish , iId ); set_task ( 5.0 , "Task_SlayPlayer" , iId ); } PrintWarnings ( iId ); } public Forward_PlayerTakeDamage_Post ( iVictim , iInflictor , iAttacker , Float : flDamage , iBits ) { if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED || ! is_user_connected ( iAttacker ) || ( flDamage < 1.0 ) || iAttacker == iVictim ) { return HAM_IGNORED ; } static iAttackerState ; iAttackerState = ttt_get_alivestate ( iAttacker ); static iVictimState ; iVictimState = ttt_get_alivestate ( iVictim ); if( ! IsStateValid ( iAttackerState ) || ! IsStateValid ( iVictimState ) ) { return HAM_IGNORED ; } if ( iAttackerState == iVictimState || ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE ) || ( iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) ) { static Float : flGameTime ; flGameTime = get_gametime ( ); if( ( flGameTime - g_flPlayerLastShot [ iAttacker ] ) > 1.0 ) { if( ++ g_iPlayerShots [ iAttacker ] >= MAX_SHOTS ) { SetPlayerBit ( g_iPunish , iAttacker ); } } g_flPlayerLastShot [ iAttacker ] = flGameTime ; } return HAM_IGNORED ; } public Forward_PlayerKilled_Post ( iVictim , iAttacker , iShouldGib ) { ClearPlayerBit ( g_iAlive , iVictim ); if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED || ! IsPlayerValid ( iAttacker ) || ! GetPlayerBit ( g_iConnected , iAttacker ) || iAttacker == iVictim ) { return HAM_IGNORED ; } static iAttackerState ; iAttackerState = ttt_get_alivestate ( iAttacker ); static iVictimState ; iVictimState = ttt_get_alivestate ( iVictim ); if( ! IsStateValid ( iAttackerState ) || ! IsStateValid ( iVictimState ) ) { return HAM_IGNORED ; } if ( iAttackerState == iVictimState || ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE ) || ( iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) ) { if( ++ g_iPlayerWarnings [ iAttacker ] >= MAX_WARNINGS ) { BanPlayer ( iAttacker ); } else { WarningScreenFade ( iAttacker ); } } return HAM_IGNORED ; } /* ================================================================================= * [ Client-related ] * ================================================================================= */ public client_putinserver ( iId ) { SetPlayerBit ( g_iConnected , iId ); LoadPlayerData ( iId ); } public client_disconnected ( iId ) { SavePlayerData ( iId ); ClearPlayerBit ( g_iConnected , iId ); ClearPlayerBit ( g_iAlive , iId ); ClearPlayerBit ( g_iPunish , iId ); } public ClientCommand_Warnings ( iId ) { PrintWarnings ( iId ); return PLUGIN_HANDLED ; } public BanPlayer ( iId ) { if( ! GetPlayerBit ( g_iConnected , iId ) ) { return; } new szName [ 32 ]; get_user_name ( iId , szName , charsmax ( szName ) ); client_print_color ( 0 , print_team_default , "^4[TTT]^1 Atencion:^3 %s^1 fue expulsado por^4 %s^1." , szName , BAN_REASON ); server_cmd ( "amx_addban ^" % s ^ " %d ^" % s ^ "" , g_szPlayerIp [ iId ], BAN_DURATION , BAN_REASON ); server_exec ( ); } public Task_SlayPlayer ( iId ) { if( ! GetPlayerBit ( g_iAlive , iId ) ) { return; } static iOrigin [ 3 ]; g_iPlayerShots [ iId ] = 0 ; user_kill ( iId ); get_user_origin ( iId , iOrigin ); message_begin ( MSG_BROADCAST , SVC_TEMPENTITY ); write_byte ( TE_LAVASPLASH ); write_coord ( iOrigin [ 0 ] ); write_coord ( iOrigin [ 1 ] ); write_coord ( iOrigin [ 2 ] ); message_end ( ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Superaste el maximo de disparos sin razon y fuiste castigado." ); } /* ================================================================================= * [ Private functions ] * ================================================================================= */ SavePlayerData ( const iId ) { new iValues [ 3 ]; iValues [ 0 ] = ttt_get_playerdata ( iId , PD_KARMATEMP ); iValues [ 1 ] = g_iPlayerShots [ iId ]; iValues [ 2 ] = g_iPlayerWarnings [ iId ]; TrieSetArray ( g_tList , g_szPlayerIp [ iId ], iValues , sizeof ( iValues ) ); } LoadPlayerData ( const iId ) { get_user_ip ( iId , g_szPlayerIp [ iId ], charsmax ( g_szPlayerIp [ ] ), true ); if( TrieKeyExists ( g_tList , g_szPlayerIp [ iId ] ) ) { new iValues [ 3 ]; TrieGetArray ( g_tList , g_szPlayerIp [ iId ], iValues , 3 ); TrieDeleteKey ( g_tList , g_szPlayerIp [ iId ] ); ttt_set_playerdata ( iId , PD_KARMATEMP , iValues [ 0 ] ); ttt_set_playerdata ( iId , PD_KARMA , iValues [ 0 ] ); g_iPlayerShots [ iId ] = iValues [ 1 ]; g_iPlayerWarnings [ iId ] = iValues [ 2 ]; if( g_iPlayerShots [ iId ] >= MAX_SHOTS ) { SetPlayerBit ( g_iPunish , iId ); } } else { g_iPlayerShots [ iId ] = 0 ; g_iPlayerWarnings [ iId ] = 0 ; } } PrintWarnings ( iId ) { if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED ) { client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Advertencias: ^x03%d de %d^x01 - Disparos sin razon: ^x03%d de %d^x01.^n" , g_iPlayerWarnings [ iId ], MAX_WARNINGS , g_iPlayerShots [ iId ], MAX_SHOTS ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Si alcanzas el maximo seras castigado con ban u/o slay!" ); } } WarningScreenFade ( const iId ) { message_begin ( MSG_ONE_UNRELIABLE , g_iScreenFade , _ , iId ); write_short ( 1 << 12 ); write_short ( ( 1 << 12 ) ); write_short ( 0x1000 ); write_byte ( 255 ); write_byte ( 0 ); write_byte ( 0 ); write_byte ( 50 ); message_end ( ); }
No tenés una versión para el 1.8.2 por ahí?
Código PHP:
public ttt_gamemode ( iGamemode ) { if( iGamemode == GAME_STARTED ) { for( new iId = 1 ; iId <= MAX_PLAYERS ; iId ++ ) { if( ! GetPlayerBit ( g_iConnected , iId ) || ( ttt_get_playerdata ( iId , PD_KARMATEMP ) > MIN_KARMA ) ) { continue; } BanPlayer ( iId ); } } }
---->
Código PHP:
public ttt_gamemode ( iGamemode ) { if( iGamemode == GAME_STARTED ) { for( new iId = 1 ; iId <= get_maxplayers (); iId ++ ) { if( ! GetPlayerBit ( g_iConnected , iId ) || ( ttt_get_playerdata ( iId , PD_KARMATEMP ) > MIN_KARMA ) ) { continue; } BanPlayer ( iId ); } } }
(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_iPlayerShots [ 33 ]; new g_iPlayerWarnings [ 33 ]; new g_szPlayerIp [ 33 ][ 32 ]; new Float : g_flPlayerLastShot [ 33 ]; /* ================================================================================= * [ Initialization ] * ================================================================================= */ public plugin_natives ( ) { register_library ( "ttt" ); } public plugin_init ( ) { register_plugin ( "[TTT] Warning System" , "1.0" , "Manu" ); RegisterHam ( Ham_TakeDamage , "player" , "Forward_PlayerTakeDamage_Post" , true ); RegisterHam ( Ham_Killed , "player" , "Forward_PlayerKilled_Post" , true ); RegisterHam ( Ham_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_gamemode ( iGamemode ) { if( iGamemode == GAME_STARTED ) { for( new iId = 1 ; iId <= MAX_PLAYERS ; iId ++ ) { if( ! GetPlayerBit ( g_iConnected , iId ) || ( ttt_get_playerdata ( iId , PD_KARMATEMP ) > MIN_KARMA ) ) { continue; } BanPlayer ( iId ); } } } public ttt_command_selected ( iId , iMenuId , szName [ ] ) { if( iMenuId == g_iCommand_Warnings ) { PrintWarnings ( iId ); } } /* ================================================================================= * [ Hamsandwich forwards ] * ================================================================================= */ public Forward_PlayerSpawn_Post ( iId ) { SetPlayerBit ( g_iAlive , iId ); if( GetPlayerBit ( g_iPunish , iId ) ) { ClearPlayerBit ( g_iPunish , iId ); set_task ( 5.0 , "Task_SlayPlayer" , iId ); } PrintWarnings ( iId ); } public Forward_PlayerTakeDamage_Post ( iVictim , iInflictor , iAttacker , Float : flDamage , iBits ) { if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED || ! is_user_connected ( iAttacker ) || ( flDamage < 1.0 ) || iAttacker == iVictim ) { return HAM_IGNORED ; } static iAttackerState ; iAttackerState = ttt_get_alivestate ( iAttacker ); static iVictimState ; iVictimState = ttt_get_alivestate ( iVictim ); if( ! IsStateValid ( iAttackerState ) || ! IsStateValid ( iVictimState ) ) { return HAM_IGNORED ; } if ( iAttackerState == iVictimState || ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE ) || ( iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) ) { static Float : flGameTime ; flGameTime = get_gametime ( ); if( ( flGameTime - g_flPlayerLastShot [ iAttacker ] ) > 1.0 ) { if( ++ g_iPlayerShots [ iAttacker ] >= MAX_SHOTS ) { SetPlayerBit ( g_iPunish , iAttacker ); } } g_flPlayerLastShot [ iAttacker ] = flGameTime ; } return HAM_IGNORED ; } public Forward_PlayerKilled_Post ( iVictim , iAttacker , iShouldGib ) { ClearPlayerBit ( g_iAlive , iVictim ); if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED || ! IsPlayerValid ( iAttacker ) || ! GetPlayerBit ( g_iConnected , iAttacker ) || iAttacker == iVictim ) { return HAM_IGNORED ; } static iAttackerState ; iAttackerState = ttt_get_alivestate ( iAttacker ); static iVictimState ; iVictimState = ttt_get_alivestate ( iVictim ); if( ! IsStateValid ( iAttackerState ) || ! IsStateValid ( iVictimState ) ) { return HAM_IGNORED ; } if ( iAttackerState == iVictimState || ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE ) || ( iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) ) { if( ++ g_iPlayerWarnings [ iAttacker ] >= MAX_WARNINGS ) { BanPlayer ( iAttacker ); } else { WarningScreenFade ( iAttacker ); } } return HAM_IGNORED ; } /* ================================================================================= * [ Client-related ] * ================================================================================= */ public client_putinserver ( iId ) { SetPlayerBit ( g_iConnected , iId ); LoadPlayerData ( iId ); } public client_disconnected ( iId ) { SavePlayerData ( iId ); ClearPlayerBit ( g_iConnected , iId ); ClearPlayerBit ( g_iAlive , iId ); ClearPlayerBit ( g_iPunish , iId ); } public ClientCommand_Warnings ( iId ) { PrintWarnings ( iId ); return PLUGIN_HANDLED ; } public BanPlayer ( iId ) { if( ! GetPlayerBit ( g_iConnected , iId ) ) { return; } new szName [ 32 ]; get_user_name ( iId , szName , charsmax ( szName ) ); client_print_color ( 0 , print_team_default , "^4[TTT]^1 Atencion:^3 %s^1 fue expulsado por^4 %s^1." , szName , BAN_REASON ); server_cmd ( "amx_addban ^" % s ^ " %d ^" % s ^ "" , g_szPlayerIp [ iId ], BAN_DURATION , BAN_REASON ); server_exec ( ); } public Task_SlayPlayer ( iId ) { if( ! GetPlayerBit ( g_iAlive , iId ) ) { return; } static iOrigin [ 3 ]; g_iPlayerShots [ iId ] = 0 ; user_kill ( iId ); get_user_origin ( iId , iOrigin ); message_begin ( MSG_BROADCAST , SVC_TEMPENTITY ); write_byte ( TE_LAVASPLASH ); write_coord ( iOrigin [ 0 ] ); write_coord ( iOrigin [ 1 ] ); write_coord ( iOrigin [ 2 ] ); message_end ( ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Superaste el maximo de disparos sin razon y fuiste castigado." ); } /* ================================================================================= * [ Private functions ] * ================================================================================= */ SavePlayerData ( const iId ) { new iValues [ 3 ]; iValues [ 0 ] = ttt_get_playerdata ( iId , PD_KARMATEMP ); iValues [ 1 ] = g_iPlayerShots [ iId ]; iValues [ 2 ] = g_iPlayerWarnings [ iId ]; TrieSetArray ( g_tList , g_szPlayerIp [ iId ], iValues , sizeof ( iValues ) ); } LoadPlayerData ( const iId ) { get_user_ip ( iId , g_szPlayerIp [ iId ], charsmax ( g_szPlayerIp [ ] ), true ); if( TrieKeyExists ( g_tList , g_szPlayerIp [ iId ] ) ) { new iValues [ 3 ]; TrieGetArray ( g_tList , g_szPlayerIp [ iId ], iValues , 3 ); TrieDeleteKey ( g_tList , g_szPlayerIp [ iId ] ); ttt_set_playerdata ( iId , PD_KARMATEMP , iValues [ 0 ] ); ttt_set_playerdata ( iId , PD_KARMA , iValues [ 0 ] ); g_iPlayerShots [ iId ] = iValues [ 1 ]; g_iPlayerWarnings [ iId ] = iValues [ 2 ]; if( g_iPlayerShots [ iId ] >= MAX_SHOTS ) { SetPlayerBit ( g_iPunish , iId ); } } else { g_iPlayerShots [ iId ] = 0 ; g_iPlayerWarnings [ iId ] = 0 ; } } PrintWarnings ( iId ) { if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED ) { client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Advertencias: ^x03%d de %d^x01 - Disparos sin razon: ^x03%d de %d^x01.^n" , g_iPlayerWarnings [ iId ], MAX_WARNINGS , g_iPlayerShots [ iId ], MAX_SHOTS ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Si alcanzas el maximo seras castigado con ban u/o slay!" ); } } WarningScreenFade ( const iId ) { message_begin ( MSG_ONE_UNRELIABLE , g_iScreenFade , _ , iId ); write_short ( 1 << 12 ); write_short ( ( 1 << 12 ) ); write_short ( 0x1000 ); write_byte ( 255 ); write_byte ( 0 ); write_byte ( 0 ); write_byte ( 50 ); message_end ( ); }
No tenés una versión para el 1.8.2 por ahí?
Código PHP:
public ttt_gamemode ( iGamemode ) { if( iGamemode == GAME_STARTED ) { for( new iId = 1 ; iId <= MAX_PLAYERS ; iId ++ ) { if( ! GetPlayerBit ( g_iConnected , iId ) || ( ttt_get_playerdata ( iId , PD_KARMATEMP ) > MIN_KARMA ) ) { continue; } BanPlayer ( iId ); } } }
---->
Código PHP:
public ttt_gamemode ( iGamemode ) { if( iGamemode == GAME_STARTED ) { for( new iId = 1 ; iId <= get_maxplayers (); iId ++ ) { if( ! GetPlayerBit ( g_iConnected , iId ) || ( ttt_get_playerdata ( iId , PD_KARMATEMP ) > MIN_KARMA ) ) { continue; } BanPlayer ( iId ); } } }
Mensajes: 2,454
Temas: 14
Registro en: Oct 2013
Reputación:
51
21/11/2017, 05:08 AM
(Última modificación: 21/11/2017, 05:10 AM por Manu .)
(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_iPlayerShots [ 33 ]; new g_iPlayerWarnings [ 33 ]; new g_szPlayerIp [ 33 ][ 32 ]; new Float : g_flPlayerLastShot [ 33 ]; /* ================================================================================= * [ Initialization ] * ================================================================================= */ public plugin_natives ( ) { register_library ( "ttt" ); } public plugin_init ( ) { register_plugin ( "[TTT] Warning System" , "1.0" , "Manu" ); RegisterHam ( Ham_TakeDamage , "player" , "Forward_PlayerTakeDamage_Post" , true ); RegisterHam ( Ham_Killed , "player" , "Forward_PlayerKilled_Post" , true ); RegisterHam ( Ham_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_gamemode ( iGamemode ) { if( iGamemode == GAME_STARTED ) { for( new iId = 1 ; iId <= MAX_PLAYERS ; iId ++ ) { if( ! GetPlayerBit ( g_iConnected , iId ) || ( ttt_get_playerdata ( iId , PD_KARMATEMP ) > MIN_KARMA ) ) { continue; } BanPlayer ( iId ); } } } public ttt_command_selected ( iId , iMenuId , szName [ ] ) { if( iMenuId == g_iCommand_Warnings ) { PrintWarnings ( iId ); } } /* ================================================================================= * [ Hamsandwich forwards ] * ================================================================================= */ public Forward_PlayerSpawn_Post ( iId ) { SetPlayerBit ( g_iAlive , iId ); if( GetPlayerBit ( g_iPunish , iId ) ) { ClearPlayerBit ( g_iPunish , iId ); set_task ( 5.0 , "Task_SlayPlayer" , iId ); } PrintWarnings ( iId ); } public Forward_PlayerTakeDamage_Post ( iVictim , iInflictor , iAttacker , Float : flDamage , iBits ) { if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED || ! is_user_connected ( iAttacker ) || ( flDamage < 1.0 ) || iAttacker == iVictim ) { return HAM_IGNORED ; } static iAttackerState ; iAttackerState = ttt_get_alivestate ( iAttacker ); static iVictimState ; iVictimState = ttt_get_alivestate ( iVictim ); if( ! IsStateValid ( iAttackerState ) || ! IsStateValid ( iVictimState ) ) { return HAM_IGNORED ; } if ( iAttackerState == iVictimState || ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE ) || ( iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) ) { static Float : flGameTime ; flGameTime = get_gametime ( ); if( ( flGameTime - g_flPlayerLastShot [ iAttacker ] ) > 1.0 ) { if( ++ g_iPlayerShots [ iAttacker ] >= MAX_SHOTS ) { SetPlayerBit ( g_iPunish , iAttacker ); } } g_flPlayerLastShot [ iAttacker ] = flGameTime ; } return HAM_IGNORED ; } public Forward_PlayerKilled_Post ( iVictim , iAttacker , iShouldGib ) { ClearPlayerBit ( g_iAlive , iVictim ); if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED || ! IsPlayerValid ( iAttacker ) || ! GetPlayerBit ( g_iConnected , iAttacker ) || iAttacker == iVictim ) { return HAM_IGNORED ; } static iAttackerState ; iAttackerState = ttt_get_alivestate ( iAttacker ); static iVictimState ; iVictimState = ttt_get_alivestate ( iVictim ); if( ! IsStateValid ( iAttackerState ) || ! IsStateValid ( iVictimState ) ) { return HAM_IGNORED ; } if ( iAttackerState == iVictimState || ( iAttackerState == PC_INNOCENT && iVictimState == PC_DETECTIVE ) || ( iAttackerState == PC_DETECTIVE && iVictimState == PC_INNOCENT ) ) { if( ++ g_iPlayerWarnings [ iAttacker ] >= MAX_WARNINGS ) { BanPlayer ( iAttacker ); } else { WarningScreenFade ( iAttacker ); } } return HAM_IGNORED ; } /* ================================================================================= * [ Client-related ] * ================================================================================= */ public client_putinserver ( iId ) { SetPlayerBit ( g_iConnected , iId ); LoadPlayerData ( iId ); } public client_disconnected ( iId ) { SavePlayerData ( iId ); ClearPlayerBit ( g_iConnected , iId ); ClearPlayerBit ( g_iAlive , iId ); ClearPlayerBit ( g_iPunish , iId ); } public ClientCommand_Warnings ( iId ) { PrintWarnings ( iId ); return PLUGIN_HANDLED ; } public BanPlayer ( iId ) { if( ! GetPlayerBit ( g_iConnected , iId ) ) { return; } new szName [ 32 ]; get_user_name ( iId , szName , charsmax ( szName ) ); client_print_color ( 0 , print_team_default , "^4[TTT]^1 Atencion:^3 %s^1 fue expulsado por^4 %s^1." , szName , BAN_REASON ); server_cmd ( "amx_addban ^" % s ^ " %d ^" % s ^ "" , g_szPlayerIp [ iId ], BAN_DURATION , BAN_REASON ); server_exec ( ); } public Task_SlayPlayer ( iId ) { if( ! GetPlayerBit ( g_iAlive , iId ) ) { return; } static iOrigin [ 3 ]; g_iPlayerShots [ iId ] = 0 ; user_kill ( iId ); get_user_origin ( iId , iOrigin ); message_begin ( MSG_BROADCAST , SVC_TEMPENTITY ); write_byte ( TE_LAVASPLASH ); write_coord ( iOrigin [ 0 ] ); write_coord ( iOrigin [ 1 ] ); write_coord ( iOrigin [ 2 ] ); message_end ( ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Superaste el maximo de disparos sin razon y fuiste castigado." ); } /* ================================================================================= * [ Private functions ] * ================================================================================= */ SavePlayerData ( const iId ) { new iValues [ 3 ]; iValues [ 0 ] = ttt_get_playerdata ( iId , PD_KARMATEMP ); iValues [ 1 ] = g_iPlayerShots [ iId ]; iValues [ 2 ] = g_iPlayerWarnings [ iId ]; TrieSetArray ( g_tList , g_szPlayerIp [ iId ], iValues , sizeof ( iValues ) ); } LoadPlayerData ( const iId ) { get_user_ip ( iId , g_szPlayerIp [ iId ], charsmax ( g_szPlayerIp [ ] ), true ); if( TrieKeyExists ( g_tList , g_szPlayerIp [ iId ] ) ) { new iValues [ 3 ]; TrieGetArray ( g_tList , g_szPlayerIp [ iId ], iValues , 3 ); TrieDeleteKey ( g_tList , g_szPlayerIp [ iId ] ); ttt_set_playerdata ( iId , PD_KARMATEMP , iValues [ 0 ] ); ttt_set_playerdata ( iId , PD_KARMA , iValues [ 0 ] ); g_iPlayerShots [ iId ] = iValues [ 1 ]; g_iPlayerWarnings [ iId ] = iValues [ 2 ]; if( g_iPlayerShots [ iId ] >= MAX_SHOTS ) { SetPlayerBit ( g_iPunish , iId ); } } else { g_iPlayerShots [ iId ] = 0 ; g_iPlayerWarnings [ iId ] = 0 ; } } PrintWarnings ( iId ) { if( ttt_get_globalinfo ( GI_GAMEMODE ) != GAME_STARTED ) { client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Advertencias: ^x03%d de %d^x01 - Disparos sin razon: ^x03%d de %d^x01.^n" , g_iPlayerWarnings [ iId ], MAX_WARNINGS , g_iPlayerShots [ iId ], MAX_SHOTS ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Si alcanzas el maximo seras castigado con ban u/o slay!" ); } } WarningScreenFade ( const iId ) { message_begin ( MSG_ONE_UNRELIABLE , g_iScreenFade , _ , iId ); write_short ( 1 << 12 ); write_short ( ( 1 << 12 ) ); write_short ( 0x1000 ); write_byte ( 255 ); write_byte ( 0 ); write_byte ( 0 ); write_byte ( 50 ); 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 .
Mensajes: 6
Temas: 1
Registro en: Sep 2017
Reputación:
0
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
Mensajes: 791
Temas: 84
Registro en: Sep 2016
Reputación:
6
(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
Mensajes: 791
Temas: 84
Registro en: Sep 2016
Reputación:
6
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)
Mensajes: 2,454
Temas: 14
Registro en: Oct 2013
Reputación:
51
Código PHP:
entity_set_model ( iEnt , g_szFakeWeaponModel [ random ( sizeof ( g_szFakeWeaponModel ) - 1 ) ] );
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 .
Mensajes: 2
Temas: 0
Registro en: Aug 2014
Reputación:
0
Hola quisiera saber como instalar el PHP de Arma falsa en mi servidor de TTT por favor. Gracias!
Mensajes: 7,178
Temas: 93
Registro en: Aug 2014
Reputación:
63
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
Mensajes: 2
Temas: 0
Registro en: Aug 2014
Reputación:
0
(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
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!
Mensajes: 7,178
Temas: 93
Registro en: Aug 2014
Reputación:
63
Código PHP:
#include <amxmodx> #include <engine> #include <hamsandwich> #include <ttt> #include <xs> #define isPlayerValid(%0) ( 1 <= %0 <= 32 ) enum _ : Place_Data { Place_Map [ 32 ], Float : Place_Coords [ 3 ] } new const Float : g_ePlaces [ ][ Place_Data ] = { { "aim_crazyjump_2015" , { 448.464141 , 1224.428222 , 37.031250 } }, { "aim_crazyjump_2015" , { 568.875549 , - 854.461730 , 37.031250 } }, { "cs_familyguy" , { - 529.234802 , 915.918518 , 36.031250 } }, { "ttt_towers_fix" , { - 64.000000 , - 1184.000000 , 20.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_iItem , bool : g_bBlock , g_szCurrentMap [ 32 ]; public plugin_precache ( ) { for( new i ; i < sizeof g_szFakeWeaponModel ; i ++ ) precache_model ( g_szFakeWeaponModel [ i ] ); } public plugin_init ( ) { register_plugin ( "[TTT] Item: Mine" , TTT_VERSION , "Manu" ); register_think ( g_szFakeWeaponClassname , "think_FakeWeapon" ); register_touch ( g_szFakeWeaponClassname , "player" , "touch_FakeWeapon" ); get_mapname ( g_szCurrentMap , charsmax ( g_szCurrentMap ) ); for( new i ; i < sizeof g_ePlaces ; i ++ ) { if( equal ( g_szCurrentMap , g_ePlaces [ i ][ Place_Map ] ) ) { g_bBlock = true ; break; } } } public ttt_plugin_cfg ( ) g_iItem = ttt_buymenu_add ( "Arma falsa" , 2 , PC_TRAITOR ); public ttt_item_selected ( iId , iItem , szName [ ], iPrice ) { if( g_iItem == iItem ) { CreateFakeWeapon ( iId ); return PLUGIN_HANDLED ; } return PLUGIN_CONTINUE ; } public ttt_gamemode ( iGameMode ) { if( iGameMode == GAME_ENDED ) { new iEnt ; while( ( iEnt = find_ent_by_class ( iEnt , g_szFakeWeaponClassname ) ) != 0 ) { entity_set_int ( iEnt , EV_INT_iuser1 , 1 ); entity_set_float ( iEnt , EV_FL_nextthink , get_gametime ( ) + 0.1 ); } } } public touch_FakeWeapon ( iEnt , iId ) { if( is_valid_ent ( iEnt ) && isPlayerValid ( iId ) ) { if( entity_get_int ( iEnt , EV_INT_iuser1 ) <= 0 && is_user_alive ( iId ) && ttt_get_playerstate ( iId ) != PC_TRAITOR ) CreateExplosion ( iEnt , iId ); } } public think_FakeWeapon ( iEnt ) { if( is_valid_ent ( iEnt ) ) remove_entity ( iEnt ); } CreateExplosion ( const iEnt , const iId ) { static iOwner , iExplosion , iOrigin [ 3 ], Float : flOrigin [ 3 ]; iOwner = entity_get_edict ( iEnt , EV_ENT_owner ); if( ! is_user_connected ( iOwner ) ) { entity_set_int ( iEnt , EV_INT_iuser1 , 1 ); entity_set_float ( iEnt , EV_FL_nextthink , get_gametime ( ) + 0.1 ); return 0 ; } iExplosion = create_entity ( "env_explosion" ); entity_get_vector ( iEnt , EV_VEC_origin , flOrigin ); FVecIVec ( flOrigin , iOrigin ); if( ! is_valid_ent ( iExplosion ) ) return 0 ; entity_set_origin ( iExplosion , flOrigin ); entity_set_int ( iExplosion , EV_INT_spawnflags , entity_get_int ( iExplosion , EV_INT_spawnflags ) | SF_ENVEXPLOSION_NODAMAGE ); DispatchKeyValue ( iExplosion , "iMagnitude" , "100" ); DispatchSpawn ( iExplosion ); force_use ( iExplosion , iExplosion ); remove_entity ( iExplosion ); ExecuteHamB ( Ham_Killed , iId , iOwner , 2 ); return 1 ; } CreateFakeWeapon ( const iId ) { static iEnt , Float : flOrigin [ 3 ]; iEnt = create_entity ( "info_target" ); if( ! is_valid_ent ( iEnt ) || ( g_bBlock && isPlaceBlocked ( iId ) ) ) { client_print_color ( iId , print_team_default , "^x04[TTT]^x01 No puedes crear un arma falsa en los teleports." ); return 0 ; } entity_set_string ( iEnt , EV_SZ_classname , g_szFakeWeaponClassname ); entity_set_model ( iEnt , g_szFakeWeaponModel [ random ( sizeof ( g_szFakeWeaponModel ) - 1 ) ] ); entity_set_size ( iEnt , Float :{ - 5.0 ,- 5.0 ,- 1.0 }, Float :{ 5.0 , 5.0 , 1.0 } ); entity_set_int ( iEnt , EV_INT_movetype , MOVETYPE_TOSS ); entity_set_int ( iEnt , EV_INT_solid , SOLID_TRIGGER ); entity_get_vector ( iId , EV_VEC_origin , flOrigin ); entity_set_origin ( iEnt , flOrigin ); entity_set_float ( iEnt , EV_FL_health , 100.0 ); entity_set_float ( iEnt , EV_FL_takedamage , DAMAGE_NO ); entity_set_edict ( iEnt , EV_ENT_owner , iId ); entity_set_float ( iEnt , EV_FL_nextthink , get_gametime ( ) + 35.0 ); drop_to_floor ( iEnt ); client_print_color ( iId , print_team_default , "^x04[TTT]^x01 Compraste un arma falsa, quien la toque explotara." ); return 1 ; } isPlaceBlocked ( const iId ) { static Float : flOrigin [ 3 ], Float : flPoint [ 3 ]; entity_get_vector ( iId , EV_VEC_origin , flOrigin ); for( new i ; i < sizeof ( g_ePlaces ); i ++ ) { if( equal ( g_szCurrentMap , g_ePlaces [ i ][ Place_Map ] ) ) { xs_vec_copy ( g_ePlaces [ i ][ Place_Coords ], flPoint ); if( get_distance_f ( flOrigin , flPoint ) < 128.0 ) return true ; } } return false ; }
los includes ttt y eso los trae el mod de donde los bajaste
Mensajes: 3,020
Temas: 49
Registro en: Oct 2013
Reputación:
33
29/12/2020, 02:36 PM
(Última modificación: 29/12/2020, 02:36 PM por roccoxx .)
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.