[REZOLVAT]Eroare LOGS

Discutii legate de instalarea, configurarea si modificarea unui server de Counter-Strike.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

L1oN98
Membru, skill 0
Membru, skill 0
Posts: 93
Joined: 26 Nov 2018, 19:52
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

18 Jan 2019, 15:13

Am urmatoarea eroare in logs pentru pluginul "trivia", am dat si debug:

Code: Select all

L 01/17/2019 - 17:47:49: Start of error session.
L 01/17/2019 - 17:47:49: Info (map "deathrun_forest") (file "addons/amxmodx/logs/error_20190117.log")
L 01/17/2019 - 17:47:49: [AMXX] Displaying debug trace (plugin "trivia.amxx")
L 01/17/2019 - 17:47:49: [AMXX] Run time error 4: index out of bounds 
L 01/17/2019 - 17:47:49: [AMXX]    [0] ColorChat.inc::ColorChat (line 53)
L 01/17/2019 - 17:47:49: [AMXX]    [1] 9smil7f7.sma.p::CountAnswerTime (line 278)
Plugin:
| Afiseaza codul
#include < amxmodx >
#include < cstrike >
#include < fun >
#include < ColorChat >

#pragma tabsize 0

#define PLUGIN "DR"
#define VERSION "1.0"

#define      MagicWordTask      112233
#define      MagicWordSecondTask   332211
#define VITEZA      500

enum
{
PRIZE_SPEED,
PRIZE_NOCLIP,
PRIZE_GODMODE,
PRIZE_HP,
PRIZE_RENDERING,
PRIZE_ARMOR,
PRIZE_AK47,
PRIZE_NADES,
PRIZE_AWP
}

new const g_szSmallLetters[    ] =
{
'a','b','c','d',
'e','f','g','h',
'j','k',
'm','n','p',
'q','r','s','t',
'u','v','w','x',
'y','z'
};


new const g_szLargeLetters[    ] =
{
'A','B','C','D',
'E','F','G','H',
'I','J','K','L',
'M','N','P',
'Q','R','S','T',
'U','V','W','X',
'Y','Z'
};


new const g_szNumbers[    ]  =  
{
'1',
'2','3',
'4','5',
'6','7',
'8','9'
};

new const g_szSymbols[    ]  =  
{
'!','?'
};
new bar;
new gCvarMagicWordIterval;
new gCvarMagicWordAnswerTime;
new gCvarMagicWordHP;

new g_iAnswerTime = 0;
new g_szMagicWord[ 32 ];

new bool:g_bPlayersCanAnswer  =  false;
new bool:viteza[31];
new bool:invizibilitate[32];

new SyncHudMessage;

public plugin_init( )
{
register_plugin( PLUGIN, VERSION, "Askhanar" );

gCvarMagicWordIterval =  register_cvar( "fmu_mw_interval",  "180"  );
gCvarMagicWordAnswerTime = register_cvar( "fmu_mw_answertime",  "15"  );
gCvarMagicWordHP = register_cvar( "fmu_mw_hp",  "50"  );

register_clcmd( "amx_magicword", "ClCmdMagicWord" );

register_clcmd( "say", "CheckForMagicWord" );
register_clcmd( "say_team", "CheckForMagicWord" );
register_event("CurWeapon", "event_CurWeapon", "be", "1=1");
register_event("HLTV", "event_newround", "a", "1=0", "2=0");

bar = get_user_msgid("BarTime");   

SyncHudMessage  =  CreateHudSyncObj(    );
set_task(  15.0,  "ChooseRandomWord",  MagicWordTask  );

}

public event_newround()
{
arrayset(viteza, false, charsmax(viteza));

new i, players[32], num, id;
get_players(players, num);
for(i = 0; i < num; i++)
{
id = players;
if(!is_user_alive(id))
continue;

if(invizibilitate[id])
{
invizibilitate[id] = false;
set_user_rendering(id);
}
}
}

public client_death(killer, victim, wpnindex, hitplace, tk)
{
if(!is_user_alive(killer))
return;

if(killer == victim)
return;

if(viteza[killer]) viteza[killer] = false;
if(invizibilitate[killer])
{
invizibilitate[killer] = false;
set_user_rendering(killer);
}
}


public client_putinserver(id)
{
viteza[id] = false;
invizibilitate[id] = false;
}

public ClCmdMagicWord( id )
{
if( !UserHasAcces( id ) )
{
client_cmd( id, "echo Nu ai acces la aceasta comanda !" );
return PLUGIN_HANDLED;
}

read_argv( 1, g_szMagicWord, 14 );
if( equal( g_szMagicWord, "" ) )
{

remove_task( MagicWordTask );
remove_task( MagicWordSecondTask );
g_bPlayersCanAnswer = false;

ChooseRandomWord( );
}
else
{
remove_task( MagicWordTask );
remove_task( MagicWordSecondTask );
g_bPlayersCanAnswer = false;

DisplayMagicWord( );
}


return 1;
}

public CheckForMagicWord(  id  )
{
static szSaid[ 192 ];
read_args( szSaid, sizeof ( szSaid ) -1 );
remove_quotes( szSaid );

if( equali( szSaid, "" )  || !g_bPlayersCanAnswer || cs_get_user_team(id) == CS_TEAM_SPECTATOR )   return PLUGIN_CONTINUE;

if( equal( szSaid, g_szMagicWord ) )
{
if(cs_get_user_team( id ) == CS_TEAM_T)
{
ColorChat(id,RED,"^x04[DR]^x01 Doar^x03 CT^x01 beneficiaza de acest sistem!")
return PLUGIN_HANDLED
}
g_bPlayersCanAnswer  =  false;
client_cmd( 0, "spk woop" );
GiveUserPrize( id );
return PLUGIN_HANDLED
}

return PLUGIN_CONTINUE;
}


public ChooseRandomWord( )
{
if( !get_playersnum( ) )
{
set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
return;
}

new iLen = random_num( 7, 8 );
formatex( g_szMagicWord, sizeof ( g_szMagicWord ) -1, "" );

for( new i = 0; i < iLen; i++ )
g_szMagicWord[ i ] = GetRandomCharacter( );

StartMagicWord( );
client_cmd( 0, "spk doop" );

set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
}

public DisplayMagicWord( )
{
if( !get_playersnum( ) )
{
   set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
   return;
}

StartMagicWord( );
client_cmd( 0, "spk doop" );

set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
}

GetRandomCharacter( )
{
new Float:fRandom = random_float( 1.0, 100.0 );

if( fRandom <= 25.0 )
{
return g_szSmallLetters[ random( sizeof ( g_szSmallLetters ) ) ];
}

else if( fRandom > 25.0 && fRandom <= 50.0 )
{
return g_szLargeLetters[ random( sizeof ( g_szLargeLetters ) ) ];
}

else if( fRandom > 50.0 && fRandom < 75.0 )
{
return g_szNumbers[ random( sizeof ( g_szNumbers ) ) ];
}
else if( fRandom > 75.0 )
{
return g_szSymbols[ random( sizeof ( g_szSymbols ) ) ];
}

return EOS;
}

public StartMagicWord( )
{
g_bPlayersCanAnswer = true;

g_iAnswerTime = get_pcvar_num( gCvarMagicWordAnswerTime );
CountAnswerTime( );

}

public CountAnswerTime( )
{

if( g_bPlayersCanAnswer )
{

if( g_iAnswerTime <= 0 )
{
   g_bPlayersCanAnswer  =  false;
   ColorChat( 1, RED, "^x04[DR]^x01 Nu a scris nimeni cuvantul, poate data viitoare.." );
   return PLUGIN_HANDLED;
}

set_hudmessage( 0, 255, 255, -1.0, 0.10, 0, 0.0, 1.0, 0.0, 0.1, 2 );
ShowSyncHudMsg( 0, SyncHudMessage, "Cine scrie primul:     %s    castiga un premiu!^n %i secund%s ramas%s !!",
g_szMagicWord, g_iAnswerTime, g_iAnswerTime  ==  1 ? "a" : "e", g_iAnswerTime  ==  1 ? "a" : "e" );

g_iAnswerTime--;

set_task( 1.0, "CountAnswerTime", MagicWordSecondTask );
}

return PLUGIN_CONTINUE;
}

public GiveUserPrize( id )
{

new szName[ 55 ];
get_user_name( id, szName, sizeof ( szName ) -1 );

new iRandomPrize = random_num( PRIZE_SPEED, PRIZE_AWP);

switch( iRandomPrize )
{

case PRIZE_SPEED:
{
   viteza[id] = true;
   set_user_maxspeed(id, float(VITEZA));
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 400 Speed^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_NOCLIP:
{
   set_user_noclip(id,1);
   set_task(8.0,"removeClip",id);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 NOCLIP^x01 8 sec!", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
   
   message_begin(MSG_ONE_UNRELIABLE, bar, .player=id);
   write_short(8);
   message_end();
   
}   

case PRIZE_GODMODE:
{
   set_user_godmode(id,1);
   set_task(10.0,"removeGodMode",id);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si este^x03 Invincibil^x01 10 Secunde!", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
   
   message_begin(MSG_ONE_UNRELIABLE, bar, .player=id);
   write_short(10);
   message_end();
}

case PRIZE_HP:
{
   set_user_health( id, get_user_health( id ) + get_pcvar_num( gCvarMagicWordHP ) );
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 %i HP^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_RENDERING:
{
   invizibilitate[id] = true;
   set_user_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 32 );
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 Invizibilitate^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_ARMOR:
{
   set_user_armor(id, 100);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 100 Armura^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_AK47:
{
   cs_set_weapon_ammo( give_item( id, "weapon_ak47" ), 50 );
   cs_set_user_bpammo(id, CSW_AK47, 99);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 AK47^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_NADES:
{
   give_item( id, "weapon_hegrenade" );
   give_item( id, "weapon_smokegrenade" );
   
   cs_set_user_bpammo( id, CSW_HEGRENADE, 3 );
   cs_set_user_bpammo( id, CSW_SMOKEGRENADE, 1 );
   
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 grenade ^x01 !", szName, g_szMagicWord );
}
case PRIZE_AWP:
{
   cs_set_weapon_ammo( give_item( id, "weapon_awp" ), 20 );
   cs_set_user_bpammo(id, CSW_AWP, 99);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 AWP ^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}


}

formatex( g_szMagicWord, sizeof ( g_szMagicWord ) -1, "" );
return 0;
}

public removeGodMode(id) {
set_user_godmode(id,0);
ColorChat( id, RED, "^x04[DR]^x01 Nu mai esti ^x03Invincibil!");  
}

public removeClip(id) {
set_user_noclip(id,0);
ColorChat( id, RED, "^x04[DR]^x01 NoClip ^x03OFF!");  
}

public event_CurWeapon(id)
{
if(is_user_alive(id))
{
if(get_user_maxspeed(id) != 1.0 && viteza[id] == true)
{
   set_user_maxspeed(id, float(VITEZA));
}
}

return PLUGIN_CONTINUE;
}

public ShakeScreen(id, const Float:iSeconds)
{
static g_msg_SS = 0;
if(!g_msg_SS)
g_msg_SS = get_user_msgid("ScreenShake");

message_begin(MSG_ONE, g_msg_SS, _, id);
write_short(floatround(4096.0 * iSeconds, floatround_round));
write_short(floatround(4096.0 * iSeconds, floatround_round));
write_short(1<<13);
message_end();
}

stock bool:UserHasAcces( id )
{

if( get_user_flags( id ) & ADMIN_RCON )
   return true;
   
   return false;
   
}
Last edited by L1oN98 on 10 Feb 2019, 12:56, edited 2 times in total.
Zonek
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2952
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 39 times
Been thanked: 454 times
Contact:

18 Jan 2019, 15:48

| Afiseaza codul
[code]
#include < amxmodx >
#include < cstrike >
#include < fun >
#include < ColorChat >

#pragma tabsize 0

#define PLUGIN "DR"
#define VERSION "1.0"

#define      MagicWordTask      112233
#define      MagicWordSecondTask   332211
#define VITEZA      500

enum
{
PRIZE_SPEED,
PRIZE_NOCLIP,
PRIZE_GODMODE,
PRIZE_HP,
PRIZE_RENDERING,
PRIZE_ARMOR,
PRIZE_AK47,
PRIZE_NADES,
PRIZE_AWP
}

new const g_szSmallLetters[    ] =
{
'a','b','c','d',
'e','f','g','h',
'j','k',
'm','n','p',
'q','r','s','t',
'u','v','w','x',
'y','z'
};


new const g_szLargeLetters[    ] =
{
'A','B','C','D',
'E','F','G','H',
'I','J','K','L',
'M','N','P',
'Q','R','S','T',
'U','V','W','X',
'Y','Z'
};


new const g_szNumbers[    ]  =  
{
'1',
'2','3',
'4','5',
'6','7',
'8','9'
};

new const g_szSymbols[    ]  =  
{
'!','?'
};
new bar;
new gCvarMagicWordIterval;
new gCvarMagicWordAnswerTime;
new gCvarMagicWordHP;

new g_iAnswerTime = 0;
new g_szMagicWord[ 32 ];

new bool:g_bPlayersCanAnswer  =  false;
new bool:viteza[31];
new bool:invizibilitate[32];

new SyncHudMessage;

public plugin_init( )
{
register_plugin( PLUGIN, VERSION, "Askhanar" );

gCvarMagicWordIterval =  register_cvar( "fmu_mw_interval",  "180"  );
gCvarMagicWordAnswerTime = register_cvar( "fmu_mw_answertime",  "15"  );
gCvarMagicWordHP = register_cvar( "fmu_mw_hp",  "50"  );

register_clcmd( "amx_magicword", "ClCmdMagicWord" );

register_clcmd( "say", "CheckForMagicWord" );
register_clcmd( "say_team", "CheckForMagicWord" );
register_event("CurWeapon", "event_CurWeapon", "be", "1=1");
register_event("HLTV", "event_newround", "a", "1=0", "2=0");

bar = get_user_msgid("BarTime");   

SyncHudMessage  =  CreateHudSyncObj(    );
set_task(  15.0,  "ChooseRandomWord",  MagicWordTask  );

}

public event_newround()
{
arrayset(viteza, false, charsmax(viteza));

new i, players[32], num, id;
get_players(players, num);
for(i = 0; i < num; i++)
{
id = players;
if(!is_user_alive(id))
continue;

if(invizibilitate[id])
{
invizibilitate[id] = false;
set_user_rendering(id);
}
}
}

public client_death(killer, victim, wpnindex, hitplace, tk)
{
if(!is_user_alive(killer))
return;

if(killer == victim)
return;

if(viteza[killer]) viteza[killer] = false;
if(invizibilitate[killer])
{
invizibilitate[killer] = false;
set_user_rendering(killer);
}
}


public client_putinserver(id)
{
viteza[id] = false;
invizibilitate[id] = false;
}

public ClCmdMagicWord( id )
{
if( !UserHasAcces( id ) )
{
client_cmd( id, "echo Nu ai acces la aceasta comanda !" );
return PLUGIN_HANDLED;
}

read_argv( 1, g_szMagicWord, 14 );
if( equal( g_szMagicWord, "" ) )
{

remove_task( MagicWordTask );
remove_task( MagicWordSecondTask );
g_bPlayersCanAnswer = false;

ChooseRandomWord( );
}
else
{
remove_task( MagicWordTask );
remove_task( MagicWordSecondTask );
g_bPlayersCanAnswer = false;

DisplayMagicWord( );
}


return 1;
}

public CheckForMagicWord(  id  )
{
static szSaid[ 192 ];
read_args( szSaid, sizeof ( szSaid ) -1 );
remove_quotes( szSaid );

if( equali( szSaid, "" )  || !g_bPlayersCanAnswer || cs_get_user_team(id) == CS_TEAM_SPECTATOR )   return PLUGIN_CONTINUE;

if( equal( szSaid, g_szMagicWord ) )
{
if(cs_get_user_team( id ) == CS_TEAM_T)
{
ColorChat(id,RED,"^x04[DR]^x01 Doar^x03 CT^x01 beneficiaza de acest sistem!")
return PLUGIN_HANDLED
}
g_bPlayersCanAnswer  =  false;
client_cmd( 0, "spk woop" );
GiveUserPrize( id );
return PLUGIN_HANDLED
}

return PLUGIN_CONTINUE;
}


public ChooseRandomWord( )
{
if( !get_playersnum( ) )
{
set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
return;
}

new iLen = random_num( 7, 8 );
formatex( g_szMagicWord, sizeof ( g_szMagicWord ) -1, "" );

for( new i = 0; i < iLen; i++ )
g_szMagicWord[ i ] = GetRandomCharacter( );

StartMagicWord( );
client_cmd( 0, "spk doop" );

set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
}

public DisplayMagicWord( )
{
if( !get_playersnum( ) )
{
   set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
   return;
}

StartMagicWord( );
client_cmd( 0, "spk doop" );

set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
}

GetRandomCharacter( )
{
new Float:fRandom = random_float( 1.0, 100.0 );

if( fRandom <= 25.0 )
{
return g_szSmallLetters[ random( sizeof ( g_szSmallLetters ) ) ];
}

else if( fRandom > 25.0 && fRandom <= 50.0 )
{
return g_szLargeLetters[ random( sizeof ( g_szLargeLetters ) ) ];
}

else if( fRandom > 50.0 && fRandom < 75.0 )
{
return g_szNumbers[ random( sizeof ( g_szNumbers ) ) ];
}
else if( fRandom > 75.0 )
{
return g_szSymbols[ random( sizeof ( g_szSymbols ) ) ];
}

return EOS;
}

public StartMagicWord( )
{
g_bPlayersCanAnswer = true;

g_iAnswerTime = get_pcvar_num( gCvarMagicWordAnswerTime );
CountAnswerTime( );

}

public CountAnswerTime( )
{

if( g_bPlayersCanAnswer )
{

if( g_iAnswerTime <= 0 )
{
   g_bPlayersCanAnswer  =  false;
   ColorChat( 0, RED, "^x04[DR]^x01 Nu a scris nimeni cuvantul, poate data viitoare.." );
   return PLUGIN_HANDLED;
}

set_hudmessage( 0, 255, 255, -1.0, 0.10, 0, 0.0, 1.0, 0.0, 0.1, 2 );
ShowSyncHudMsg( 0, SyncHudMessage, "Cine scrie primul:     %s    castiga un premiu!^n %i secund%s ramas%s !!",
g_szMagicWord, g_iAnswerTime, g_iAnswerTime  ==  1 ? "a" : "e", g_iAnswerTime  ==  1 ? "a" : "e" );

g_iAnswerTime--;

set_task( 1.0, "CountAnswerTime", MagicWordSecondTask );
}

return PLUGIN_CONTINUE;
}

public GiveUserPrize( id )
{

new szName[ 55 ];
get_user_name( id, szName, sizeof ( szName ) -1 );

new iRandomPrize = random_num( PRIZE_SPEED, PRIZE_AWP);

switch( iRandomPrize )
{

case PRIZE_SPEED:
{
   viteza[id] = true;
   set_user_maxspeed(id, float(VITEZA));
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 400 Speed^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_NOCLIP:
{
   set_user_noclip(id,1);
   set_task(8.0,"removeClip",id);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 NOCLIP^x01 8 sec!", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
   
   message_begin(MSG_ONE_UNRELIABLE, bar, .player=id);
   write_short(8);
   message_end();
   
}   

case PRIZE_GODMODE:
{
   set_user_godmode(id,1);
   set_task(10.0,"removeGodMode",id);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si este^x03 Invincibil^x01 10 Secunde!", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
   
   message_begin(MSG_ONE_UNRELIABLE, bar, .player=id);
   write_short(10);
   message_end();
}

case PRIZE_HP:
{
   set_user_health( id, get_user_health( id ) + get_pcvar_num( gCvarMagicWordHP ) );
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 %i HP^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_RENDERING:
{
   invizibilitate[id] = true;
   set_user_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 32 );
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 Invizibilitate^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_ARMOR:
{
   set_user_armor(id, 100);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 100 Armura^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_AK47:
{
   cs_set_weapon_ammo( give_item( id, "weapon_ak47" ), 50 );
   cs_set_user_bpammo(id, CSW_AK47, 99);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 AK47^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_NADES:
{
   give_item( id, "weapon_hegrenade" );
   give_item( id, "weapon_smokegrenade" );
   
   cs_set_user_bpammo( id, CSW_HEGRENADE, 3 );
   cs_set_user_bpammo( id, CSW_SMOKEGRENADE, 1 );
   
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 grenade ^x01 !", szName, g_szMagicWord );
}
case PRIZE_AWP:
{
   cs_set_weapon_ammo( give_item( id, "weapon_awp" ), 20 );
   cs_set_user_bpammo(id, CSW_AWP, 99);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 AWP ^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}


}

formatex( g_szMagicWord, sizeof ( g_szMagicWord ) -1, "" );
return 0;
}

public removeGodMode(id) {
set_user_godmode(id,0);
ColorChat( id, RED, "^x04[DR]^x01 Nu mai esti ^x03Invincibil!");  
}

public removeClip(id) {
set_user_noclip(id,0);
ColorChat( id, RED, "^x04[DR]^x01 NoClip ^x03OFF!");  
}

public event_CurWeapon(id)
{
if(is_user_alive(id))
{
if(get_user_maxspeed(id) != 1.0 && viteza[id] == true)
{
   set_user_maxspeed(id, float(VITEZA));
}
}

return PLUGIN_CONTINUE;
}

public ShakeScreen(id, const Float:iSeconds)
{
static g_msg_SS = 0;
if(!g_msg_SS)
g_msg_SS = get_user_msgid("ScreenShake");

message_begin(MSG_ONE, g_msg_SS, _, id);
write_short(floatround(4096.0 * iSeconds, floatround_round));
write_short(floatround(4096.0 * iSeconds, floatround_round));
write_short(1<<13);
message_end();
}

stock bool:UserHasAcces( id )
{

if( get_user_flags( id ) & ADMIN_RCON )
   return true;
   
   return false;
   
}
[/code]
Faceți cerere bine detaliată aici și respectând modelul dacă vreți ajutor. Nu-mi mai dați add doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz!
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici, iar dacă sunt ceva probleme sau aveți dvs. probleme nu ezitați să luați legătura cu mine.
HOST CS1.6
L1oN98
Membru, skill 0
Membru, skill 0
Posts: 93
Joined: 26 Nov 2018, 19:52
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

18 Jan 2019, 17:09

Perfect, multumesc Adryyy:) +1
User avatar
WHOAMI?
Super moderator
Super moderator
Posts: 829
Joined: 17 Dec 2013, 19:51
Detinator Steam: Da
Detinator server CS: SURF.USP.RO
Reputatie: Super Moderator
Fost Membru Club eXtreamCS (o luna)
Location: New Orleans
Has thanked: 10 times
Been thanked: 5 times

18 Jan 2019, 17:27

L1oN98 wrote:Perfect, multumesc Adryyy:) +1
Marcat ca "Rezolvat"
L1oN98
Membru, skill 0
Membru, skill 0
Posts: 93
Joined: 26 Nov 2018, 19:52
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

18 Jan 2019, 17:29

Edit:
Initial am crezut ca s-a rezolvat dar....

Code: Select all

L 01/18/2019 - 17:18:33: Start of error session.
L 01/18/2019 - 17:18:33: Info (map "deathrun_projetocs2") (file "addons/amxmodx/logs/error_20190118.log")
L 01/18/2019 - 17:18:33: [AMXX] Displaying debug trace (plugin "trivia.amxx")
L 01/18/2019 - 17:18:33: [AMXX] Run time error 4: index out of bounds 
L 01/18/2019 - 17:18:33: [AMXX]    [0] ColorChat.inc::ColorChat (line 53)
L 01/18/2019 - 17:18:33: [AMXX]    [1] 23640tho.sma.p::CountAnswerTime (line 278)
User avatar
faKe91
Fost moderator
Fost moderator
Posts: 1100
Joined: 07 Oct 2014, 17:49
Detinator Steam: Da
CS Status: I <3 Heavy Metal
SteamID: dogseatmypancreas
Reputatie: Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Fond eXtream: 0
Location: Republica Moldova, Chișinău
Has thanked: 7 times
Been thanked: 10 times

19 Jan 2019, 14:09

Daca ai amxmodx >= 1.8.3
| Afiseaza codul
[code]#include <amxmodx>
#include <cstrike>
#include <fun>

#define PLUGIN "DR"
#define VERSION "1.0"

#define MagicWordTask 112233
#define MagicWordSecondTask 332211
#define VITEZA 500

enum
{
	PRIZE_SPEED,
	PRIZE_NOCLIP,
	PRIZE_GODMODE,
	PRIZE_HP,
	PRIZE_RENDERING,
	PRIZE_ARMOR,
	PRIZE_AK47,
	PRIZE_NADES,
	PRIZE_AWP
}

new const g_szSmallLetters[] =
{
	'a','b','c','d',
	'e','f','g','h',
	'j','k',
	'm','n','p',
	'q','r','s','t',
	'u','v','w','x',
	'y','z'
};

new const g_szLargeLetters[] =
{
	'A','B','C','D',
	'E','F','G','H',
	'I','J','K','L',
	'M','N','P',
	'Q','R','S','T',
	'U','V','W','X',
	'Y','Z'
};


new const g_szNumbers[]  =  
{
	'1',
	'2','3',
	'4','5',
	'6','7',
	'8','9'
};

new const g_szSymbols[]  =  
{
	'!','?'
};

new bar;
new gCvarMagicWordIterval;
new gCvarMagicWordAnswerTime;
new gCvarMagicWordHP;

new g_iAnswerTime = 0;
new g_szMagicWord[ 32 ];

new bool:g_bPlayersCanAnswer  =  false;
new bool:viteza[31];
new bool:invizibilitate[32];

new SyncHudMessage;

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, "Askhanar");

	gCvarMagicWordIterval =  register_cvar("fmu_mw_interval",  "180" );
	gCvarMagicWordAnswerTime = register_cvar("fmu_mw_answertime",  "15" );
	gCvarMagicWordHP = register_cvar("fmu_mw_hp",  "50" );

	register_clcmd("amx_magicword", "ClCmdMagicWord");

	register_clcmd("say", "CheckForMagicWord");
	register_clcmd("say_team", "CheckForMagicWord");
	register_event("CurWeapon", "event_CurWeapon", "be", "1=1");
	register_event("HLTV", "event_newround", "a", "1=0", "2=0");

	bar = get_user_msgid("BarTime");   

	SyncHudMessage  =  CreateHudSyncObj(  );
	set_task( 15.0,  "ChooseRandomWord",  MagicWordTask );
}

public event_newround()
{
	arrayset(viteza, false, charsmax(viteza));

	new i, players[32], num, id;
	get_players(players, num);
	for(i = 0; i < num; i++)
	{
		id = players;
		if(!is_user_alive(id))
			continue;
		
		if(invizibilitate[id])
		{
			invizibilitate[id] = false;
			set_user_rendering(id);
		}
	}
}

public client_death(killer, victim, wpnindex, hitplace, tk)
{
	if(!is_user_alive(killer))
		return;
		
	if(killer == victim)
		return;

	if(viteza[killer]) 
		viteza[killer] = false;

	if(invizibilitate[killer])
	{
		invizibilitate[killer] = false;
		set_user_rendering(killer);
	}
}


public client_putinserver(id)
{
	viteza[id] = false;
	invizibilitate[id] = false;
}

public ClCmdMagicWord(id)
{
	if(!UserHasAcces(id))
	{
		client_cmd(id, "Nu ai acces la aceasta comanda !");
		return PLUGIN_HANDLED;
	}

	read_argv(1, g_szMagicWord, 14);
	if(equal(g_szMagicWord, ""))
	{
		remove_task(MagicWordTask);
		remove_task(MagicWordSecondTask);
		g_bPlayersCanAnswer = false;

		ChooseRandomWord();
	}
	else
	{
		remove_task(MagicWordTask);
		remove_task(MagicWordSecondTask);
		g_bPlayersCanAnswer = false;

		DisplayMagicWord();
	}

	return PLUGIN_HANDLED;
}

public CheckForMagicWord( id )
{
	static szSaid[ 192 ];
	read_args(szSaid, sizeof (szSaid) -1);
	remove_quotes(szSaid);

	if(equali(szSaid, "")  || !g_bPlayersCanAnswer || cs_get_user_team(id) == CS_TEAM_SPECTATOR)
		return PLUGIN_CONTINUE;

	if(equal(szSaid, g_szMagicWord))
	{
		if(cs_get_user_team(id) == CS_TEAM_T)
		{
			client_print_color(id,print_team_red, "^4[DR]^1 Doar^3 CT^1 beneficiaza de acest sistem!")
			return PLUGIN_HANDLED
		}
		
		g_bPlayersCanAnswer  =  false;
		client_cmd(0, "spk woop");
		GiveUserPrize(id);

		return PLUGIN_HANDLED
	}

	return PLUGIN_CONTINUE;
}

public ChooseRandomWord()
{
	if(!get_playersnum())
	{
		set_task(float(get_pcvar_num(gCvarMagicWordIterval)), "ChooseRandomWord", MagicWordTask);
		return;
	}

	new iLen = random_num(7, 8);
	formatex(g_szMagicWord, sizeof (g_szMagicWord) -1, "");

	for(new i = 0; i < iLen; i++)
	g_szMagicWord[ i ] = GetRandomCharacter();

	StartMagicWord();
	client_cmd(0, "spk doop");

	set_task(float(get_pcvar_num(gCvarMagicWordIterval)), "ChooseRandomWord", MagicWordTask);
}

public DisplayMagicWord()
{
	if(!get_playersnum())
	{
		set_task(float(get_pcvar_num(gCvarMagicWordIterval)), "ChooseRandomWord", MagicWordTask);
		return;
	}

	StartMagicWord();
	client_cmd(0, "spk doop");

	set_task(float(get_pcvar_num(gCvarMagicWordIterval)), "ChooseRandomWord", MagicWordTask);
}

GetRandomCharacter()
{
	new Float:fRandom = random_float(1.0, 100.0);

	if(fRandom <= 25.0)
		return g_szSmallLetters[ random(sizeof (g_szSmallLetters)) ];

	else if(fRandom > 25.0 && fRandom <= 50.0)
		return g_szLargeLetters[ random(sizeof (g_szLargeLetters)) ];

	else if(fRandom > 50.0 && fRandom < 75.0)
		return g_szNumbers[ random(sizeof (g_szNumbers)) ];

	else if(fRandom > 75.0)
		return g_szSymbols[ random(sizeof (g_szSymbols)) ];

	return EOS;
}

public StartMagicWord()
{
	g_bPlayersCanAnswer = true;

	g_iAnswerTime = get_pcvar_num(gCvarMagicWordAnswerTime);
	CountAnswerTime();
}

public CountAnswerTime()
{
	if(g_bPlayersCanAnswer)
	{
		if(g_iAnswerTime <= 0)
		{
			g_bPlayersCanAnswer  =  false;
			client_print_color(0, print_team_red, "^4[DR]^1 Nu a scris nimeni cuvantul, poate data viitoare..");
			return PLUGIN_HANDLED;
		}

		set_hudmessage(0, 255, 255, -1.0, 0.10, 0, 0.0, 1.0, 0.0, 0.1, 2);
		ShowSyncHudMsg(0, SyncHudMessage, "Cine scrie primul:     %s    castiga un premiu!^n %i secund%s ramas%s !!",
		g_szMagicWord, g_iAnswerTime, g_iAnswerTime  ==  1 ? "a" : "e", g_iAnswerTime  ==  1 ? "a" : "e");

		g_iAnswerTime--;

		set_task(1.0, "CountAnswerTime", MagicWordSecondTask);
	}

	return PLUGIN_CONTINUE;
}

public GiveUserPrize(id)
{
	new szName[ 55 ];
	get_user_name(id, szName, sizeof (szName) -1);

	new iRandomPrize = random_num(PRIZE_SPEED, PRIZE_AWP);

	switch(iRandomPrize)
	{
		case PRIZE_SPEED:
		{
			viteza[id] = true;
			set_user_maxspeed(id, float(VITEZA));
			client_print_color(0, print_team_red, "^4[DR]^3 %s^1 a scris primul^3 %s^1 si a primit^3 400 Speed^1 !", szName, g_szMagicWord, get_pcvar_num(gCvarMagicWordHP));
		}
		case PRIZE_NOCLIP:
		{
			set_user_noclip(id,1);
			set_task(8.0,"removeClip",id);
			client_print_color(0, print_team_red, "^4[DR]^3 %s^1 a scris primul^3 %s^1 si a primit^3 NOCLIP^1 8 sec!", szName, g_szMagicWord, get_pcvar_num(gCvarMagicWordHP));
   
			message_begin(MSG_ONE_UNRELIABLE, bar, .player=id);
			write_short(8);
			message_end(); 
		}
		case PRIZE_GODMODE:
		{
			set_user_godmode(id,1);
			set_task(10.0,"removeGodMode",id);
			client_print_color(0, print_team_red, "^4[DR]^3 %s^1 a scris primul^3 %s^1 si este^3 Invincibil^1 10 Secunde!", szName, g_szMagicWord, get_pcvar_num(gCvarMagicWordHP));
   
			message_begin(MSG_ONE_UNRELIABLE, bar, .player=id);
			write_short(10);
			message_end();
		}
		case PRIZE_HP:
		{
			set_user_health(id, get_user_health(id) + get_pcvar_num(gCvarMagicWordHP));
			client_print_color(0, print_team_red, "^4[DR]^3 %s^1 a scris primul^3 %s^1 si a primit^3 %i HP^1 !", szName, g_szMagicWord, get_pcvar_num(gCvarMagicWordHP));
		}
		case PRIZE_RENDERING:
		{
			invizibilitate[id] = true;
			set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 32);
			client_print_color(0, print_team_red, "^4[DR]^3 %s^1 a scris primul^3 %s^1 si a primit^3 Invizibilitate^1 !", szName, g_szMagicWord, get_pcvar_num(gCvarMagicWordHP));
		}
		case PRIZE_ARMOR:
		{
			set_user_armor(id, 100);
			client_print_color(0, print_team_red, "^4[DR]^3 %s^1 a scris primul^3 %s^1 si a primit^3 100 Armura^1 !", szName, g_szMagicWord, get_pcvar_num(gCvarMagicWordHP));
		}
		case PRIZE_AK47:
		{
			cs_set_weapon_ammo(give_item(id, "weapon_ak47"), 50);
			cs_set_user_bpammo(id, CSW_AK47, 99);
			client_print_color(0, print_team_red, "^4[DR]^3 %s^1 a scris primul^3 %s^1 si a primit^3 AK47^1 !", szName, g_szMagicWord, get_pcvar_num(gCvarMagicWordHP));
		}
		case PRIZE_NADES:
		{
			give_item(id, "weapon_hegrenade");
			give_item(id, "weapon_smokegrenade");
   
			cs_set_user_bpammo(id, CSW_HEGRENADE, 3);
			cs_set_user_bpammo(id, CSW_SMOKEGRENADE, 1);
   
			client_print_color(0, print_team_red, "^4[DR]^3 %s^1 a scris primul^3 %s^1 si a primit^3 grenade ^1 !", szName, g_szMagicWord);
		}
		case PRIZE_AWP:
		{
			cs_set_weapon_ammo(give_item(id, "weapon_awp"), 20);
			cs_set_user_bpammo(id, CSW_AWP, 99);
			client_print_color(0, print_team_red, "^4[DR]^3 %s^1 a scris primul^3 %s^1 si a primit^3 AWP ^1 !", szName, g_szMagicWord, get_pcvar_num(gCvarMagicWordHP));
		}
	}

	formatex(g_szMagicWord, sizeof (g_szMagicWord) -1, "");

	return PLUGIN_CONTINUE;
}

public removeGodMode(id)
{
	set_user_godmode(id, 0);
	client_print_color(id, print_team_red, "^4[DR]^1 Nu mai esti ^3Invincibil!");  
}

public removeClip(id)
{
	set_user_noclip(id, 0);
	client_print_color(id, print_team_red, "^4[DR]^1 NoClip ^3OFF!");  
}

public event_CurWeapon(id)
{
	if(is_user_alive(id))
	{
		if(get_user_maxspeed(id) != 1.0 && viteza[id] == true)
		{
			set_user_maxspeed(id, float(VITEZA));
		}
	}

	return PLUGIN_CONTINUE;
}

public ShakeScreen(id, const Float:iSeconds)
{
	static g_msg_SS = 0;

	if(!g_msg_SS)
		g_msg_SS = get_user_msgid("ScreenShake");

	message_begin(MSG_ONE, g_msg_SS, _, id);
	write_short(floatround(4096.0 * iSeconds, floatround_round));
	write_short(floatround(4096.0 * iSeconds, floatround_round));
	write_short(1<<13);
	message_end();
}

stock bool:UserHasAcces(id)
{
	if(get_user_flags(id) & ADMIN_RCON)
		return true;

	return false; 
}[/code]
L1oN98
Membru, skill 0
Membru, skill 0
Posts: 93
Joined: 26 Nov 2018, 19:52
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

27 Jan 2019, 02:16

faKe91, din pacate nu am :(
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2952
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 39 times
Been thanked: 454 times
Contact:

27 Jan 2019, 15:35

| Afiseaza codul
[code]
#include < amxmodx >
#include < cstrike >
#include < fun >
#include < ColorChat >

#pragma tabsize 0

#define PLUGIN "DR"
#define VERSION "1.0"

#define      MagicWordTask      112233
#define      MagicWordSecondTask   332211
#define VITEZA      500

enum
{
PRIZE_SPEED,
PRIZE_NOCLIP,
PRIZE_GODMODE,
PRIZE_HP,
PRIZE_RENDERING,
PRIZE_ARMOR,
PRIZE_AK47,
PRIZE_NADES,
PRIZE_AWP
}

new const g_szSmallLetters[    ] =
{
'a','b','c','d',
'e','f','g','h',
'j','k',
'm','n','p',
'q','r','s','t',
'u','v','w','x',
'y','z'
};


new const g_szLargeLetters[    ] =
{
'A','B','C','D',
'E','F','G','H',
'I','J','K','L',
'M','N','P',
'Q','R','S','T',
'U','V','W','X',
'Y','Z'
};


new const g_szNumbers[    ]  =  
{
'1',
'2','3',
'4','5',
'6','7',
'8','9'
};

new const g_szSymbols[    ]  =  
{
'!','?'
};
new bar;
new gCvarMagicWordIterval;
new gCvarMagicWordAnswerTime;
new gCvarMagicWordHP;

new g_iAnswerTime = 0;
new g_szMagicWord[ 32 ];

new bool:g_bPlayersCanAnswer  =  false;
new bool:viteza[31];
new bool:invizibilitate[32];

new SyncHudMessage;

public plugin_init( )
{
register_plugin( PLUGIN, VERSION, "Askhanar" );

gCvarMagicWordIterval =  register_cvar( "fmu_mw_interval",  "180"  );
gCvarMagicWordAnswerTime = register_cvar( "fmu_mw_answertime",  "15"  );
gCvarMagicWordHP = register_cvar( "fmu_mw_hp",  "50"  );

register_clcmd( "amx_magicword", "ClCmdMagicWord" );

register_clcmd( "say", "CheckForMagicWord" );
register_clcmd( "say_team", "CheckForMagicWord" );
register_event("CurWeapon", "event_CurWeapon", "be", "1=1");
register_event("HLTV", "event_newround", "a", "1=0", "2=0");

bar = get_user_msgid("BarTime");   

SyncHudMessage  =  CreateHudSyncObj(    );
set_task(  15.0,  "ChooseRandomWord",  MagicWordTask  );

}

public event_newround()
{
arrayset(viteza, false, charsmax(viteza));

new i, players[32], num, id;
get_players(players, num);
for(i = 0; i < num; i++)
{
id = players;
if(!is_user_alive(id))
continue;

if(invizibilitate[id])
{
invizibilitate[id] = false;
set_user_rendering(id);
}
}
}

public client_death(killer, victim, wpnindex, hitplace, tk)
{
if(!is_user_alive(killer))
return;

if(killer == victim)
return;

if(viteza[killer]) viteza[killer] = false;
if(invizibilitate[killer])
{
invizibilitate[killer] = false;
set_user_rendering(killer);
}
}


public client_putinserver(id)
{
viteza[id] = false;
invizibilitate[id] = false;
}

public ClCmdMagicWord( id )
{
if( !UserHasAcces( id ) )
{
client_cmd( id, "echo Nu ai acces la aceasta comanda !" );
return PLUGIN_HANDLED;
}

read_argv( 1, g_szMagicWord, 14 );
if( equal( g_szMagicWord, "" ) )
{

remove_task( MagicWordTask );
remove_task( MagicWordSecondTask );
g_bPlayersCanAnswer = false;

ChooseRandomWord( );
}
else
{
remove_task( MagicWordTask );
remove_task( MagicWordSecondTask );
g_bPlayersCanAnswer = false;

DisplayMagicWord( );
}


return 1;
}

public CheckForMagicWord(  id  )
{
static szSaid[ 192 ];
read_args( szSaid, sizeof ( szSaid ) -1 );
remove_quotes( szSaid );

if( equali( szSaid, "" )  || !g_bPlayersCanAnswer || cs_get_user_team(id) == CS_TEAM_SPECTATOR )   return PLUGIN_CONTINUE;

if( equal( szSaid, g_szMagicWord ) )
{
if(cs_get_user_team( id ) == CS_TEAM_T)
{
ColorChat(id,RED,"^x04[DR]^x01 Doar^x03 CT^x01 beneficiaza de acest sistem!")
return PLUGIN_HANDLED
}
g_bPlayersCanAnswer  =  false;
client_cmd( 0, "spk woop" );
GiveUserPrize( id );
return PLUGIN_HANDLED
}

return PLUGIN_CONTINUE;
}


public ChooseRandomWord( )
{
if( !get_playersnum( ) )
{
set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
return;
}

new iLen = random_num( 7, 8 );
formatex( g_szMagicWord, sizeof ( g_szMagicWord ) -1, "" );

for( new i = 0; i < iLen; i++ )
g_szMagicWord[ i ] = GetRandomCharacter( );

StartMagicWord( );
client_cmd( 0, "spk doop" );

set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
}

public DisplayMagicWord( )
{
if( !get_playersnum( ) )
{
   set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
   return;
}

StartMagicWord( );
client_cmd( 0, "spk doop" );

set_task( float( get_pcvar_num( gCvarMagicWordIterval ) ), "ChooseRandomWord", MagicWordTask );
}

GetRandomCharacter( )
{
new Float:fRandom = random_float( 1.0, 100.0 );

if( fRandom <= 25.0 )
{
return g_szSmallLetters[ random( sizeof ( g_szSmallLetters ) ) ];
}

else if( fRandom > 25.0 && fRandom <= 50.0 )
{
return g_szLargeLetters[ random( sizeof ( g_szLargeLetters ) ) ];
}

else if( fRandom > 50.0 && fRandom < 75.0 )
{
return g_szNumbers[ random( sizeof ( g_szNumbers ) ) ];
}
else if( fRandom > 75.0 )
{
return g_szSymbols[ random( sizeof ( g_szSymbols ) ) ];
}

return EOS;
}

public StartMagicWord( )
{
g_bPlayersCanAnswer = true;

g_iAnswerTime = get_pcvar_num( gCvarMagicWordAnswerTime );
CountAnswerTime( );

}

public CountAnswerTime( )
{

if( g_bPlayersCanAnswer )
{

if( g_iAnswerTime <= 0 )
{
   g_bPlayersCanAnswer  =  false;
   for(new i=0;i<get_maxplayers();i++)	ColorChat( i, RED, "^x04[DR]^x01 Nu a scris nimeni cuvantul, poate data viitoare.." );
   return PLUGIN_HANDLED;
}

set_hudmessage( 0, 255, 255, -1.0, 0.10, 0, 0.0, 1.0, 0.0, 0.1, 2 );
ShowSyncHudMsg( 0, SyncHudMessage, "Cine scrie primul:     %s    castiga un premiu!^n %i secund%s ramas%s !!",
g_szMagicWord, g_iAnswerTime, g_iAnswerTime  ==  1 ? "a" : "e", g_iAnswerTime  ==  1 ? "a" : "e" );

g_iAnswerTime--;

set_task( 1.0, "CountAnswerTime", MagicWordSecondTask );
}

return PLUGIN_CONTINUE;
}

public GiveUserPrize( id )
{

new szName[ 55 ];
get_user_name( id, szName, sizeof ( szName ) -1 );

new iRandomPrize = random_num( PRIZE_SPEED, PRIZE_AWP);

switch( iRandomPrize )
{

case PRIZE_SPEED:
{
   viteza[id] = true;
   set_user_maxspeed(id, float(VITEZA));
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 400 Speed^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_NOCLIP:
{
   set_user_noclip(id,1);
   set_task(8.0,"removeClip",id);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 NOCLIP^x01 8 sec!", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
   
   message_begin(MSG_ONE_UNRELIABLE, bar, .player=id);
   write_short(8);
   message_end();
   
}   

case PRIZE_GODMODE:
{
   set_user_godmode(id,1);
   set_task(10.0,"removeGodMode",id);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si este^x03 Invincibil^x01 10 Secunde!", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
   
   message_begin(MSG_ONE_UNRELIABLE, bar, .player=id);
   write_short(10);
   message_end();
}

case PRIZE_HP:
{
   set_user_health( id, get_user_health( id ) + get_pcvar_num( gCvarMagicWordHP ) );
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 %i HP^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_RENDERING:
{
   invizibilitate[id] = true;
   set_user_rendering ( id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 32 );
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 Invizibilitate^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_ARMOR:
{
   set_user_armor(id, 100);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 100 Armura^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_AK47:
{
   cs_set_weapon_ammo( give_item( id, "weapon_ak47" ), 50 );
   cs_set_user_bpammo(id, CSW_AK47, 99);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 AK47^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}
case PRIZE_NADES:
{
   give_item( id, "weapon_hegrenade" );
   give_item( id, "weapon_smokegrenade" );
   
   cs_set_user_bpammo( id, CSW_HEGRENADE, 3 );
   cs_set_user_bpammo( id, CSW_SMOKEGRENADE, 1 );
   
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 grenade ^x01 !", szName, g_szMagicWord );
}
case PRIZE_AWP:
{
   cs_set_weapon_ammo( give_item( id, "weapon_awp" ), 20 );
   cs_set_user_bpammo(id, CSW_AWP, 99);
   ColorChat( 0, RED, "^x04[DR]^x03 %s^x01 a scris primul^x03 %s^x01 si a primit^x03 AWP ^x01 !", szName, g_szMagicWord, get_pcvar_num( gCvarMagicWordHP ) );
}


}

formatex( g_szMagicWord, sizeof ( g_szMagicWord ) -1, "" );
return 0;
}

public removeGodMode(id) {
set_user_godmode(id,0);
ColorChat( id, RED, "^x04[DR]^x01 Nu mai esti ^x03Invincibil!");  
}

public removeClip(id) {
set_user_noclip(id,0);
ColorChat( id, RED, "^x04[DR]^x01 NoClip ^x03OFF!");  
}

public event_CurWeapon(id)
{
if(is_user_alive(id))
{
if(get_user_maxspeed(id) != 1.0 && viteza[id] == true)
{
   set_user_maxspeed(id, float(VITEZA));
}
}

return PLUGIN_CONTINUE;
}

public ShakeScreen(id, const Float:iSeconds)
{
static g_msg_SS = 0;
if(!g_msg_SS)
g_msg_SS = get_user_msgid("ScreenShake");

message_begin(MSG_ONE, g_msg_SS, _, id);
write_short(floatround(4096.0 * iSeconds, floatround_round));
write_short(floatround(4096.0 * iSeconds, floatround_round));
write_short(1<<13);
message_end();
}

stock bool:UserHasAcces( id )
{

if( get_user_flags( id ) & ADMIN_RCON )
   return true;
   
   return false;
   
}[/code]


oricum problemele sunt din inc,ia altu mai bun
Last edited by L E V I N on 27 Jan 2019, 18:38, edited 1 time in total.
Faceți cerere bine detaliată aici și respectând modelul dacă vreți ajutor. Nu-mi mai dați add doar pentru a mă avea în lista de prieteni.
Am cont și activez doar aici! Aveți grijă la cei ce încearcă să mă copieze..Puteți lua legătura cu mine dacă aveți o problemă/nelămurire în acest caz!
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici, iar dacă sunt ceva probleme sau aveți dvs. probleme nu ezitați să luați legătura cu mine.
HOST CS1.6
L1oN98
Membru, skill 0
Membru, skill 0
Posts: 93
Joined: 26 Nov 2018, 19:52
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

27 Jan 2019, 16:07

Adryyy, dezvolta putin te rog
User avatar
Rainq
Fost moderator
Fost moderator
Posts: 2509
Joined: 21 Jul 2015, 18:50
Detinator Steam: Da
CS Status: Busy
Detinator server CS: ZM.THEXFORCE.RO
SteamID: mrainq
Reputatie: Fost super moderator
Fost detinator ZM.eXtreamCS.COM
Fost Membru Club eXtreamCS (trei luni)
Fond eXtream: 0
Location: Bucureşti
Has thanked: 16 times
Been thanked: 21 times
Contact:

28 Jan 2019, 13:35

L1oN98 wrote:Adryyy, dezvolta putin te rog
inc-urile se afla in scripting/include
Image
Leul şi tigru sunt mai puternici ca lupul,dar lupul la circ nu participă.
L1oN98
Membru, skill 0
Membru, skill 0
Posts: 93
Joined: 26 Nov 2018, 19:52
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

28 Jan 2019, 21:57

Stiu unde sunt inc-urile, doar ca inainte nu aveam problema cu pluginul asta, mergea perfect fara sa am eroare in "LOGS"

Dupa ce a fost modificat ultima data a aparut aceasta eroare:

modificari-pluginuri/problema-compilare-t361121.html
User avatar
EnTeR_
Membru, skill +1
Membru, skill +1
Posts: 475
Joined: 13 Sep 2014, 15:36
Detinator Steam: Da
Fond eXtream: 0
Been thanked: 4 times

28 Jan 2019, 22:48

Problema este de la colorchat.inc (cum s-a spus și mai sus). Folosește asta: https://forums.alliedmods.net/showthread.php?t=94960

P.S: Aceasta eroare nu apare mereu doar atunci când un jucător se deconectează în timp ce rulează o funcție din plugin, iar jucătorul respectiv nu este găsit. De asta nu o aveai și inainte.
Discord: EyeKon#3230
Post Reply

Return to “Probleme la servere dedicate de Counter-Strike”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 26 guests