Pawni KKK ehk sagedased probleemid
Lehekülg 1, lehekülgi kokku 1 • Share
- Tonight
- Liitus : 19/02/2012
Postitusi : 18000
Sellest õpetusest sa leiad õiged võtted asjadeks, mida tehakse sageli valesti.
○ Stardiloendus:
- Kood:
#include <amxmodx>
#define TASKID 1996
#define SECONDS 10
new iSeconds
public plugin_init()
{
register_plugin( "Countdown Example", "1.0", "Wrecked" )
register_logevent( "LogEventRoundStart", 2, "1=Round_Start" )
}
public LogEventRoundStart()
{
if( task_exists( TASKID ) )
remove_task( TASKID )
iSeconds = SECONDS
set_task( 1.0, "TaskShowCountdown", TASKID, _, _, "a", SECONDS )
}
public TaskShowCountdown()
{
set_hudmessage( 120, 120, 120, 0.50, 0.50, 0, 0.1, 0.8, 0.1, 0.1, -1 )
show_hudmessage( 0, "Seconds Remaining: %i", iSeconds-- )
}
○ Tapmiste/headshottide streaki tabamine:
- Kood:
#include <amxmodx>
new Headshots[33]
new Kills[33]
public plugin_init()
{
register_plugin( "How To Keep Kill Counts", "1.0", "Wrecked" )
register_event( "DeathMsg", "EventDeathMsg", "a" )
register_logevent( "LogEventRoundStart", 2, "1=Round_Start" )
}
public EventDeathMsg()
{
new killer = read_data( 1 )
new victim = read_data( 2 )
Headshots[victim] = 0
Kills[victim] = 0
Kills[killer]++
if( read_data( 3 ) ) // headshot
Headshots[killer]++
}
public LogEventRoundStart()
{
arrayset( Headshots, 0, 33 )
arrayset( Kills, 0, 33 )
}
○ Tee midagi iga X roundi järel:
- Kood:
#include <amxmodx>
#define ROUND_INTERVAL 4
new iRound
public plugin_init()
{
register_plugin( "Do Something Every X Rounds", "1.0", "Wrecked" )
register_logevent( "LogEventRoundStart", 2, "1=Round_Start" )
}
public LogEventRoundStart()
{
if( ( ++iRound % ROUND_INTERVAL ) == 1 )
// sinu edasine funktsioon läheb siia
}
○ Maas oleva relva võtmise blokeerimine:
- Kood:
#include <amxmodx>
#include <hamsandwich>
public plugin_init()
{
register_plugin( "Block Weapon Pickup", "1.0", "Wrecked" )
RegisterHam( Ham_Touch, "weaponbox", "HamTouchPre", 0 )
RegisterHam( Ham_Touch, "armoury_entity", "HamTouchPre", 0 )
}
public HamTouchPre( weapon )
return HAM_SUPERCEDE;
○ Buyzone'i eemaldamine:
- Kood:
#include < amxmodx >
#include < engine >
#include < fakemeta >
new const info_map_parameters[ ] = "info_map_parameters";
new g_hSpawn;
public plugin_precache( ) {
new iEntity = create_entity( info_map_parameters );
DispatchKeyValue( iEntity, "buying", "3" );
DispatchSpawn( iEntity );
g_hSpawn = register_forward( FM_Spawn, "FwdSpawn" );
}
public FwdSpawn( iEntity ) {
static szClassname[ 32 ];
entity_get_string( iEntity, EV_SZ_classname, szClassname, 31 );
if( equal( szClassname, info_map_parameters ) ) {
remove_entity( iEntity );
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public plugin_init( ) {
if( g_hSpawn > 0 ) {
unregister_forward( FM_Spawn, g_hSpawn );
}
}
○ Entity korrektne eemaldamine:
- Kood:
#include <amxmodx>
#include <fakemeta>
new const g_RemoveEntity[] = "classname_here";
public plugin_precache()
{
register_plugin("Fine", "and", "you?");
register_forward(FM_Spawn, "HookFmSpawn");
}
public HookFmSpawn(iEntity)
{
if(!pev_valid(iEntity) )
return FMRES_IGNORED;
static szClassName[32];
pev(iEntity, pev_classname, szClassName, 31);
if(equali(szClassName, g_RemoveEntity) )
{
engfunc(EngFunc_RemoveEntity, iEntity);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
- Sulipoiss PeeterJuunior
- Liitus : 10/01/2015
Postitusi : 28
Mul on probleem ma olen steamer kui teised tahavad tulla mu servuse ss nad ei saa sisse
- PulberLiige
- Liitus : 13/11/2012
Postitusi : 186
Miks sa teed jumala suvase kohta oma teemad ja vastused tee oma server non-steamiks.
- Sulipoiss PeeterJuunior
- Liitus : 10/01/2015
Postitusi : 28
Kuidas ????
Soovid vestluses osaleda?
Selleks logi sisse või tee endale kasutaja.
Lehekülg 1, lehekülgi kokku 1
Permissions in this forum:
Sa ei saa vastata siinsetele teemadele