Desi eram 'retras'.. am mai mesterit la 2 plugine.. unul public si unul privat.
Mi-am zis sa-l fac public si pe cel 'privat' care a fost facut in acceasi zi cu
Last Players On Radar.
Descriere: AntiFurienii isi pot cumpara un 'radar portabil' cu care pot detecta toti furienii din jurul lor pe o raza de x unitati ( setata prin cvar ) si care au o viteza mai mare de y ( setata tot prin cvar ).Acestia vor putea fi vazuti pe radar drept puncte rosii si, totodata cu punctul rosu se va auzi si un sunet.
Nota:
'Radarul portabil' dispare abea cand AntiFurienul ce l-a cumpar a fost omorat.
'Protectia' impotriva 'radarului portabil' dispare abea cand Furienul ce l-a cumpar a fost omorat.
Descarcare: [sursa=AntiFurien Radar]/* Plugin generated by AMXX-Studio */
#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#pragma semicolon 1
#define RADAR_DELAY 1.0
new const
PLUGIN_NAME[ ] = "AntiFurien Radar",
PLUGIN_VERSION[ ] = "0.2.0";
new const
PLUGIN_TAG[ ] = "|AMXX:",
RADAR_SOUND[ ] = "misc/motion.wav";
new g_iCvarMinFurienSpeed;
new g_iCvarRadarRange;
new g_iCvarCost;
new g_iCvarCostTwo;
new g_iMaxPlayers;
new Float:g_fCurrentTime;
new Float:g_fNextRadarTime[ 33 ];
new bool:g_bUserHasRadar[ 33 ];
new bool:g_bUserHasProtection[ 33 ];
new bool:g_bDrawFurienOnRadar[ 33 ];
new g_iMsgIdHostageK;
new g_iMsgIdHostagePos;
public plugin_precache( )
{
precache_sound( RADAR_SOUND );
}
public plugin_init( )
{
register_plugin( PLUGIN_NAME, PLUGIN_VERSION, "Askhanar" );
g_iCvarMinFurienSpeed = register_cvar( "afr_minspeed", "100" );
g_iCvarRadarRange = register_cvar( "afr_range", "850" );
g_iCvarCost = register_cvar( "afr_radar_cost", "14000" );
g_iCvarCostTwo = register_cvar( "afr_protection_cost", "16000" );
register_clcmd( "say /afradar", "ClCmdSayRadar" );
register_clcmd( "say /afr", "ClCmdSayRadar" );
register_clcmd( "say /afrprotection", "ClCmdSayProtection" );
register_clcmd( "say /afrp", "ClCmdSayProtection" );
register_event( "DeathMsg", "EventDeathMsg", "a" );
register_forward( FM_PlayerPreThink, "fw_PlayerPreThinkPre", false );
g_iMsgIdHostageK = get_user_msgid( "HostageK" );
g_iMsgIdHostagePos = get_user_msgid( "HostagePos" );
g_iMaxPlayers = get_maxplayers( );
// Add your code here...
}
public ClCmdSayRadar( id )
{
if( cs_get_user_team( id ) != CS_TEAM_CT )
{
client_print( id, print_chat, "%s Only AntiFuriens are allowed to buy this!", PLUGIN_TAG );
return PLUGIN_CONTINUE;
}
if( !is_user_alive( id ) )
{
client_print( id, print_chat, "%s You need to be alive!", PLUGIN_TAG );
return PLUGIN_CONTINUE;
}
if( g_bUserHasRadar[ id ] )
{
client_print( id, print_chat, "%s You already have one!", PLUGIN_TAG );
return PLUGIN_CONTINUE;
}
new iCost = get_pcvar_num( g_iCvarCost );
new iMoney = cs_get_user_money( id );
if( iMoney < iCost )
{
client_print( id, print_chat, "%s You have not enough money, you need $%i more!", PLUGIN_TAG, iCost - iMoney );
return PLUGIN_CONTINUE;
}
g_bUserHasRadar[ id ] = true;
cs_set_user_money( id, iMoney - iCost );
client_print( id, print_chat, "%s You are now detecting near furiens, watch your radar!", PLUGIN_TAG );
return PLUGIN_CONTINUE;
}
public ClCmdSayProtection( id )
{
if( cs_get_user_team( id ) != CS_TEAM_T )
{
client_print( id, print_chat, "%s Only Furiens are allowed to buy this!", PLUGIN_TAG );
return PLUGIN_CONTINUE;
}
if( !is_user_alive( id ) )
{
client_print( id, print_chat, "%s You need to be alive!", PLUGIN_TAG );
return PLUGIN_CONTINUE;
}
if( g_bUserHasProtection[ id ] )
{
client_print( id, print_chat, "%s You already have one!", PLUGIN_TAG );
return PLUGIN_CONTINUE;
}
new iCost = get_pcvar_num( g_iCvarCostTwo );
new iMoney = cs_get_user_money( id );
if( iMoney < iCost )
{
client_print( id, print_chat, "%s You have not enough money, you need $%i more!", PLUGIN_TAG, iCost - iMoney );
return PLUGIN_CONTINUE;
}
g_bUserHasProtection[ id ] = true;
cs_set_user_money( id, iMoney - iCost );
client_print( id, print_chat, "%s You are now protected against AntiFurien's radar!", PLUGIN_TAG );
return PLUGIN_CONTINUE;
}
public client_putinserver( id )
{
g_bUserHasRadar[ id ] = false;
g_bUserHasProtection[ id ] = false;
g_bDrawFurienOnRadar[ id ] = false;
}
public client_disconnect( id )
{
g_bUserHasRadar[ id ] = false;
g_bUserHasProtection[ id ] = false;
g_bDrawFurienOnRadar[ id ] = false;
}
public EventDeathMsg( )
{
static id;
id = read_data( 2 );
g_bUserHasRadar[ id ] = false;
g_bUserHasProtection[ id ] = false;
g_bDrawFurienOnRadar[ id ] = false;
}
public fw_PlayerPreThinkPre( id )
{
if( !is_user_alive( id ) )
return FMRES_IGNORED;
g_fCurrentTime = get_gametime( );
if( cs_get_user_team( id ) == CS_TEAM_CT && g_bUserHasRadar[ id ] )
{
if( g_fNextRadarTime[ id ] <= g_fCurrentTime )
{
g_fNextRadarTime[ id ] = g_fCurrentTime + RADAR_DELAY;
static bool:bBeep;
bBeep = false;
for( new iFurien = 1; iFurien <= g_iMaxPlayers; iFurien++ )
{
if( g_bDrawFurienOnRadar[ iFurien ] )
{
if( !g_bUserHasProtection[ iFurien ] )
{
static Float:fOrigin[ 3 ];
pev( iFurien, pev_origin, fOrigin );
UTIL_ShowOnRadar( id, iFurien, fOrigin );
}
bBeep = true;
}
}
if( bBeep )
client_cmd( id, "spk %s", RADAR_SOUND );
}
}
else if( cs_get_user_team( id ) == CS_TEAM_T )
{
static Float:fFurienOrigin[ 3 ];
pev( id, pev_origin, fFurienOrigin );
static Float:fVelocity[ 3 ];
pev( id, pev_velocity, fVelocity );
static Float:fCurSpeed;
fCurSpeed = vector_length( fVelocity );
if( fCurSpeed > float( get_pcvar_num( g_iCvarMinFurienSpeed ) ) )
{
static iAnti;
for( iAnti = 1; iAnti <= g_iMaxPlayers; iAnti++ )
{
if( cs_get_user_team( iAnti ) == CS_TEAM_CT && is_user_alive( iAnti ) )
{
static Float:fAntiOrigin[ 3 ];
pev( iAnti, pev_origin, fAntiOrigin );
if( get_distance_f( fFurienOrigin, fAntiOrigin ) <= float( get_pcvar_num( g_iCvarRadarRange ) ) )
{
g_bDrawFurienOnRadar[ id ] = true;
break;
}
}
}
}
else
{
g_bDrawFurienOnRadar[ id ] = false;
}
}
return FMRES_IGNORED;
}
UTIL_ShowOnRadar( id, iTarget, Float:fOrigin[ 3 ] )
{
//Make a dot on players radar.
message_begin( MSG_ONE_UNRELIABLE, g_iMsgIdHostagePos, .player = id );
write_byte( id );
write_byte( iTarget );
engfunc( EngFunc_WriteCoord, fOrigin[ 0 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 1 ] );
engfunc( EngFunc_WriteCoord, fOrigin[ 2 ] );
message_end( );
//Make the dot red.
message_begin( MSG_ONE_UNRELIABLE, g_iMsgIdHostageK, .player = id );
write_byte( iTarget );
message_end( );
}[/sursa]
Nume: AntiFurien Radar
Versiune: 0.2.0
Link oficial:
http://www.extreamcs.com/forumInstalare:
1. Fisierul
afradar.sma il puneti in
addons/amxmodx/scripting2. Fisierul
afradar.amxx il puneti in
addons/amxmodx/plugins3. Intrati in fisierul
addons/amxmodx/configs/plugins.ini si adaugati la urma:
- Cod:
-
afradar.amxx
4. Adaugati fisierul
motion.wav in folderul:
- Cod:
-
hlds/cstrike/sound/misc
Comenzi publice (se tasteaza in joc prin apasarea tastei
Y):
/afradar - cumperi 'radarul portabil'.
/afr - cumperi 'radarul portabil'.
/afrprotection - cumperi protectie impotriva 'radarului portabil'.
/afrp - cumperi protectie impotriva 'radarului portabil'.
Cvar-uri (se adauga in fisierul
amxmodx\configs\amxx.cfg):
afr_minspeed 100 - viteza minima a unui furien sa apara pe radar.
afr_range 850 - distanta ( in unitati ) pe care scaneaza radarul.
afr_radar_cost 14000 - pretul radarului.
afr_protection_cost 16000 - pretul protectiei impotriva radarului.
[sursa=Imagini]
Serverul nu are modul furien pe el.. deci tero nu e invizibil cand sta pe loc!in stanga se vede clar pe radar ca a aparut un punct rosu! || in partea dreapta este tot radarul meu doar ca Rap^ statea nemiscat.
[/sursa]
- Cod:
-
Changelog:
[ 18.10.2013 ]
0.2.0 - am adaugat protectie impotriva radarului ( nu vor fi afisati pe radar dar sunetul tot se va auzi ).
- am trecut pe variabile de tip [color=#00FF80]static[/color]
- am adauga un cvar nou ( afr_protection_cost ), detalii gasiti mai sus.
- am modificat prefixul cvarurilor !
[ --.--.---- ]
0.1.7 - am trecut pe cstrike [ get_user_team( ) --> cs_get_user_team( ) ]
[ --.--.---- ]
0.1.5 - am modificat cate ceva si am adaugat un cvar nou.
[ --.--.---- ]
0.1.0 - prima versiune a pluginului ( este pe cateva servere.. drept plugin privat )
To do:[del]Am sa adaug o comanda pentru furieni gen /noafradar, prin care isi pot cumpara un echipament special cu care nu pot fi detectati de 'radarul portabil' al AntiFurienilor .[/del]
Am sa adaug native.
Am sa scot o versiune pentru FCS ( Furien Credits System )
[sursa=Credite]
Hunter-Digital: am luat 'modelul' si ideea din pluginul lui avh.[/sursa]
Download motion.wav:SendSpaceMirror[ askhanar.tk ]
Enjoy..