evet denedim fakat olmuyor gerçekten 30 lvlde kaldı ve derlemede 30 lvle ait birşeyde olmamasına rağmen hala 30 lvler tek kullana biliyor.orucoglukayra yazdı: ↑Çrş Eki 20, 2021 7:15 amERRA yazdı: ↑Sal Eki 19, 2021 10:16 pmartık ne kadar teşekür etsem azdır size ne desem bilemiyorum ama ben kendimce en son şu şekilde editledim fakat hala sadece 30 lvl için akitf durumda ben 31 lvl ve onun üstü kullanması için sizden bakıp yapmaya çalıştım fakat sadece 30 seviye için aktif. son çare olarak yazıyorum kusura bakmayın gerçekten sürekli hata veriyo ve kod bilgim yetersiz çok özür dillerim.orucoglukayra yazdı: ↑Sal Eki 19, 2021 7:51 pm Bu işler deneye deneye öğreniliyor.Attığımı inceleyin, anlamadığınız yer olursa tekrar yazabilirsiniz.Bildiğim kadarıyla yardımcı olurum.
Yaptığım işlem, trail eklentisi aldıktan sonra native tanıtıyorum. (Level sorgusu yapmamız için gerekli) ;
Daha sonra gerekli yerlere level sorgusu yapıcaz ;Kod: Tümünü seç
native crxranks_get_user_level(index); // Leveli çekmemizi sağlayacak
Kod: Tümünü seç
if(crxranks_get_user_level(id) != 30) { client_print( id, print_chat, "[CSD] Sadece Level 30lar Bu Menuye Girebilir!" ); return PLUGIN_HANDLED; }
Kod: Tümünü seç
#include < amxmodx > #include < amxmisc > #include < fakemeta > #include < hamsandwich > native crxranks_get_user_level(index); #pragma semicolon 1 #define PLUGIN_VERSION "1.0.0" #define TASKID 81732519124 #define TRAIL_ACTIVE 1 #define TRAIL_INACTIVE 0 #define TRAIL_LIFE 15 #define ACCES_FLAG ADMIN_ALL new gTrailSprite; new gTrailRandomColor[ 33 ][ 3 ]; new bPlayerTrailStatus[ 33 ]; new Float:bflNextCheck[ 33 ]; new const gTrailSpriteIndex[] = "sprites/zbeam2.spr"; const IN_MOVING = IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT | IN_JUMP; public plugin_init() { register_plugin( "Owner Trail", PLUGIN_VERSION, "tuty" ); register_forward( FM_CmdStart, "forward_cmdstart" ); register_clcmd( "say /trail", "cmdMakeOwnerTrail" ); register_clcmd( "say_team /trail", "cmdMakeOwnerTrail" ); RegisterHam(Ham_Spawn, "player", "Fwd_Spawn", 1); } public plugin_precache() { gTrailSprite = precache_model( gTrailSpriteIndex ); } public client_connect( id ) { bPlayerTrailStatus[ id ] = TRAIL_INACTIVE; } public Fwd_Spawn(id) { if(get_user_flags(id) & ACCES_FLAG && crxranks_get_user_level(id) == 30) { bPlayerTrailStatus[id] = TRAIL_ACTIVE; gTrailRandomColor[ id ][ 0 ] = random_num( 0, 255 ); gTrailRandomColor[ id ][ 1 ] = random_num( 0, 255 ); gTrailRandomColor[ id ][ 2 ] = random_num( 0, 255 ); set_task(10.0, "change_color", id + TASKID, .flags="b"); } } public change_color(taskid) { new id = taskid - TASKID; if(!is_user_alive(id)) { remove_task(taskid); return; } gTrailRandomColor[ id ][ 0 ] = random_num( 0, 255 ); gTrailRandomColor[ id ][ 1 ] = random_num( 0, 255 ); gTrailRandomColor[ id ][ 2 ] = random_num( 0, 255 ); } public cmdMakeOwnerTrail( id ) { if( !is_user_alive( id ) ) { client_print( id, print_chat, "[CSD] Öldüğünüzde bu komutu kullanamazsınız!" ); return PLUGIN_HANDLED; } if(crxranks_get_user_level(id) != 30) { client_print( id, print_chat, "[CSD] Sadece Level 30lar Bu Menuye Girebilir!" ); return PLUGIN_HANDLED; } if( !( get_user_flags( id ) & ACCES_FLAG ) ) { client_print( id, print_chat, "[CSD] Bu komuta erişiminiz yok!" ); return PLUGIN_HANDLED; } if( bPlayerTrailStatus[ id ] == TRAIL_ACTIVE ) { client_print( id, print_chat, "[CSD] Trail Kapatildi." ); bPlayerTrailStatus[ id ] = TRAIL_INACTIVE; UTIL_KillBeamFollow( id ); bflNextCheck[ id ] = -5000.0; return PLUGIN_HANDLED; } if( bPlayerTrailStatus[ id ] == TRAIL_INACTIVE ) { client_print( id, print_chat, "[CSD] Trail etkinleştirildi! " ); bPlayerTrailStatus[ id ] = TRAIL_ACTIVE; gTrailRandomColor[ id ][ 0 ] = random_num( 0, 255 ); gTrailRandomColor[ id ][ 1 ] = random_num( 0, 255 ); gTrailRandomColor[ id ][ 2 ] = random_num( 0, 255 ); return PLUGIN_HANDLED; } return PLUGIN_CONTINUE; } public forward_cmdstart( id, handle ) { if( !is_user_alive( id ) || bPlayerTrailStatus[ id ] == TRAIL_INACTIVE ) { return FMRES_IGNORED; } if(crxranks_get_user_level(id) != 30) { return FMRES_IGNORED; } new iButton = get_uc( handle, UC_Buttons ); if( !( iButton & IN_MOVING ) ) { new Float:flGameTime = get_gametime(); if( bflNextCheck[ id ] < flGameTime ) { UTIL_KillBeamFollow( id ); UTIL_BeamFollow( id ); bflNextCheck[ id ] = flGameTime + ( TRAIL_LIFE / 8 ); } } return FMRES_IGNORED; } stock UTIL_BeamFollow( const iClient ) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( TE_BEAMFOLLOW ); write_short( iClient ); write_short( gTrailSprite ); write_byte( TRAIL_LIFE ); write_byte( 20 ); write_byte( gTrailRandomColor[ iClient ][ 0 ] ); write_byte( gTrailRandomColor[ iClient ][ 1 ] ); write_byte( gTrailRandomColor[ iClient ][ 2 ] ); write_byte( 255 ); message_end(); } stock UTIL_KillBeamFollow( const iClient ) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( TE_KILLBEAM ); write_short( iClient ); message_end(); }
Kod: Tümünü seç
if(crxranks_get_user_level(id) >= 31) { // Oyuncu 31 levelden buyuk veya esitse calisacak yer }
Kod: Tümünü seç
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < hamsandwich >
native crxranks_get_user_level(index);
#pragma semicolon 1
#define PLUGIN_VERSION "1.0.0"
#define TASKID 81732519124
#define TRAIL_ACTIVE 1
#define TRAIL_INACTIVE 0
#define TRAIL_LIFE 15
#define ACCES_FLAG ADMIN_ALL
new gTrailSprite;
new gTrailRandomColor[ 33 ][ 3 ];
new bPlayerTrailStatus[ 33 ];
new Float:bflNextCheck[ 33 ];
new const gTrailSpriteIndex[] = "sprites/zbeam2.spr";
const IN_MOVING = IN_FORWARD | IN_BACK | IN_MOVELEFT | IN_MOVERIGHT | IN_JUMP;
public plugin_init()
{
register_plugin( "Ownerw Trail", PLUGIN_VERSION, "tuty" );
register_forward( FM_CmdStart, "forward_cmdstart" );
register_clcmd( "say /trail", "cmdMakeOwnerTrail" );
register_clcmd( "say_team /trail", "cmdMakeOwnerTrail" );
RegisterHam(Ham_Spawn, "player", "Fwd_Spawn", 1);
}
public plugin_precache()
{
gTrailSprite = precache_model( gTrailSpriteIndex );
}
public client_connect( id )
{
bPlayerTrailStatus[ id ] = TRAIL_INACTIVE;
}
public Fwd_Spawn(id)
{
if(get_user_flags(id) & ACCES_FLAG && crxranks_get_user_level(id) >= 31)
{
bPlayerTrailStatus[id] = TRAIL_ACTIVE;
gTrailRandomColor[ id ][ 0 ] = random_num( 0, 255 );
gTrailRandomColor[ id ][ 1 ] = random_num( 0, 255 );
gTrailRandomColor[ id ][ 2 ] = random_num( 0, 255 );
set_task(10.0, "change_color", id + TASKID, .flags="b");
}
}
public change_color(taskid)
{
new id = taskid - TASKID;
if(!is_user_alive(id))
{
remove_task(taskid);
return;
}
gTrailRandomColor[ id ][ 0 ] = random_num( 0, 255 );
gTrailRandomColor[ id ][ 1 ] = random_num( 0, 255 );
gTrailRandomColor[ id ][ 2 ] = random_num( 0, 255 );
}
public cmdMakeOwnerTrail( id )
{
if( !is_user_alive( id ) )
{
client_print( id, print_chat, "Öldüğünüzde bu komutu kullanamazsınız!" );
return PLUGIN_HANDLED;
}
if(crxranks_get_user_level(id) >= 31)
{
client_print( id, print_chat, " Sadece Level 31 ler Bu Menuye Girebilir!" );
return PLUGIN_HANDLED;
}
if( bPlayerTrailStatus[ id ] == TRAIL_ACTIVE )
{
client_print( id, print_chat, " Trail Kapatildi." );
bPlayerTrailStatus[ id ] = TRAIL_INACTIVE;
UTIL_KillBeamFollow( id );
bflNextCheck[ id ] = -5000.0;
return PLUGIN_HANDLED;
}
if( bPlayerTrailStatus[ id ] == TRAIL_INACTIVE )
{
client_print( id, print_chat, "Trail etkinleştirildi! " );
bPlayerTrailStatus[ id ] = TRAIL_ACTIVE;
gTrailRandomColor[ id ][ 0 ] = random_num( 0, 255 );
gTrailRandomColor[ id ][ 1 ] = random_num( 0, 255 );
gTrailRandomColor[ id ][ 2 ] = random_num( 0, 255 );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
public forward_cmdstart( id, handle )
{
if( !is_user_alive( id ) || bPlayerTrailStatus[ id ] == TRAIL_INACTIVE )
{
return FMRES_IGNORED;
}
if(crxranks_get_user_level(id) >= 31)
{
return FMRES_IGNORED;
}
new iButton = get_uc( handle, UC_Buttons );
if( !( iButton & IN_MOVING ) )
{
new Float:flGameTime = get_gametime();
if( bflNextCheck[ id ] < flGameTime )
{
UTIL_KillBeamFollow( id );
UTIL_BeamFollow( id );
bflNextCheck[ id ] = flGameTime + ( TRAIL_LIFE / 8 );
}
}
return FMRES_IGNORED;
}
stock UTIL_BeamFollow( const iClient )
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_BEAMFOLLOW );
write_short( iClient );
write_short( gTrailSprite );
write_byte( TRAIL_LIFE );
write_byte( 20 );
write_byte( gTrailRandomColor[ iClient ][ 0 ] );
write_byte( gTrailRandomColor[ iClient ][ 1 ] );
write_byte( gTrailRandomColor[ iClient ][ 2 ] );
write_byte( 255 );
message_end();
}
stock UTIL_KillBeamFollow( const iClient )
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( TE_KILLBEAM );
write_short( iClient );
message_end();
}