Raised This Month: $ Target: $400
 0% 

Solved [AMXX] Run time error 10: native error (native "pev") Please Help Me! Thanks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Adi1997
Junior Member
Join Date: Apr 2022
Old 04-18-2022 , 12:50   [AMXX] Run time error 10: native error (native "pev") Please Help Me! Thanks
Reply With Quote #1

Can you help me with this problem?
Server CS deathrun
L 04/18/2022 - 14:40:10: [FAKEMETA] Invalid entity
L 04/18/2022 - 14:40:10: [AMXX] Run time error 10 (plugin "DR_Duel1.amxx") (native "pev") - debug not enabled!
L 04/18/2022 - 14:40:10: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).

Plugins :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Deathrun Duel"
#define VERSION "4.0"
#define AUTHOR "[Vicious Vixen]"
#define PREFIX "[DR.PlayCs.RO]"

#define is_valid_player(%1) (1 <= %1 <= 32)

#define GODTID 100500
#define TIMERTID 100501
#define TIMER2TID 100502
#define INFORMERTID 100503
#define WAITTIMERTID 100504
#define MCOUNT 9
#define SCOUNT 20
#define DCOUNT 13
#define DAMMO 1
#define KWPN "world"
#define KHS 1
#define MENUBODY 1024
#define MAXORIGINS 2
#define MAXWORDS 100

#define MAX_BUTTONS 100
#define KeysButtonsMenu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) // Keys: 137890
#define KeysOptionsMenu (1<<0)|(1<<1)|(1<<8) //129
#define KeysDelayMenu (1<<0)|(1<<1)|(1<<2)|(1<<8) //1239

#define ANNOUNCE_TASK 10000

#define m_flWait 44

//Main

new gEnt[MAX_BUTTONS];
new 
gUsed[MAX_BUTTONS];
new 
giPointer=0;
new 
gOnStart[MAX_BUTTONS];
new 
Float:gDefaultDelay[MAX_BUTTONS];
new 
Float:gDelay[MAX_BUTTONS];

new 
gInMenu[33];

new 
gszFile[128];

new 
giSprite;

new 
gcvarDefaultgcvarTeamgcvarFreeRun;
new 
gcvarLimitgcvarLimitModegcvarPrivilege;
new 
gcvarMessagegcvarRestore;

//VOTE

#define TASK_SHOWMENU 432
#define TASK_RES 123

#define MAX_ROUNDS 999

#define KeysFFVote (1<<0)|(1<<1) // Keys: 12

new gcvarFRVoteTime;

new 
giVoteStartgiVoteTime;

new 
bool:gbFreeRun=false;
new 
bool:gbVote=false;

#define VOTE_ON 0
#define VOTE_OFF 1

new giVotes[33][2];

new 
giRounds=MAX_ROUNDSgiTime=0;

new 
MaxPlayers
new ChoosedDuel
new DuelNum
new SayText
new BeaconSprite
new CounterID
new TerroristID
new MathAnswer
new RussianRouletteID
new RussianRouletteBullet
new Index
new Timer
new OriginsNum
new WordsNum

new g_MsgHud1
new g_MsgHud2
new g_MsgHud3

new PcvarDuels
new PcvarMusic
new PcvarTimer
new PcvarTimeLimit
new PcvarSpawnGod
new PcvarEffects
new PcvarInformer
new PcvarLastMenu
new PcvarWait
new PcvarMode
new PcvarTele

new MenuPosition[33]
new 
MenuTs[33]
new 
RussianRouletteName[64]
new 
MathTask[64]
new 
ConfigsDir[64]
new 
WordsFile[64]
new 
OriginsFile[128]
new 
WordAnswer[128]

new 
MenuBody[MENUBODY 1]

new 
bool:Last
new bool:Duel
new bool:FPage
new bool:TouchWeapons[33]
new 
bool:Once[33]
new 
bool:InDuel[33]
new 
bool:Knife[33]
new 
bool:Deagle[33]
new 
bool:M4a1[33]
new 
bool:Ak47[33]
new 
bool:Mp5navy[33]
new 
bool:Grenade[33]
new 
bool:Scout[33]
new 
bool:Drob[33]
new 
bool:Awp[33]
new 
bool:Math[33]
new 
bool:Word[33]
new 
bool:RussianRoulette[33]
new 
bool:Used[33]
new 
bool:Boom[33]
new 
bool:NotYou[33]
new 
bool:DoIt[33]
new 
bool:Start[33]
new 
bool:Famas[33]

new 
Origins[MAXORIGINS][128]
new 
Words[MAXWORDS][192]

new 
Music[MCOUNT][] = 
{
"media/Half-Life01.mp3",
"media/Half-Life02.mp3",
"media/Half-Life03.mp3",
"media/Half-Life08.mp3",
"media/Half-Life11.mp3",
"media/Half-Life12.mp3",
"media/Half-Life13.mp3",
"media/Half-Life16.mp3",
"media/Half-Life17.mp3"
}

new 
Sound[SCOUNT][] =
{
"fvox/one",
"fvox/two",
"fvox/three",
"fvox/four",
"fvox/five",
"fvox/six",
"fvox/seven",
"fvox/eight",
"fvox/nine",
"fvox/ten",
"fvox/eleven",
"fvox/twelve",
"fvox/thirteen",
"fvox/fourteen",
"fvox/fifteen",
"fvox/sixteen",
"fvox/seventeen",
"fvox/eighteen",
"fvox/nineteen",
"fvox/twenty"
}

new 
Duels[DCOUNT][] =
{
"DUEL_1",
"DUEL_2",
"DUEL_3",
"DUEL_4",
"DUEL_5",
"DUEL_6",
"DUEL_7",
"DUEL_8",
"DUEL_9",
"DUEL_10",
"DUEL_11",
"DUEL_12",
"DUEL_13"
}
public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("HLTV""RoundStart""a""1=0""2=0")
    
register_logevent("RoundEnd"2"1=Round_End")
    
RegisterHam(Ham_Touch"weaponbox""TouchWeapon")
    
RegisterHam(Ham_Touch"armoury_entity""TouchWeapon")
    
RegisterHam(Ham_Touch"weapon_shield""TouchWeapon")
    
RegisterHam(Ham_Spawn"player""PlayerSpawn"1)
    
RegisterHam(Ham_Killed"player""PlayerKilled")
    
register_forward(FM_CmdStart,"CmdStart",1)
    
register_forward(FM_UpdateClientData"UpdateClientData"1)
    
register_clcmd("say /duel""CmdDuelsMenu")
    
register_clcmd("say /dd""CmdDuelsMenu")
    
register_clcmd("say_team /duel""CmdDuelsMenu")
    
register_clcmd("say_team /dd""CmdDuelsMenu")
    
register_clcmd("deathrun_duels""CmdDuelsMenu")
    
register_clcmd("say""hooksay")
    
register_clcmd("say_team""hooksay_team")
    
register_concmd("dd_origin_menu""CmdOriginsMenu"ADMIN_RCON)
    
PcvarDuels register_cvar("dd_duels""abcdefghijklm")
    
PcvarMusic register_cvar("dd_music""0")
    
PcvarTimer register_cvar("dd_timer""0")
    
PcvarTimeLimit register_cvar("dd_timelimit""60")
    
PcvarSpawnGod register_cvar("dd_spawngod""1")
    
PcvarEffects register_cvar("dd_effects""3")
    
PcvarWait register_cvar("dd_wait""5")
    
PcvarInformer register_cvar("dd_informer""1")
    
PcvarLastMenu register_cvar("dd_lastmenu""1")
    
PcvarTele register_cvar("dd_teleport""1")
    
PcvarMode register_cvar("deathrun_mode""BUTTONS"FCVAR_SERVER)
    
register_cvar("Deathrun Duels""v2.5 by [I.G.]"FCVAR_SERVER|FCVAR_SPONLY)
    
register_menucmd(register_menuid("Duels Menu"), MENUBODY 1"ActionDuelsMenu")
    
register_menucmd(register_menuid("Enemy Menu"), MENUBODY 1"ActionEnemyMenu")
    
register_menucmd(register_menuid("Roulette Menu"), MENUBODY 1"ActionRussianRouletteMenu")
    
register_menucmd(register_menuid("Last Menu"), MENUBODY 1"ActionLastMenu")
    
register_menucmd(register_menuid("Origins Menu"), MENUBODY 1"ActionOriginsMenu")
    
SayText get_user_msgid("SayText")
    
MaxPlayers get_maxplayers()
    
g_MsgHud1 CreateHudSyncObj()
    
g_MsgHud2 CreateHudSyncObj()
    
g_MsgHud3 CreateHudSyncObj()
    
register_dictionary("deathrun_duel.txt")
    
set_task(1.0"Informer"INFORMERTID""0"b")
    
register_dictionary("common.txt");
    
register_dictionary("adminvote.txt");

    
register_menucmd(register_menuid("FRVote"), KeysFFVote"PressedFRVote");
    
register_menucmd(register_menuid("ButtonsMenu"), KeysButtonsMenu"PressedButtonsMenu");
    
register_menucmd(register_menuid("OptionsMenu"), KeysOptionsMenu"PressedOptionsMenu");
    
register_menucmd(register_menuid("DelayMenu"), KeysDelayMenu"PressedDelayMenu");

    
register_clcmd("amx_buttons","cmd_amx_buttons",ADMIN_CFG,": Buttons Menu");

    
//Default count of uses
    
gcvarDefault=register_cvar("amx_buttons_default","1");
    
//Who plugin analyze
    //0 - anyone(plugin disabled?)
    //1 - Te
    //2 - Ct
    //3 - Te+Ct
    
gcvarTeam=register_cvar("amx_buttons_team","1");
    
//Enabled FreeRun mode?
    
gcvarFreeRun=register_cvar("amx_buttons_freerun","1");
    
//Vote time
    
gcvarFRVoteTime=register_cvar("amx_freerun_votetime","10");

    
//Type of limit
    //0 - enabled after 'amx_freerun_limit' rounds
    //1 - enabled after 'amx_freerun_limit' minutes
    
gcvarLimitMode=register_cvar("amx_freerun_limit_mode","0");
    
//Size of Limit
    
gcvarLimit=register_cvar("amx_freerun_limit","5");

    
//Interval of message
    
gcvarMessage=register_cvar("amx_freerun_info","120.0",0,120.0);

    
//Terrorist`s privilege
    //if he use /free FreeRun will start without vote, can he?
    
gcvarPrivilege=register_cvar("amx_freerun_tt_privilege","1");

    
//restore buttons on new round
    
gcvarRestore=register_cvar("amx_restore_buttons","1");

    
register_clcmd("say /free","cmdVoteFreeRun");
    
register_clcmd("say_team /free","cmdVoteFreeRun");
    
register_clcmd("say free","cmdVoteFreeRun");
    
register_clcmd("say_team free","cmdVoteFreeRun");

    
register_clcmd("say /freerun","cmdVoteFreeRun");
    
register_clcmd("say_team /freerun","cmdVoteFreeRun");
    
register_clcmd("say freerun","cmdVoteFreeRun");
    
register_clcmd("say_team freerun","cmdVoteFreeRun");

    
register_clcmd("say /fr","cmdVoteFreeRun");
    
register_clcmd("say_team /fr","cmdVoteFreeRun");
    
register_clcmd("say fr","cmdVoteFreeRun");
    
register_clcmd("say_team fr","cmdVoteFreeRun");

    if( 
engfunc(EngFunc_FindEntityByString,-,"classname""func_button"))
    
RegisterHam(Ham_Use"func_button""fwButtonUsed");

    if(
engfunc(EngFunc_FindEntityByString,-,"classname","func_rot_button"))
    
RegisterHam(Ham_Use"func_rot_button""fwButtonUsed");

    if(
engfunc(EngFunc_FindEntityByString,-,"classname""button_target"))
    
RegisterHam(Ham_Use"button_target""fwButtonUsed");

    
register_logevent"ResetButtons"2"0=World triggered""1=Round_Start");

    
fillButtons("func_button");
    
fillButtons("func_rot_button");
    
fillButtons("button_target");
    return 
PLUGIN_CONTINUE
}
public 
plugin_cfg(){
setButtons();

new 
iLen=0iMax=charsmax(gszFile);
iLen=get_configsdir(gszFileiMax );
iLen+=copy(gszFile[iLen], iMax-iLen"/dr_buttons/");

if(!
dir_exists(gszFile)){
set_fail_state("Not found dir: configs/dr_buttons");
return;
}
new 
szMap[32];
get_mapname(szMap31);
formatex(gszFile[iLen], charsmax(gszFile)-iLen"%s.ini"szMap);
if(!
file_exists(gszFile)){
return;
}
new 
szLine[51];
new 
szButton[4], szTimes[3], szDelay[5];
new 
Float:fDelay;
for(new 
i=0;read_file(gszFileiszLine50iLen);i++){
if(
iLen==0) continue;
trim(szLine);
if(
szLine[0]==';') continue;
parse(szLineszButton3szTimes2szDelay4);
fDelay=szDelay[0]?str_to_float(szDelay):-1.0;
set_start_value(str_to_num(szButton), str_to_num(szTimes), fDelay);
}
new 
Float:fInterval=get_pcvar_float(gcvarMessage);
if(
fInterval 0.0)
set_task(120.0"announceVote",ANNOUNCE_TASK,_,_,"b");
}
public 
plugin_precache() 
{    
giSprite=precache_model("sprites/flare1.spr");
BeaconSprite precache_model("sprites/shockwave.spr")
get_configsdir(ConfigsDircharsmax(ConfigsDir))
format(WordsFilecharsmax(WordsFile), "%s/deathrun_duels.ini"ConfigsDir)
new 
cmap[32], Lendddir[128]
format(dddir127"%s/deathrun_duels"ConfigsDir)
if(!
dir_exists(dddir))
{
mkdir(dddir)
}
get_mapname(cmap31)
format(OriginsFilecharsmax(OriginsFile), "%s/deathrun_duels/%s.ini"ConfigsDircmap)
new 
0
if(file_exists(WordsFile))
{
while(
MAXWORDS && read_file(WordsFileWords[WordsNum], 191Len))
{
i++
if(
Words[WordsNum][0] == ';' || Len == 0)
{
continue
}
WordsNum++
}
}
0
if(file_exists(OriginsFile))
{
while(
MAXORIGINS && read_file(OriginsFile,Origins[OriginsNum], 127Len))
{
i++
if(
Origins[OriginsNum][0] == ';' || Len == 0)
{
continue
}
OriginsNum++
}
}
return 
PLUGIN_CONTINUE
}
public 
RoundStart()
{
Duel false
Last 
false
if(get_pcvar_num(PcvarTimer))
{
remove_task(TIMERTID)
}
remove_task(TIMER2TID)
remove_task(WAITTIMERTID)
set_pcvar_string(PcvarMode"BUTTONS")
return 
PLUGIN_CONTINUE
}
public 
RoundEnd()
{
if(
get_pcvar_num(PcvarMusic))
{
client_cmd(0"cd fadeout")
}
if(
get_pcvar_num(PcvarTimer))
{
remove_task(TIMERTID)
}
remove_task(TIMER2TID)
remove_task(WAITTIMERTID)
return 
PLUGIN_CONTINUE
}

public 
PlayerSpawn(id)
{
if(!
is_user_alive(id) || !cs_get_user_team(id) || is_user_bot(id))
{
return 
PLUGIN_CONTINUE
}
if(
get_pcvar_num(PcvarSpawnGod))
{
set_pev(idpev_takedamage0)
set_task(3.0"GodOff"id GODTID)
}
set_user_rendering(id)
remove_task(id)
TouchWeapons[id] = false
Once
[id] = false
Knife
[id] = false
Deagle
[id] = false
M4a1
[id] = false
Ak47
[id] = false
Mp5navy
[id] = false
Grenade
[id] = false
Scout
[id] = false
Drob
[id] = false
Awp
[id] = false
Math
[id] = false
Word
[id] = false
RussianRoulette
[id] = false
Used
[id] = false
NotYou
[id] = false
DoIt
[id] = false
Start
[id] = false
InDuel
[id] = false
Famas
[id] = false

return PLUGIN_CONTINUE
}    
public 
TouchWeapon(weaponid)
{
if(!
is_user_connected(id))
{
return 
HAM_IGNORED
}
if(
TouchWeapons[id] || cs_get_user_team(id) == CS_TEAM_SPECTATOR)
{
return 
HAM_SUPERCEDE
}
return 
HAM_IGNORED
}
public 
CmdStart(playeruc_handlerandom_seed)
{
if(!
is_user_alive(player) || player || player 32)
{
return 
FMRES_IGNORED
}
new 
Buttons get_uc(uc_handleUC_Buttons)
if(
Buttons IN_ATTACK && Used[player])
{
if(
Famas[player] && get_user_weapon(player__) == CSW_FAMAS)
{
new 
wEnt fm_find_ent_by_owner(-1"weapon_famas"player);
cs_set_weapon_burst(wEnt1)
}
if(!
NotYou[player])
{
if(
player == RussianRouletteID && DoIt[player])
{    
new 
id player
get_user_name
(idRussianRouletteName63)
set_hudmessage(2552550, -1.00.301.02.00.50.52)
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"RRDOING"RussianRouletteName)
set_task(3.0"RussianRouletteStop"id)
DoIt[id] = false
Start
[id] = true
}
else if(
player == RussianRouletteID && Start[player])
{
client_print(playerprint_center"%L"LANG_PLAYER"RRWAIT")
}
else
{
client_print(playerprint_center"%L"LANG_PLAYER"RRNOTYOU")
}
}
else if(
Boom[player])
{
get_user_name(playerRussianRouletteName63)
set_hudmessage(25500, -1.00.211.05.01.01.04)
ShowSyncHudMsg(0g_MsgHud3"%L"LANG_PLAYER"RRBOOM"RussianRouletteName)
client_cmd(0"spk weapons/deagle-1")
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_ONCE)
DeathMsg(playerplayerKHSKWPN)
Kill(player)
Used[CounterID] = false
Used
[TerroristID] = false
}
else if(!
Boom[player])
{
if(
player == CounterID)
{
get_user_name(TerroristIDRussianRouletteName63)
RussianRouletteMenu(TerroristID)
NotYou[player] = false
DoIt
[TerroristID] = true
RussianRouletteID 
TerroristID
}
else if(
player == TerroristID)
{
get_user_name(CounterIDRussianRouletteName63)
RussianRouletteMenu(CounterID)
NotYou[player] = false
DoIt
[CounterID] = true
RussianRouletteID 
CounterID
}
set_hudmessage(02550, -1.00.201.03.00.50.54)
ShowSyncHudMsg(0g_MsgHud3"%L"LANG_PLAYER"RRNOTBOOM"RussianRouletteName)
client_cmd(0"spk weapons/dryfire_pistol")
}
Buttons &= ~IN_ATTACK
set_uc
(uc_handleUC_ButtonsButtons)
}
if(
Deagle[player])
{
cs_set_user_bpammo(playerCSW_DEAGLE1)
}
if(
M4a1[player])
{
cs_set_user_bpammo(playerCSW_M4A13)
}
if(
Ak47[player])
{
cs_set_user_bpammo(playerCSW_AK473)
}
if(
Mp5navy[player])
{
cs_set_user_bpammo(playerCSW_MP5NAVY3)
}
if(
Scout[player])
{
cs_set_user_bpammo(playerCSW_SCOUT1)
}
if(
Drob[player])
{
cs_set_user_bpammo(playerCSW_M31)
}
if(
Awp[player])
{
cs_set_user_bpammo(playerCSW_AWP1)
}
if(
Famas[player] && get_user_weapon(player__) == CSW_FAMAS)
{
new 
wEnt fm_find_ent_by_owner(-1"weapon_famas"player)
if(
wEnt)
{
cs_set_weapon_burst(wEnt1)
cs_set_user_bpammo(playerCSW_FAMAS3)
}
}
return 
FMRES_HANDLED
}
public 
UpdateClientData(idsendweaponscd_handle)
{
if(!
is_user_alive(id))
{
return 
FMRES_IGNORED
}
if(
Used[id] && InDuel[id])
{
set_cd(cd_handleCD_ID0)
}
return 
FMRES_HANDLED
}
public 
PlayerKilled(victimattackershouldgib)
{
if(
victim <= || attacker <= || victim >= 33 || attacker >= 33)
{
return 
PLUGIN_HANDLED
}
if(
Duel)
{
if(
cs_get_user_team(victim) == CS_TEAM_CT && InDuel[victim])
{
if(
RussianRoulette[victim] || Math[victim] || Word[victim])
{
if(
victim == CounterID)
{
attacker TerroristID
}
else if(
victim == TerroristID)
{
attacker CounterID
}
TouchWeapons[attacker] = false
Once
[attacker] = false
Knife
[attacker] = false
Deagle
[attacker] = false
M4a1
[attacker] = false
Ak47
[attacker] = false
Mp5navy
[attacker] = false
Grenade
[attacker] = false
Scout
[attacker] = false
Drob
[attacker] = false
Awp
[attacker] = false
Math
[attacker] = false
Word
[attacker] = false
RussianRoulette
[attacker] = false
Used
[attacker] = false
NotYou
[attacker] = false
DoIt
[attacker] = false
Start
[attacker] = false
InDuel
[attacker] = false
Famas
[attacker] = false
Duel 
false
}
}
}
remove_task(attacker)
remove_task(victim)
return 
PLUGIN_CONTINUE
}
public 
CmdDuelsMenu(id)
{
if(!
is_user_alive(id))
{
return 
PLUGIN_HANDLED
}
if (!
Once[id])
{
if(
cs_get_user_team(id) == CS_TEAM_CT)
{
new 
CTsNum GetCTsNum(1)
new 
TsNum GetTsNum(1)
if(
CTsNum == && TsNum >= 1)
{
DuelsMenu(idMenuPosition[id] = 0)
}
else if(
TsNum 1)
{
ColorChat(id"^4%s %L^3"PREFIXLANG_PLAYER,"NOT_TS")
}
else if(
CTsNum 1)
{
ColorChat(id"^4%s %L^3"PREFIXLANG_PLAYER,"ONLY_LAST")
}
}
else
{
ColorChat(id"^4%s %L^3"PREFIXLANG_PLAYER"ONLY_CTS")
}
}
return 
PLUGIN_HANDLED
}

public 
DuelsMenu(idposition)
{
if(
position 0)
{
return
}
FPage false
new DuelsNum GetFlagsNum(PcvarDuels)
new 
Flags GetFlags(PcvarDuels)
new 
MenuStart position 8
if(MenuStart >= DuelsNum)
{
MenuStart position MenuPosition[id]
}
new 
MenuEnd position 8
if(MenuEnd >= DuelsNum && position != 0)
{
MenuEnd DuelsNum
}
else if(
MenuEnd >= DuelsNum && position == 0)
{
MenuEnd DCOUNT
FPage 
true
}
new 
Keys MENU_KEY_0
new Len
new b
Len 
format(MenuBodyMENUBODY 1"%L^n^n"LANG_PLAYER"CHOOSE_DUEL")
for(new 
MenuStartMenuEnda++)
{
if(
Flags & (<< a))
{
Keys |= (<< b)
Len += format(MenuBody[Len], MENUBODY Len"%d. %L^n", ++bLANG_PLAYERDuels[a])
}
else
{
continue
}
}
if(
MenuEnd != DuelsNum && !FPage)
{
Keys |= MENU_KEY_9
Len 
+= format(MenuBody[Len], MENUBODY Len"^n9. %L^n0. %L^n^n %s"LANG_PLAYER"DD_MENU_MORE"LANG_PLAYERposition "DD_MENU_BACK" "DD_MENU_EXIT"PLUGINVERSIONAUTHOR)
}
else
{
Len += format(MenuBody[Len], MENUBODY Len"^n0. %L^n^n %s"LANG_PLAYERposition "DD_MENU_BACK" "DD_MENU_EXIT"PLUGINVERSIONAUTHOR)
}
show_menu(idKeysMenuBody, -1"Duels Menu")
}
public 
ActionDuelsMenu(idkey)
{
switch(
key)
{
case 
8:
{
DuelsMenu(id, ++MenuPosition[id])
}
case 
9:
{
DuelsMenu(id, --MenuPosition[id])
}
default:
{
if(
GetTsNum(1) || GetCTsNum(1) == 1|| is_user_alive(id))
{
ChoosedDuel MenuPosition[id] * key
EnemyMenu
(idMenuPosition[id] = 0)
}
}
}    
}
public 
EnemyMenu(idposition)
{
if(
position 0)
{
return
}
new 
TsNum 0
for(new aid 1aid <= MaxPlayersaid++)
{
if(
is_user_connected(aid) && is_user_alive(aid) && cs_get_user_team(aid) == CS_TEAM_T && !is_user_bot(aid))
{
MenuTs[TsNum++] = aid
}
}
new 
MenuStart position 8
if(MenuStart >= TsNum)
{
MenuStart position MenuPosition[id]
}
new 
MenuEnd position 8
if(MenuEnd TsNum)
{
MenuEnd TsNum
}
new 
Keys MENU_KEY_0
new Len
new 0
new Names[32]
Len format(MenuBodyMENUBODY 1"%L^n^n"LANG_PLAYER"CHOOSE_ENEMY")
for(new 
MenuStartMenuEnda++)
{
get_user_name(MenuTs[a], Names31)
Keys |= (<< b)
Len += format(MenuBody[Len], MENUBODY Len"%d. %s^n", ++bNames)
}
if(
MenuEnd != TsNum)
{
Keys |= MENU_KEY_9
Len 
+= format(MenuBody[Len], MENUBODY Len"^n9. %L^n0. %L^n^n %s"LANG_PLAYER"DD_MENU_MORE"LANG_PLAYERposition "DD_MENU_BACK" "DD_MENU_EXIT"PLUGINVERSIONAUTHOR)
}
else
{
Len += format(MenuBody[Len], MENUBODY Len"^n0. %L^n^n %s"LANG_PLAYERposition "DD_MENU_BACK" "DD_MENU_EXIT"PLUGINVERSIONAUTHOR)
}
show_menu(idKeysMenuBody, -1"Enemy Menu")
}
public 
ActionEnemyMenu(idkey)
{
switch(
key)
{
case 
8:
{
EnemyMenu(id, ++MenuPosition[id])
}
case 
9:
{
EnemyMenu(id, --MenuPosition[id])
}
default:
{
if(
GetTsNum(1) || GetCTsNum(1) == || is_user_alive(id))
{
new 
Choosed MenuPosition[id] * key
new Enemy MenuTs[Choosed]
StartDuel(idEnemy)
}
}
}    
}

public 
CmdOriginsMenu(idlevelcid)
{
if(!
cmd_access(idlevelcid1))
{
return 
PLUGIN_HANDLED
}
else
{
ShowOriginsMenu(id)
}
return 
PLUGIN_CONTINUE
}

public 
ShowOriginsMenu(id)
{
new 
Keys MENU_KEY_0
new Len
Len 
format(MenuBodyMENUBODY"%L^n^n"id"ORIGINS_TITLE")
Keys |= (<< 0)
Len += format(MenuBody[Len], MENUBODY Len"1. %L^n"id"SAVE_POSITION")
Keys |= (<< 1)
Len += format(MenuBody[Len], MENUBODY Len"2. %L^n"id"DELETE_POSITIONS")
Len += format(MenuBody[Len], MENUBODY Len"^n0. %L^n^n %s"id"DD_MENU_EXIT"PLUGINVERSIONAUTHOR)
show_menu(idKeysMenuBody, -1"Origins Menu")
return 
PLUGIN_CONTINUE
}

public 
ActionOriginsMenu(idkey)
{
switch(
key)
{
case 
0:
{
new  
vec[3]
get_user_origin(idvec)
add_spawn(vec)
client_print(idprint_center"*** Saved ***")
ShowOriginsMenu(id)
}
case 
1:
{
if(
file_exists(OriginsFile))
{
delete_file(OriginsFile)
client_print(idprint_center"*** Deleted ***")
ShowOriginsMenu(id)
}
}
}
return 
PLUGIN_CONTINUE
}

public 
add_spawn(vecs[3])
{
new 
Line[128]
format(Line127"%d %d %d",vecs[0], vecs[1], vecs[2])
write_file(OriginsFileLine)
return 
PLUGIN_CONTINUE
}

public 
SetOrigins(ctidterid)
{
if(!
file_exists(OriginsFile) || !get_pcvar_num(PcvarTele))
{
return 
PLUGIN_CONTINUE
}
new 
pos[4][8]
parse(Origins[0], pos[1], 7pos[2], 7pos[3], 7)
new 
Vec[3]
Vec[0] = str_to_num(pos[1])
Vec[1] = str_to_num(pos[2])
Vec[2] = str_to_num(pos[3])
set_user_origin(ctidVec)
parse(Origins[1], pos[1], 7pos[2], 7pos[3], 7)
Vec[0] = str_to_num(pos[1])
Vec[1] = str_to_num(pos[2])
Vec[2] = str_to_num(pos[3])
set_user_origin(teridVec)
return 
PLUGIN_CONTINUE
}
public 
StartDuel(idtempid)
{
if(!
GetTsNum(1) || GetCTsNum(1) > 1|| !is_user_alive(tempid) || !is_user_alive(id) || cs_get_user_team(tempid) != CS_TEAM_T || cs_get_user_team(id) != CS_TEAM_CT || !is_user_connected(tempid) || !is_user_connected(id) || is_user_bot(id) || is_user_bot(tempid))
{
return 
PLUGIN_HANDLED
}
new 
challenger[32], challenged[32]
get_user_name(idchallenger31)
get_user_name(tempidchallenged31)
strip_user_weapons(id)
strip_user_weapons(tempid)
set_user_health(id175)
set_user_health(tempid175)
switch(
get_pcvar_num(PcvarEffects))
{
case 
1:
{
set_user_rendering(idkRenderFxGlowShell00150kRenderNormal20)    
set_user_rendering(tempidkRenderFxGlowShell15000kRenderNormal20)
}
case 
2:
{
set_task(1.0"Beacon"id)
set_task(1.0"Beacon"tempid)
}
case 
3:
{
set_user_rendering(idkRenderFxGlowShell00150kRenderNormal20)    
set_task(1.0"Beacon"id)
set_user_rendering(tempidkRenderFxGlowShell15000kRenderNormal20)
set_task(1.0"Beacon"tempid)
}
}
InDuel[tempid] = true
InDuel
[id] = true
Once
[id] = true 
TouchWeapons
[id] = true
TouchWeapons
[tempid] = true
CounterID 
id
TerroristID 
tempid
Timer 
get_pcvar_num(PcvarWait)
Index get_pcvar_num(PcvarTimeLimit) + 1
set_pcvar_string
(PcvarMode"DUEL")
new 
Flags GetFlags(PcvarDuels)
DuelNum 0
new DuelIndex
while(DuelIndex <= ChoosedDuel)
{
if(
Flags & (<< DuelNum))
{
DuelIndex++
}
DuelNum ++
}
SetOrigins(idtempid)
switch(
DuelNum)
{
case 
1:
{
Knife[id] = true
Knife
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;    
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"KNIFE1",  challengerchallenged)     
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_HANDLED
}
case 
2:
{
Deagle[id] = true
Deagle
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"DEAGLE1"challengerchallenged
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"DEAGLE2")
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_HANDLED 
}
case 
3:
{
M4a1[id] = true
M4a1
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"M4A11"challengerchallenged
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"M4A12")
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_HANDLED 
}
case 
4:
{
Ak47[id] = true
Ak47
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"AK471"challengerchallenged
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"AK472")
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_HANDLED 
}
case 
5:
{
Mp5navy[id] = true
Mp5navy
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"MP5NAVY1"challengerchallenged
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"MP5NAVY2")
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_HANDLED 
}
case 
6:
{
Grenade[id] = true
Grenade
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"GRENADE1"challengerchallenged
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"GRENADE2"
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_HANDLED
}
case 
7:
{
Scout[id] = true
Scout
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"SCOUT1"challengerchallenged
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"SCOUT2"
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_HANDLED
}
case 
8:
{
Drob[id] = true
Drob
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"DROB1"challengerchallenged
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"DROB2"
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_HANDLED
}
case 
9:
{
Awp[id] = true
Awp
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"AWP1"challengerchallenged
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER,"AWP2"
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_HANDLED
}
case 
10:
{
Famas[id] = true
Famas
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER"FAMAS1"challengerchallenged)
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER"FAMAS2")
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_HANDLED
}
case 
11:
{
RussianRoulette[id] = true
RussianRoulette
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
RussianRouletteBullet random_num(13)
cs_set_weapon_ammo(give_item(id"weapon_deagle"), RussianRouletteBullet)
cs_set_weapon_ammo(give_item(tempid"weapon_deagle"), RussianRouletteBullet)
StartRussianRoulette(idtempid)
if(
get_pcvar_num(PcvarMusic))
{
new 
musicnum random_num(0MCOUNT-1)
client_cmd(0"mp3volume 0.9")
client_cmd(0"mp3 play %s"Music[musicnum])
}
return 
PLUGIN_HANDLED
}
case 
12:
{
Math[id] = true
Math
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
StartMathDuel(idtempid)
return 
PLUGIN_HANDLED
}
case 
13:
{
Word[id] = true
Word
[tempid] = true
Duel 
true
set_user_armor id
0;    
set_user_armor tempid0;
StartWordDuel(idtempid)
return 
PLUGIN_HANDLED
}
}
if(
get_pcvar_num(PcvarMusic))
{
new 
musicnum random_num(0MCOUNT-1)
client_cmd(0"mp3volume 0.9")
client_cmd(0"mp3 play %s"Music[musicnum])
}
if(
get_pcvar_num(PcvarTimer))
{
set_task(0.0"DuelTimer"TIMERTID)
}
Duel true
return PLUGIN_HANDLED
}
public 
DuelTimer()
{
Index--
if(
Index 60)
{
set_hudmessage(255255255, -1.00.2501.01.0__2)
if(
Math[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER2"IndexMathTask)
}
else if(
Word[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER2"IndexWordAnswer)
}
else 
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER"Index)
}
set_task(1.0"DuelTimer"TIMERTID)
}
else if(
60 >= Index >= 46)
{
set_hudmessage(02550, -1.00.2501.01.0__2)
if(
Math[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER2"IndexMathTask)
}
else if(
Word[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER2"IndexWordAnswer)
}
else 
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER"Index)
}
set_task(1.0"DuelTimer"TIMERTID)
}
else if(
45 >= Index >= 31)
{
set_hudmessage(2552550, -1.00.2501.01.0__2)
if(
Math[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER2"IndexMathTask)
}
else if(
Word[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER2"IndexWordAnswer)
}
else 
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER"Index)
}
set_task(1.0"DuelTimer"TIMERTID)
}
else if(
30 >= Index >= 16)
{
set_hudmessage(25500, -1.00.2501.01.0__2)
if(
Math[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER2"IndexMathTask)
}
else if(
Word[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER2"IndexWordAnswer)
}
else 
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER"Index)
}
set_task(1.0"DuelTimer"TIMERTID)
}
else if(
Index <= 15)
{
set_hudmessage(25500, -1.00.2511.01.0__2)
if(
Index 0)
{
if(
Math[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER2"IndexMathTask)
}
else if(
Word[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER2"IndexWordAnswer)
}
else 
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUEL_TIMER"Index)
}
}
else if(
Index 0)
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"NO_WINNER")
Kill(CounterID)
Kill(TerroristID)
remove_task(TIMERTID)
if(
get_pcvar_num(PcvarMusic))
{
client_cmd(0"cd fadeout")
}
}
set_task(1.0"DuelTimer"TIMERTID)
}
if(!
is_user_alive(CounterID) || !is_user_alive(TerroristID))
{
remove_task(TIMERTID)
if(
get_pcvar_num(PcvarMusic))
{
client_cmd(0"cd fadeout")
}
}
return 
PLUGIN_CONTINUE
}

public 
DuelTimer2()
{
set_hudmessage(255255255, -1.00.2501.01.0__2)
if(
Math[CounterID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUELTASK"MathTask)
}
if(
Word[TerroristID])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"DUELTASK"WordAnswer)
}
set_task(1.0"DuelTimer2"TIMER2TID)
if(!
is_user_alive(CounterID) || !is_user_alive(TerroristID))
{
remove_task(TIMER2TID)
if(
get_pcvar_num(PcvarMusic))
{
client_cmd(0"cd fadeout")
}
}
}
public 
StartMathDuel(ctter)
{
new 
num1,num2,num3,num4,modectname[64], tername[64]
mode random_num(06)
num1 random_num(1100)
num2 random_num(110)
num3 random_num(1100)
num4 random_num(110)
get_user_name(ctctname63)
get_user_name(tertername63)
switch(
mode)
{
case 
0:
{
format(MathTask63"%d + %d + %d + %d = ?"num1num2num3num4)
MathAnswer num1 num2 num3 num4
}
case 
1:
{
format(MathTask63"%d + %d + %d - %d = ?"num1,num2,num3,num4)
MathAnswer num1 num2 num3 num4
}
case 
2:
{
format(MathTask63"%d + %d - %d + %d = ?"num1num2num3num4)
MathAnswer num1 num2 num3 num4
}
case 
3:
{
format(MathTask63"%d - %d + %d + %d = ?"num1num2num3num4)
MathAnswer num1 num2 num3 num4
}
case 
4:
{
format(MathTask63"%d + %d - %d - %d = ?"num1num2num3num4)
MathAnswer num1 num2 num3 num4
}
case 
5:
{
format(MathTask63"%d - %d + %d - %d = ?"num1num2num3num4)
MathAnswer num1 num2 num3 num4
}
case 
6:
{
format(MathTask63"%d - %d - %d + %d = ?"num1num2num3num4)
MathAnswer num1 num2 num3 num4
}
}
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER"MATH1"ctnametername)
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER"MATH2")
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_CONTINUE
}
public 
StartWordDuel(ctter)
{
new 
ctname[64], tername[64]
format(WordAnswercharsmax(WordAnswer), "%s"Words[random_num(0WordsNum)])
get_user_name(ctctname63)
get_user_name(tertername63)
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER"WORD1"ctnametername)
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER"WORD2")
set_task(0.0"StartWait"WAITTIMERTID)
return 
PLUGIN_CONTINUE
}
public 
StartWait()
{
set_hudmessage(255255255, -1.00.2501.01.0__2)
switch(
DuelNum)
{
case 
1:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"KNIFE_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
2:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"DEAGLE_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
3:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"M4A1_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
4:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"AK47_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
5:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"MP5NAVY_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
6:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"GRENADE_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
7:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"SCOUT_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
8:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"DROB_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
9:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"AWP_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
10:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"FAMAS_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
11:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"MATH_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
case 
12:
{
ShowSyncHudMsg(0g_MsgHud2"%L^n%L"LANG_PLAYER"WORD_WAIT"LANG_PLAYER"STARTAFTER"Timer)
}
}
Timer--
client_cmd(0"spk %s"Sound[Timer])
if(
Timer <= 0)
{
set_task(1.0"StartGo")
}
else
{

set_task(1.0"StartWait"WAITTIMERTID)
}
return 
PLUGIN_CONTINUE
}
public 
StartGo()
{
if(!
is_user_alive(TerroristID) || !is_user_alive(CounterID) || !is_user_connected(TerroristID) || !is_user_connected(CounterID) || !is_valid_player(CounterID) || !is_valid_player(TerroristID))
{
return 
PLUGIN_HANDLED
}
switch(
DuelNum)
{
case 
1:
{
give_item(CounterID"weapon_knife")
give_item(TerroristID"weapon_knife")    
}
case 
2:
{
cs_set_weapon_ammo(give_item(CounterID"weapon_deagle"), DAMMO)
cs_set_weapon_ammo(give_item(TerroristID"weapon_deagle"), DAMMO)
}
case 
3:
{
cs_set_weapon_ammo(give_item(CounterID"weapon_m4a1"), DAMMO)
cs_set_weapon_ammo(give_item(TerroristID"weapon_m4a1"), DAMMO)
cs_set_user_bpammo(CounterIDCSW_M4A1200)        
cs_set_user_bpammo(TerroristIDCSW_M4A1200)
}
case 
4:
{
cs_set_weapon_ammo(give_item(CounterID"weapon_ak47"), DAMMO)
cs_set_weapon_ammo(give_item(TerroristID"weapon_ak47"), DAMMO)
cs_set_user_bpammo(CounterIDCSW_AK47200)        
cs_set_user_bpammo(TerroristIDCSW_AK47200)
}
case 
5:
{
cs_set_weapon_ammo(give_item(CounterID"weapon_mp5navy"), DAMMO)
cs_set_weapon_ammo(give_item(TerroristID"weapon_mp5navy"), DAMMO)
cs_set_user_bpammo(CounterIDCSW_MP5NAVY200)        
cs_set_user_bpammo(TerroristIDCSW_MP5NAVY200)
}
case 
6:
{
give_item(CounterID"weapon_hegrenade")
give_item(TerroristID"weapon_hegrenade")
cs_set_user_bpammo(CounterIDCSW_HEGRENADE100)        
cs_set_user_bpammo(TerroristIDCSW_HEGRENADE100)
}
case 
7:
{
cs_set_weapon_ammo(give_item(CounterID"weapon_scout"), DAMMO)
cs_set_weapon_ammo(give_item(TerroristID"weapon_scout"), DAMMO)
}
case 
8:
{
cs_set_weapon_ammo(give_item(CounterID"weapon_m3"), 8)
cs_set_weapon_ammo(give_item(TerroristID"weapon_m3"), 8)
}
case 
9:
{
cs_set_weapon_ammo(give_item(CounterID"weapon_awp"), DAMMO)
cs_set_weapon_ammo(give_item(TerroristID"weapon_awp"), DAMMO)
}
case 
10:
{
cs_set_weapon_ammo(give_item(CounterID"weapon_famas"), 3)
new 
wEnt fm_find_ent_by_owner(-1"weapon_famas"CounterID)
if(
wEnt)
{
cs_set_weapon_burst(wEnt1)
}
cs_set_weapon_ammo(give_item(TerroristID"weapon_famas"), 3)
wEnt fm_find_ent_by_owner(-1"weapon_famas"TerroristID)
if(
wEnt)
{
cs_set_weapon_burst(wEnt1)
}
}
}
if(
get_pcvar_num(PcvarMusic))
{
new 
musicnum random_num(0MCOUNT-1)
client_cmd(0"mp3volume 0.9")
client_cmd(0"mp3 play %s"Music[musicnum])
}
if(
get_pcvar_num(PcvarTimer))
{
set_task(0.0"DuelTimer"TIMERTID)
}
else if(
Math[CounterID] || Word[CounterID])
{
set_task(0.0"DuelTimer2"TIMER2TID)
}
return 
PLUGIN_CONTINUE
}
public 
StartRussianRoulette(ctter)
{
new 
ctname[64], tername[64]
get_user_name(ctctname63)
get_user_name(tertername63)
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER"RR1"ctnametername)
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER"RR2")
ColorChat(0"^4%s %L^3"PREFIXLANG_PLAYER"RR3"ctname)
set_hudmessage(02550, -1.00.201.02.00.50.54)
ShowSyncHudMsg(0g_MsgHud3"%L"LANG_PLAYER"RRSTART"ctnameRussianRouletteBullet)
RussianRouletteMenu(ct)
Used[ct] = true
Used
[ter] = true
NotYou
[ct] = false
NotYou
[ter] = false
RussianRouletteID 
ct
return PLUGIN_CONTINUE
}
public 
RussianRouletteMenu(id)
{
new 
Len
new Keys MENU_KEY_0
Len 
format(MenuBodyMENUBODY 1"%L^n^n"LANG_PLAYER"RRTITLE")
Keys |= (<< 0)
Len += format(MenuBody[Len], MENUBODY Len"1. %L^n^n %s"LANG_PLAYER"RRDO"PLUGINVERSIONAUTHOR)
DoIt[id] = true
show_menu
(idKeysMenuBody, -1"Roulette Menu")
return 
PLUGIN_CONTINUE
}
public 
ActionRussianRouletteMenu(idKey)
{
if(!
DoIt[id])
{
return 
PLUGIN_HANDLED
}
get_user_name(idRussianRouletteName63)
set_hudmessage(2552550, -1.00.301.02.00.50.52)
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"RRDOING"RussianRouletteName)
set_task(3.0"RussianRouletteStop"id)
DoIt[id] = false
Start
[id] = true
return PLUGIN_HANDLED
}
public 
RussianRouletteStop(id)
{
new 
RuletteRandom
RuletteRandom 
random_num(17)
get_user_name(idRussianRouletteName63)
if(
RussianRouletteBullet == && RuletteRandom == 1)
{
Boom[id] = true
}
else if(
RussianRouletteBullet == && RuletteRandom == 2)
{
Boom[id] = true
}
else if(
RussianRouletteBullet == && RuletteRandom == 3)
{
Boom[id] = true
}
else
{
Boom[id] = false
}
NotYou[id] = true
Start
[id] = false
set_hudmessage
(2552550, -1.00.301.02.00.50.52)
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"RRPRESS"RussianRouletteName)
return 
PLUGIN_CONTINUE
}
public 
hooksay(id)
{
if(!
Math[id] && !Word[id])
{
return 
PLUGIN_CONTINUE
}
new 
Msg[256], smanswer[32], wname[32]
read_args(Msg255)
remove_quotes(Msg)
num_to_str(MathAnswersmanswer31)
if((
Math[id] && equal(Msgsmanswer)) || (Word[id] && equal(MsgWordAnswer)))
{
if(
get_pcvar_num(PcvarTimer))
{
remove_task(TIMERTID)
}
if(
get_pcvar_num(PcvarMusic))
{
client_cmd(0"cd fadeout")
}
get_user_name(idwname31)
//set_user_lifes(id, 1)
set_hudmessage(02550, -1.00.201.010.01.01.02)
if(
Math[id])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"MATH_WINNER"wnamesmanswer)
}
else if(
Word[id])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"WORD_WINNER"wname)
}
if(
id == CounterID)
{
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_ONCE)
DeathMsg(CounterIDTerroristID1KWPN)
Kill(TerroristID)
}
else if(
id == TerroristID)
{
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_ONCE)
DeathMsg(CounterIDTerroristID1KWPN)
Kill(CounterID)
}
Math[CounterID] = false
Math
[TerroristID] = false
Word
[CounterID] = false
Word
[TerroristID] = false
}
return 
PLUGIN_CONTINUE
}
public 
hooksay_team(id)
{
if(!
Math[id] && !Word[id])
{
return 
PLUGIN_CONTINUE
}
new 
Msg[256], smanswer[32], wname[32]
read_args(Msg255)
remove_quotes(Msg)
num_to_str(MathAnswersmanswer31)
if((
Math[id] && equal(Msgsmanswer)) || (Word[id] && equal(MsgWordAnswer)))
{
if(
get_pcvar_num(PcvarTimer))
{
remove_task(TIMERTID)
}
if(
get_pcvar_num(PcvarMusic))
{
client_cmd(0"cd fadeout")
}
get_user_name(idwname31)
//set_user_lifes(id, 1)
set_hudmessage(02550, -1.00.201.010.01.01.02)
if(
Math[id])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"MATH_WINNER"wnamesmanswer)
}
else if(
Word[id])
{
ShowSyncHudMsg(0g_MsgHud2"%L"LANG_PLAYER"WORD_WINNER"wname)
}
if(
id == CounterID)
{
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_ONCE)
DeathMsg(CounterIDTerroristID1KWPN)
Kill(TerroristID)
}
else if(
id == TerroristID)
{
set_msg_block(get_user_msgid("DeathMsg"), BLOCK_ONCE)
DeathMsg(CounterIDTerroristID1KWPN)
Kill(CounterID)
}
Math[CounterID] = false
Math
[TerroristID] = false
Word
[CounterID] = false
Word
[TerroristID] = false
}
return 
PLUGIN_CONTINUE
}
public 
client_disconnect(id)
{
remove_task(id)
TouchWeapons[id] = false
Once
[id] = false
Knife
[id] = false
Deagle
[id] = false
M4a1
[id] = false
Ak47
[id] = false
Mp5navy
[id] = false
Grenade
[id] = false
Scout
[id] = false
Drob
[id] = false
Awp
[id] = false
Math
[id] = false
Word
[id] = false
RussianRoulette
[id] = false
Used
[id] = false
NotYou
[id] = false
DoIt
[id] = false
Start
[id] = false
InDuel
[id] = false
Famas
[id] = false
return PLUGIN_CONTINUE
}
public 
GodOff(tskid)
{
new 
id tskid GODTID
set_pev
(idpev_takedamage1)
return 
PLUGIN_CONTINUE
}
public 
Informer()
{
if(!
get_pcvar_num(PcvarInformer))
{
remove_task(INFORMERTID)
return 
PLUGIN_HANDLED
}
new 
idLastIDactsctsallNextMap[32], CurrentTime[32], Terrorist[32], names[33][32], Message[512]
for(
id 1id <= MaxPlayersid++)
{
if(!
is_user_connected(id))
{
continue
}
else if(
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
{
acts++
cts++
all ++
LastID id
get_user_name
(idnames[acts], 31)
}
else if(!
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_CT)
{
cts++
all++
}
else if(
cs_get_user_team(id) == CS_TEAM_T && !is_user_bot(id))
{
get_user_name(idTerrorist63)
all++
}
else
{
all++
}
}
if(
acts == && !Last && get_pcvar_num(PcvarLastMenu))
{
LastMenu(LastID)
Last true
}
for(
id 1id <= MaxPlayersid++)
{
new 
LenMode[32]
get_pcvar_string(PcvarModeMode31)
Len format(Message511"%L: %L"LANG_PLAYER"CURRENTMODE"LANG_PLAYERMode)
get_time("%H:%M:%S"CurrentTime31)
Len += format(Message[Len], 511 Len"^n%L: %s"LANG_PLAYER"CURRENTTIME"CurrentTime)
if(
get_cvar_float("mp_timelimit"))
{
new 
get_timeleft()
Len += format(Message[Len], 511 Len"^n%L: %d:%02d"LANG_PLAYER"TLEFT", (60), (60))
}
else
{
Len += format(Message[Len], 511 Len"^n%L: %L"LANG_PLAYER"TLEFT"LANG_PLAYER"LASTR")
}
get_cvar_string("amx_nextmap"NextMap31)
Len += format(Message[Len], 511 Len"^n%L: %s"LANG_PLAYER"NMAP"NextMap)
if(
GetTsNum(0))
{
Len += format(Message[Len], 511 Len"^n%L: %s"LANG_PLAYER"CTER"Terrorist)
}
else
{
Len += format(Message[Len], 511 Len"^n%L: %L"LANG_PLAYER"CTER"LANG_PLAYER"TNONE")
}
Len += format(Message[Len], 511 Len"^n%L: %d/%d"LANG_PLAYER"ALIVECTS"acts,cts)
Len += format(Message[Len], 511 Len"^n%L: %d/%d"LANG_PLAYER"APLAYERS"allMaxPlayers)
if(
acts 3)
{
set_hudmessage(1001001000.010.1801.01.0)
}
else if(
acts == 3)
{
set_hudmessage(025500.010.1801.01.0)
Len += format(Message[Len], 511 Len"^n^n1. %s^n2. %s^n3. %s"names[1], names[2], names[3])
}
else if(
acts == 2)
{
set_hudmessage(25525500.010.1801.01.0)
Len += format(Message[Len], 511 Len"^n^n1. %s^n2. %s"names[1], names[2])
}
else
{
set_hudmessage(255000.010.1811.01.0__1)
Len += format(Message[Len], 511 Len"^n^n1. %s"names[1])
}
ShowSyncHudMsg(idg_MsgHud1"%s"Message)    
}
return 
PLUGIN_CONTINUE
}
public 
LastMenu(id)
{
new 
Len
new Keys MENU_KEY_0
Len 
format(MenuBodyMENUBODY 1"%L ^n^n"LANG_PLAYER"YOULAST")
Keys |= (<< 0)
Len += format(MenuBody[Len], MENUBODY Len"1. %L^n"LANG_PLAYER"LASTYES")
Keys |= (<< 1)
Len += format(MenuBody[Len], MENUBODY Len"2. %L^n^n %s"LANG_PLAYER"LASTNO"PLUGINVERSIONAUTHOR)
show_menu(idKeysMenuBody, -1"Last Menu")
return 
PLUGIN_CONTINUE
}
public 
ActionLastMenu(idkey)
{
switch(
key)
{
case 
0:
{
client_cmd(id"deathrun_duels")
}
case 
1:
{
client_print(idprint_center"%L"LANG_PLAYER"FDUEL")
}
}
return 
PLUGIN_CONTINUE
}
public 
Beacon(id)
{
if(
cs_get_user_team(id) == CS_TEAM_CT)
{
static 
origin[3]
get_user_origin(idorigin)
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
write_byte(TE_BEAMCYLINDER)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2]-20)    
write_coord(origin[0]) 
write_coord(origin[1]) 
write_coord(origin[2]+200)
write_short(BeaconSprite)
write_byte(0)
write_byte(1)
write_byte(6)
write_byte(2
write_byte(1
write_byte(0
write_byte(0
write_byte(255
write_byte(255)
write_byte(0)
message_end()
}
else
{
static 
origin[3]
get_user_origin(idorigin)
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
write_byte(TE_BEAMCYLINDER)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2]-20)    
write_coord(origin[0]) 
write_coord(origin[1])
write_coord(origin[2]+200)
write_short(BeaconSprite)
write_byte(0)
write_byte(1)
write_byte(6)
write_byte(2
write_byte(1
write_byte(255
write_byte(0
write_byte(0
write_byte(255)
write_byte(0)
message_end()
}
set_task(1.0"Beacon"id)    
return 
PLUGIN_CONTINUE
}
stock ColorChat(const id, const input[], any:...)
{
new 
count 1players[32]
static 
msg[190]
vformat(msg190input3)
replace_all(msg190"!g""^4")
replace_all(msg190"!y""^1")
replace_all(msg190"!team""^3")
if (
idplayers[0] = id
else get_players(playerscount"ch")
for (new 
0counti++)
{
if (
is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLESayText_players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}
return 
PLUGIN_CONTINUE
}
stock DeathMsg(killer_idvictim_idheadshotweaponname[])
{
message_begin(MSG_ALLget_user_msgid("DeathMsg"))
write_byte(killer_id)
write_byte(victim_id)
write_byte(headshot)
write_string(weaponname)
message_end()
return 
PLUGIN_CONTINUE
}
stock GetFlagsNum(pcvar)
{
new 
Duels GetFlags(pcvar)
new 
DuelsNum 0
for(new 0DCOUNTa++)
{
if(
Duels & (<< a))
{
DuelsNum++
}
}
return 
DuelsNum
}
stock GetFlags(pcvar)
{
new 
Flags[32]
get_pcvar_string(pcvarFlags31)
return 
read_flags(Flags)
}
stock GetCTsNum(alive)
{
new 
CTsNum 0
for (new id 1id <= MaxPlayersid++)
{
if(!
is_user_connected(id))

continue
}
if(
alive)
{
if(
cs_get_user_team(id) == CS_TEAM_CT && is_user_alive(id))

CTsNum++

}
else
{
if(
cs_get_user_team(id) == CS_TEAM_CT)

CTsNum++

}
}
return 
CTsNum
}
stock GetTsNum(alive)
{
new 
TsNum 0
for (new id 1id <= MaxPlayersid++)
{
if(!
is_user_connected(id) || is_user_bot(id))

continue
}
if(
alive)
{
if(
cs_get_user_team(id) == CS_TEAM_T && is_user_alive(id))

TsNum++

}
else
{
if(
cs_get_user_team(id) == CS_TEAM_T)

TsNum++

}
}
return 
TsNum
}

public 
client_putinserver(id){
if(!
is_user_bot(id))
eventInGame(id);
}
public 
client_connect(id){
giVotes[id][VOTE_ON]=0;
giVotes[id][VOTE_OFF]=0;

return 
1
}
public 
announceVote(){
if(
get_pcvar_num(gcvarFreeRun))
ColorChat(0"!g[!teamFreeRun!g]!team %L",LANG_SERVER"ANNOUNCE");
}
setButtons(){
new 
iDef=get_pcvar_num(gcvarDefault);
for(new 
i=0;i<giPointer;i++){
gUsed[i]=iDef;
gOnStart[i]=iDef;
gDelay[i]=get_pdata_float(gEnt[i],m_flWait);
gDefaultDelay[i]=gDelay[i];
}
}
fillButtons(const szClass[]){
new 
ent = -1;
while((
ent engfunc(EngFunc_FindEntityByString,ent ,"classname"szClass)) != 0){
gEnt[giPointer++]=ent;
set_pev(entpev_iuser4giPointer);
}
}
set_start_value(enttimesFloat:delay){
new 
index=get_ent_index(ent);
if(
index!=-1){
gOnStart[index]=times;
if(
delay>=0.0)
gDelay[index]=delay;
}
}
get_ent_index(ent){
/*
for(new i=0;i<giPointer;i++)
if(gEnt[i]==ent) return i;
return -1;
*/
return pev(entpev_iuser4)-1;
}
restoreButton(ent){
if(
pev(entpev_frame) > 0.0){
new 
Float:Life;
pev(entpev_nextthinkLife);
set_pev(entpev_ltimeLife-0.01);
}
}
public 
ResetButtons(){
gbFreeRun=false;
gbVote=false;
new 
bool:bRestore=get_pcvar_num(gcvarRestore)!=0;
for(new 
i=0;i<MAX_BUTTONS;i++){
gUsed[i]=gOnStart[i];
if(
bRestore){
restoreButton(gEnt[i]);
}
}
giRounds++;
}
public 
fwButtonUsed(thisidcalleridactivatoruse_typeFloat:value){
if(
idcaller!=idactivator) return HAM_IGNORED;

if(
pev(thispev_frame) > 0.0)
return 
HAM_IGNORED;
new 
index=get_ent_index(this);
if(
index==-1
return 
HAM_IGNORED;
if(
get_user_team(idcaller)&get_pcvar_num(gcvarTeam)){

if(
gbFreeRun){
ColorChat(idcaller"!y[!gFreeRun!y]!team %L",idcaller"BUTTON_FREERUN");
return 
HAM_SUPERCEDE;
}
else if(
gUsed[index]<=&& gOnStart[index]!=-1){
ColorChat(idcaller"!y[!gInfo!y]!team %L",idcaller,"BUTTON_NOMORE");
return 
HAM_SUPERCEDE;
}
else{
if(
gUsed[index]>0)
if(--
gUsed[index]){
ColorChat(idcaller"!y[!gInfo!y]!team %L"idcaller"BUTTON_LEFT"gUsed[index]);
}else
ColorChat(idcaller"!y[!gInfo!y]!team %L"idcaller"BUTTON_ENDOFLIMIT");
}
}

set_task(0.1,"setDelay",this);

return 
HAM_IGNORED;
}
public 
setDelay(this){
new 
index=get_ent_index(this);
set_pev(thispev_nextthinkpev(thispev_ltime)+gDelay[index]+0.01);
}

//MENU--------------
public cmd_amx_buttons(idlevelcid){
if(!
cmd_access(idlevelcid1))
return 
PLUGIN_HANDLED;
if(
giPointer==0)
client_print(idprint_chat"%L"id,"NO_BUTTONS");
else
ShowButtonsMenu(id);
return 
PLUGIN_HANDLED;
}
ShowButtonsMenu(idtrace=1){
if(!
is_user_alive(id)){
client_print(idprint_center"%L",id"MUST_B_ALIVE");
return;
}
new 
iNow=gInMenu[id];
new 
iKeys=(1<<0)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<9);
new 
szMenu[196], iLeniMax=(sizeof szMenu) - 1;
new 
szNoLimit[32];
formatex(szNoLimit,31,"(%L)",id,"NOLIMIT");
iLen=copy(szMenuiMax,"Buttons Menu^n");
iLen+=formatex(szMenu[iLen], iMax-iLen,"Ent #%d^n^n",gEnt[iNow]);
iLen+=formatex(szMenu[iLen], iMax-iLen,"%L: %d %s^n 1. %L ",id"USAGE",gOnStart[iNow],(gOnStart[iNow]==-1)?szNoLimit:""id"MORE");

if(
gOnStart[iNow]>=0){
iLen+=formatex(szMenu[iLen], iMax-iLen,"2. %L",id"WORD_LESS");
iKeys|=(1<<1);
}else
iLen+=formatex(szMenu[iLen], iMax-iLen,"2. %L",id,"WORD_LESS");
iLen+=formatex(szMenu[iLen], iMax-iLen,"^n^n3. %L^n^n4. %L^n^n",id"DELAY_EDITOR",id,"OPTIONS");

iLen+=formatex(szMenu[iLen], iMax-iLen,"5. %sNo Clip^n",isNoClip(id)?"r":"");
iLen+=formatex(szMenu[iLen], iMax-iLen,"6. %sGodMode^n",isGodMode(id)?"r":"");

iLen+=formatex(szMenu[iLen], iMax-iLen,"^n7. %L^nw",id"WORD_SAVE");

if(
iNow>0){
iLen+=formatex(szMenu[iLen], iMax-iLen,"^n8. %L",id"BACK");
iKeys|=(1<<7);
}
if(
iNow<giPointer-1){
iLen+=formatex(szMenu[iLen], iMax-iLen,"^n9. %L",id"WORD_NEXT");
iKeys|=(1<<8);
}
iLen+=formatex(szMenu[iLen], iMax-iLen,"^n0. %L"id"EXIT");
show_menu(idiKeysszMenu, -1"ButtonsMenu");
if(
trace){
new 
Float:fOrigin[3], Float:fOrigin2[3];
fm_get_brush_entity_origin(gEnt[gInMenu[id]], fOrigin);
pev(idpev_originfOrigin2);
Create_TE_BEAMPOINTS(fOriginfOrigin2giSprite01020512550010050);
}
}
bool:isNoClip(id)
return 
pev(idpev_movetype)==MOVETYPE_NOCLIP;

bool:isGodMode(id)
return 
pev(idpev_takedamage)==0.0;

public 
PressedButtonsMenu(idkey) {
if(!
is_user_alive(id)){
client_print(idprint_center"%L",id,"MUST_B_ALIVE");
return;
}
/* Menu:
* Buttons Menu
* Ent#<ent>

* Uzyc: <ile>
* 1. Wiecej 2. Mniej

* 3. Editor
*
* 4. Options
*
* 5. NoClip
* 6. GodMode

* 7. Zapisz

* 8. Poprzedni
* 9. Nastepny
* 0. Wyjdz
*/
new trace=0;
switch (
key) {
case 
0: { // 1
gOnStart[gInMenu[id]]++;
}
case 
1: { // 2
gOnStart[gInMenu[id]]--;
}
case 
2: { // 3
ShowDelayMenu(id);
return;
}
case 
3:{ //4
ShowOptionsMenu(id);
return;
}
case 
4:{ //5
set_pev(idpev_movetypeisNoClip(id)?MOVETYPE_WALK:MOVETYPE_NOCLIP);    
}
case 
5:{ //6
set_pev(idpev_takedamageisGodMode(id)?1.0:0.0);
}
case 
6: { // 7
save2File(id);
}
case 
7: { // 8
gInMenu[id]--;
trace=1;
}
case 
8: { // 9
gInMenu[id]++;
trace=1;
}
case 
9: { // 0
return;
}
}
ShowButtonsMenu(idtrace);
}
//--------------
ShowOptionsMenu(id){
if(!
is_user_alive(id)){
client_print(idprint_center"%L",id,"MUST_B_ALIVE");
return;
}
new 
szMenu[196], iLeniMax=(sizeof szMenu) - 1;
iLen+=formatex(szMenu[iLen], iMax-iLen,"yOptions^n^n");
iLen+=formatex(szMenu[iLen], iMax-iLen,"w1. %L^n",id"GOTO");
iLen+=formatex(szMenu[iLen], iMax-iLen,"2. %L^n^n",id"NEAREST");
iLen+=formatex(szMenu[iLen], iMax-iLen,"9. %L",id"BACK");
show_menu(idKeysOptionsMenuszMenu, -1"OptionsMenu");
}
public 
PressedOptionsMenu(idkey){
if(!
is_user_alive(id)){
client_print(idprint_center"%L",id,"MUST_B_ALIVE");
return;
}
new 
trace=0;
switch (
key) {                                                                          
case 
0: { // 1
go2Button(id);
}
case 
1: { // 2
gInMenu[id]=findTheClosest(id);
trace=1;
}
}
ShowButtonsMenu(idtrace);
}
//-------------
ShowDelayMenu(id){
if(!
is_user_alive(id)){
client_print(idprint_center"%L",id,"MUST_B_ALIVE");
return;
}
new 
iNow=gInMenu[id];
new 
iKeys=(1<<0)|(1<<2)|(1<<8);
new 
szMenu[196], iLeniMax=(sizeof szMenu) - 1;
iLen=copy(szMenuiMax,"yDelay Menu^n");
iLen+=formatex(szMenu[iLen], iMax-iLen,"Ent#%d^n^n",gEnt[iNow]);
iLen+=formatex(szMenu[iLen], iMax-iLen,"%L: %.1f^n",id"CURRENT_DELAY"gDelay[iNow]);
iLen+=formatex(szMenu[iLen], iMax-iLen,"1. %L ",id"MORE");
if(
gDelay[iNow]>0.0){
iLen+=formatex(szMenu[iLen], iMax-iLen,"2. %L",id"WORD_LESS");
iKeys|=(1<<1);
}else
iLen+=formatex(szMenu[iLen], iMax-iLen,"2. %Lw",id,"WORD_LESS");
iLen+=formatex(szMenu[iLen], iMax-iLen,"^n3. %L",id"DEFAULT");
iLen+=formatex(szMenu[iLen], iMax-iLen,"^n^n9. %L",id"BACK");
show_menu(idiKeysszMenu, -1"DelayMenu");
}
public 
PressedDelayMenu(idkey){
new 
iNow=gInMenu[id];
switch(
key){
case 
0:{
gDelay[iNow]+=1.0;
}
case 
1:{
gDelay[iNow]-=1.0;
if(
gDelay[iNow] < 0.0)
gDelay[iNow]=0.0;
}
case 
2:{
gDelay[iNow]=gDefaultDelay[iNow];
}
case 
8:{
ShowButtonsMenu(id0);
return;
}
}
ShowDelayMenu(id);
}
//-------------
save2File(id){
if(
file_exists(gszFile))
delete_file(gszFile);
write_file(gszFile";<ent> <count> <delay>");
new 
szLine[35];
for(new 
i=0;i<giPointer;i++){
formatex(szLine34"%d %d %.1f",gEnt[i], gOnStart[i], gDelay[i]);
write_file(gszFileszLine);
}
client_print(idprint_center"%L!",id,"WORD_SAVED");
}
findTheClosest(id){
new 
Float:fPlayerOrig[3];
pev(idpev_originfPlayerOrig);
new 
Float:fOrigin[3];
fm_get_brush_entity_origin(gEnt[0], fOrigin);

new 
Float:fRange=get_distance_f(fOriginfPlayerOrig), index=0;
new 
Float:fNewRange;
for(new 
i=1;i<giPointer;i++){
fm_get_brush_entity_origin(gEnt[i], fOrigin);
fNewRange=get_distance_ffOrigin,  fPlayerOrig);
if(
fNewRange fRange){
fRange=fNewRange;
index=i;
}
}
return 
index;
}
go2Button(ident=-1){
if(
ent==-1)
ent=gInMenu[id];
ent=gEnt[ent];
if(!
pev_valid(ent)){
client_print(idprint_center"%L",id,"NOTARGET");
return;
}
new 
Float:fOrigin[3];
fm_get_brush_entity_origin(entfOrigin);
set_pev(idpev_originfOrigin);
client_print(idprint_chat"PS. No Clip :)");
}
//FreeRun
public cmdVoteFreeRun(id){
if(
get_pcvar_num(gcvarFreeRun)==0){
ColorChat(id"!y[!gFreeRun!y]!team %L",id,"FREERUN_DISABLED");
return 
PLUGIN_HANDLED;
}
if(
gbVote){
ColorChat(id"!y[!gFreeRun!y]!team %L",id,"FREERUN_VOTE_IS_NOW");
return 
PLUGIN_HANDLED;
}
if(!
is_user_alive(id)){
client_print(idprint_center"%L",id"MUST_B_ALIVE");
return 
PLUGIN_HANDLED;
}
if(
get_pcvar_num(gcvarPrivilege)!=&& !gbFreeRun && get_user_team(id)==1){
ColorChat(id"!y[!gFreeRun!y]!team %L",id,"FREERUN_TT_DECIDED");
makeFreeRun(true);
return 
PLUGIN_HANDLED;
}
new 
iLimit=get_pcvar_num(gcvarLimit);
new 
iOffset=0;
if(
get_pcvar_num(gcvarLimitMode)){
iOffset = ( giTime iLimit 60 )  - get_systime();
if( 
iOffset ){
ColorChat(id"!y[!gFreeRun!y]!team %L",id,"FREERUN_NEXT_VOTE_TIME"iOffset/60iOffset%60);
return 
PLUGIN_HANDLED;
}
}
else{
iOffset =  min(MAX_ROUNDSiLimit) - giRounds;
if( 
iOffset ){
ColorChat(id"!y[!gFreeRun!y]!team %L",id,"FREERUN_NEXT_VOTE_ROUNDS"iOffset);
return 
PLUGIN_HANDLED;
}
}

makeVote();
return 
PLUGIN_CONTINUE;
}
//FREERUN
public makeVote(){
giVoteTime=get_pcvar_num(gcvarFRVoteTime);
gbVote=true;
giVoteStart=get_systime();
set_task(float(giVoteTime), "resultsOfVote"TASK_RES);
new 
Players[32], playerCount;
new 
id;
get_players(PlayersplayerCount);
for (new 
i=0i<playerCounti++){
id Players[i]; 
eventInGame(id);
}

}
public 
resultsOfVote(tid){
gbVote=false;

new 
giVotesOn=count(VOTE_ON);
new 
giVotesOff=count(VOTE_OFF);

ColorChat(0"!y[!gFreeRun!y]!team %L %L(%d) vs %L(%d)",LANG_SERVER,"FREERUN_RESULTS",LANG_SERVER,"YES",giVotesOn,LANG_SERVER,"NO"giVotesOff);

if( 
giVotesOn == giVotesOff ){
ColorChat(0,"!y[!gFreeRun!y]!team %L",LANG_SERVER,"FREERUN_TIE");
return;
}
makeFreeRun((giVotesOn giVotesOff));
ColorChat(0,"!y[!gFreeRun!y]!team %L ^x03%L",LANG_SERVER,"FREERUN_WINOPTION",LANG_SERVERgbFreeRun?"YES":"NO");
}
makeFreeRun(bool:bFR=true){
gbFreeRun=bFR;
reset();
giRounds=0;
giTime=get_systime();

if(
gbFreeRun){
set_pcvar_string(PcvarMode"FreeRun")
set_hudmessage(02552550.02, -1.0);
show_hudmessage(0"FreeRun!");
}

}
count(VOTE_STATE){
new 
iCounter=0;
for(new 
i=1;i<33;i++)
if(
giVotes[i][VOTE_STATE])
iCounter++;
return 
iCounter;
}
reset(){
for(new 
i=1;i<33;i++){
giVotes[i][VOTE_ON]=0;
giVotes[i][VOTE_OFF]=0;
}
}
public 
show_menu_(tid){
new 
id=tid-TASK_SHOWMENU;
new 
iTeam=get_user_team(id);
new 
menu_idkeys;
new 
menuUp player_menu_infoidmenu_idkeys );
// Only display menu if another isn't shown
if ( iTeam && (menuUp <= || menu_id 0) ){
new 
iTime=get_pcvar_num(gcvarFRVoteTime);
new 
iOffset=get_systime()-giVoteStart;
iTime-=iOffset;
new 
szMenu[128];
formatex(szMenu127"%L^n^n1. %L^n2. %L",id,"FREERUN_VOTEMENU",id,"YES",id,"NO");
show_menu(idKeysFFVoteszMenuiTime"FRVote");
}else
set_task(1.0"show_menu_"tid);
}
public 
eventInGame(id){
if(
giVotes[id][VOTE_ON] || giVotes[id][VOTE_OFF])
return;
if(
gbVote)
set_task(1.0"show_menu_"id+TASK_SHOWMENU);
}
public 
PressedFRVote(idkey) {
if(
gbVote==false) return;
switch (
key) {
case 
VOTE_ON: { // 1
giVotes[id][VOTE_ON]=1;
}
case 
VOTE_OFF: { // 2
giVotes[id][VOTE_OFF]=1;
}
default:{
return;
}
}
new 
szName[32];
get_user_name(idszName31);
client_print(0print_chat"* %L",LANG_PLAYER,(key==VOTE_ON)?"VOTED_FOR":"VOTED_AGAINST"szName);
}

stock Create_TE_BEAMPOINTS(Float:start[3], Float:end[3], iSpritestartFrameframeRatelifewidthnoiseredgreenbluealphaspeed){
message_beginMSG_BROADCASTSVC_TEMPENTITY )
write_byteTE_BEAMPOINTS )
write_coordfloatround(start[0]) )
write_coordfloatround(start[1]) )
write_coordfloatround(start[2]) )
write_coordfloatround(end[0]) )
write_coordfloatround(end[1]) )
write_coordfloatround(end[2]) )
write_shortiSprite )            // model
write_bytestartFrame )        // start frame
write_byteframeRate )            // framerate
write_bytelife )                // life
write_bytewidth )                // width
write_bytenoise )                // noise
write_bytered)                // red
write_bytegreen )                // green
write_byteblue )                // blue
write_bytealpha )                // brightness
write_bytespeed )                // speed
message_end()
}

stock Kill(id)
{
user_kill(id1)
return 
PLUGIN_CONTINUE


Last edited by Adi1997; 04-20-2022 at 12:34.
Adi1997 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-18-2022 , 12:55   Re: (native "pev") Please Help Me! Thanks
Reply With Quote #2

Enable debug.
__________________
HamletEagle is offline
Adi1997
Junior Member
Join Date: Apr 2022
Old 04-18-2022 , 12:57   Re: (native "pev") Please Help Me! Thanks
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
Enable debug.
PS: only on certain maps does it give me this error

PHP Code:
L 04/18/2022 19:52:10: [AMXXDisplaying debug trace (plugin "DR_Duel1.amxx"version "4.0")
L 04/18/2022 19:52:10: [AMXXRun time error 10native error (native "pev")
L 04/18/2022 19:52:10: [AMXX]    [0DR_Duel1.sma::get_ent_index (line 2008)
L 04/18/2022 19:52:10: [AMXX]    [1DR_Duel1.sma::set_start_value (line 1995)
L 04/18/2022 19:52:10: [AMXX]    [2DR_Duel1.sma::plugin_cfg (line 346

Last edited by Adi1997; 04-19-2022 at 03:52.
Adi1997 is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-20-2022 , 13:19   Re: [AMXX] Run time error 10: native error (native "pev") Please Help Me! Thanks
Reply With Quote #4

Why in the world Did you open a second thread with the same subject? You have to wait until actually someone is answering, and you can "Bump" your thread after at least two weeks (if im not wrong) if no one answer, so stop spamming the forum, insisting on your own problems .
__________________
Project: Among Us

Last edited by Craxor; 04-20-2022 at 13:20.
Craxor is offline
Send a message via ICQ to Craxor
Adi1997
Junior Member
Join Date: Apr 2022
Old 04-20-2022 , 18:22   Re: [AMXX] Run time error 10: native error (native "pev") Please Help Me! Thanks
Reply With Quote #5

Quote:
Originally Posted by Craxor View Post
Why in the world Did you open a second thread with the same subject? You have to wait until actually someone is answering, and you can "Bump" your thread after at least two weeks (if im not wrong) if no one answer, so stop spamming the forum, insisting on your own problems .
Trebuia sa te bagi și tu in seama ca alta treaba nu aveai 🤦*♂️
Adi1997 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:22.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode