Eroare compilare

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

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
TakiZO
Membru, skill 0
Membru, skill 0
Posts: 22
Joined: 14 May 2020, 21:24
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: GoX.GoDoM.Ro
Fond eXtream: 0
Contact:

28 May 2020, 23:41

Code: Select all

Read the errors below:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

include\fakemeta_const.inc(551) : warning 201: redefinition of constant/macro (symbol "TraceResult")
tinta.sma(67) : error 048: array dimensions do not match
tinta.sma(173) : error 033: array must be indexed (variable "-unknown-")
tinta.sma(232) : error 048: array dimensions do not match
tinta.sma(233) : error 048: array dimensions do not match
tinta.sma(247) : error 033: array must be indexed (variable "-unknown-")

5 Errors.
Could not locate output file tinta.amx (compile failed).

incerc sa compilez o sursa pentru /tinta pentru un sv go remake

Code: Select all

#include <amxmodx>
#include <engine>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <colorchat>

new const SilahBilgi[27][3] = {
{0,0,0},
{12,1,4},
{9,52,1},
{5,32,5},
{14,1,6},
{6,100,7},
{4,90,8},
{13,1,9},
{10,120,10},
{7,100,11},
{6,100,12},
{4,90,14},
{4,90,15},
{6,100,16},
{10,120,17},
{10,120,19},
{3,200,20},
{5,32,21},
{4,90,22},
{10,120,23},
{11,2,25},
{8,35,26},
{4,90,27},
{2,90,28},
{7,100,30},
{0,0,29},
{0,0,0}
}
new scope[33];
new const sprites[6][4][64] = {
{"Cross Adi","Txt Yolu","Sprite Yolu","Txt Adi"},
{"flusha Crosshair","sprites/custom_cross2_fix.txt","sprites/csgo_crosshair_32.spr","custom_cross2_fix"},
{"JW Crosshair","sprites/custom_cross_fix_yeni3.txt","sprites/csgo_nisan_yeni3.spr","custom_cross_fix_yeni3"},
{"s1mple Crosshair","sprites/custom_cross3_fix.txt","sprites/artinisan.spr","custom_cross3_fix"},
{"","sprites/custom_cross5_fix4.txt","sprites/dahakucuk4.spr","custom_cross5_fix4"},
{"CS:GO Crosshair","sprites/custom_cross_baslangic.txt","sprites/csgo_baslangic.spr","custom_cross_baslangic"}
}

new weapon_weapon[][] =
{
"weapon_aug",
"weapon_sg552"
}

new cross[33];
public plugin_init()
{
register_plugin("CS:GO Crosshair","1.1","KriTo");
register_event("CurWeapon","Event_CurWeapon","be","1=1");
register_clcmd("buyammo1","guncelle1");
register_clcmd("buyammo2","guncelle1");
register_clcmd("custom_cross2_fix","FakeSwitch");
register_clcmd("say /crosshair","crossmenu");
register_clcmd("say .crosshair","crossmenu");
register_clcmd("say /tinta","crossmenu");
register_clcmd("say .tinta","crossmenu");

for(new i = 0; i < sizeof weapon_weapon; i++)
RegisterHam(Ham_Weapon_Reload, weapon_weapon, "fw_Weapon_Reload_Post", 1)
}

public fw_Weapon_Reload_Post(ent)
{
static id;
id = pev(ent, pev_owner);

if(get_user_weapon(id) == CSW_AUG || get_user_weapon(id) == CSW_SG552)
if(scope[id]==1)
scope[id]=0;

return HAM_HANDLED
}

/*public client_disconnected(id){
cross[id] = 1;
}*/
public client_putinserver(id){
client_cmd(id, "crosshair 1")
cross[id] = 0;
}
public client_PreThink(id)
{
new button = pev(id, pev_oldbuttons);
new oldbutton = pev(id, pev_button);
if(oldbutton & IN_ATTACK2)
{
if(button & IN_ATTACK2)
return PLUGIN_CONTINUE;

new weapon = get_user_weapon(id);
if(weapon == CSW_AUG || weapon == CSW_SG552)
{
if(scope[id]==0)
scope[id]=1;
else
scope[id]=0;
Guncelle(id);
} else if(weapon != CSW_AUG || weapon != CSW_SG552)
{
scope[id]=0;
}
}

return PLUGIN_CONTINUE;
}
public crossmenu(id)
{
new Menu=menu_create("rCS:GO yCrosshair wMenu^n","crossdevam");
menu_additem(Menu,"Default Crosshair","1");
for(new i=1;i<sizeof(sprites);i++)
{
new Item[128],text[12];
formatex(Item,127,"%s",sprites[0]);
num_to_str(i+1,text,11);
menu_additem(Menu,Item,text);
}
menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
menu_display(id,Menu,0);
}
public crossdevam(id, menu, item)
{

if( item == MENU_EXIT )
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}

new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
cross[id] = key-1;
if(cross[id] == 0)
{
message_begin(MSG_ONE, get_user_msgid("HideWeapon"), .player=id);
write_byte(1<<7);
message_end();
}
ColorChat(id, GREEN, "%s ^01Ai ales^04 %s", sprites[cross[id]][0]);
Guncelle(id);
client_cmd(id, "lastinv;wait;wait;wait;wait;wait;wait;lastinv")

return PLUGIN_HANDLED;
}
public guncelle1(id)
{
set_task(0.1,"Guncelle",id);
return PLUGIN_CONTINUE;
}
public Guncelle(id)
{
if(!is_user_alive(id) || cross[id] == 0)
return PLUGIN_HANDLED;
new weapon = get_user_weapon(id);
if( weapon == CSW_AWP || weapon == CSW_SCOUT || weapon == CSW_SG550 || weapon == CSW_G3SG1 || weapon == CSW_KNIFE)
return PLUGIN_CONTINUE

if(weapon != CSW_SG552 && weapon != CSW_AUG)
scope[id]=0

new i;
for(i=0;i<sizeof(SilahBilgi);i++)
{
new yeniweap = SilahBilgi[2];
if(weapon == yeniweap)
{
break;
} else if(i==sizeof(SilahBilgi)-1)
{
return PLUGIN_CONTINUE;
}
}
message_begin(MSG_ONE, get_user_msgid("HideWeapon"), .player=id);
write_byte(1<<6);
message_end();

message_begin(MSG_ONE,get_user_msgid("WeaponList"), .player=id);
write_string(sprites[cross[id]][3]);
write_byte(SilahBilgi[i-1][0]);
write_byte(SilahBilgi[i-1][1]);
write_byte(-1);
write_byte(-1);
write_byte(6);
write_byte(0);
write_byte(2);
write_byte(0);
message_end();

message_begin(MSG_ONE,get_user_msgid("SetFOV"), .player=id);
if(scope[id] == 1)
write_byte(55);
else
write_byte(89);
message_end();

new ammo,bpammo;
get_user_ammo(id,weapon,ammo,bpammo);

message_begin(MSG_ONE,get_user_msgid("CurWeapon"), .player=id);
write_byte(1);
write_byte(2);
write_byte(ammo);
message_end();
if(weapon != CSW_KNIFE) {
message_begin(MSG_ONE,get_user_msgid("AmmoX"), .player=id);
write_byte(SilahBilgi[i-1][0]);
write_byte(bpammo);
message_end();
}
if(scope[id] == 0) {
message_begin(MSG_ONE,get_user_msgid("SetFOV"), .player=id);
write_byte(90);
message_end();
}

return PLUGIN_HANDLED;
}
public FakeSwitch(const client)engclient_cmd(client,"weapon_shield");
public plugin_precache()
{
for(new i=1;i<sizeof(sprites);i++)
{
precache_generic(sprites[1]);
precache_generic(sprites[2]);
}
}

public Event_CurWeapon(id)
{
if(!is_user_alive(id) || cross[id] == 0)
return PLUGIN_HANDLED;
new weapon = read_data(2);
if( weapon == CSW_AWP || weapon == CSW_SCOUT || weapon == CSW_SG550 || weapon == CSW_G3SG1)
return PLUGIN_CONTINUE
new i;
for(i=0;i<sizeof(SilahBilgi);i++)
{
new yeniweap = SilahBilgi[2];
if(weapon == yeniweap)
{
break;
}
}

if(weapon == CSW_KNIFE)
{
message_begin(MSG_ONE,get_user_msgid("WeaponList"), .player=id);
write_string(sprites[cross[id]][3]);
write_byte(-1);
write_byte(-1);
write_byte(-1);
write_byte(-1);
write_byte(0);
write_byte(11);
write_byte(2);
write_byte(0);
message_end();

message_begin(MSG_ONE,get_user_msgid("SetFOV"), .player=id);
write_byte(89);
message_end();

message_begin(MSG_ONE,get_user_msgid("CurWeapon"), .player=id);
write_byte(1);
write_byte(2);
write_byte(-1);
message_end();

message_begin(MSG_ONE,get_user_msgid("SetFOV"), .player=id);
write_byte(90);
message_end();

return PLUGIN_CONTINUE
}

message_begin(MSG_ONE, get_user_msgid("HideWeapon"), .player=id);
write_byte(1<<6);
message_end();

message_begin(MSG_ONE,get_user_msgid("WeaponList"), .player=id);
write_string(sprites[cross[id]][3]);
write_byte(SilahBilgi[i-1][0]);
write_byte(SilahBilgi[i-1][1]);
write_byte(-1);
write_byte(-1);
write_byte(6);
write_byte(0);
write_byte(2);
write_byte(0);
message_end();

if(weapon != CSW_SG552 && weapon != CSW_AUG)
scope[id]=0

message_begin(MSG_ONE,get_user_msgid("SetFOV"), .player=id);
if(scope[id] == 1)
write_byte(55);
else
write_byte(89);
message_end();

new ammo,bpammo;
get_user_ammo(id,weapon,ammo,bpammo);

message_begin(MSG_ONE,get_user_msgid("CurWeapon"), .player=id);
write_byte(1);
write_byte(2);
write_byte(ammo);
message_end();

if(weapon != CSW_KNIFE) {
message_begin(MSG_ONE,get_user_msgid("AmmoX"), .player=id);
write_byte(SilahBilgi[i-1][0]);
write_byte(bpammo);
message_end();
}
if(scope[id] == 0) {
message_begin(MSG_ONE,get_user_msgid("SetFOV"), .player=id);
write_byte(90);
message_end();
}


return PLUGIN_HANDLED;
}

help please, eventual daca puteti sa mi-l faceti voi va rog..
User avatar
CyBer[N]eTicK
Membru, skill 0
Membru, skill 0
Posts: 18
Joined: 29 May 2020, 04:35
Detinator Steam: Da
CS Status: Citesc & Ajut
Detinator server CS: BB.BlackGames.Ro
SteamID: STEAM_0:1:427987588
Fond eXtream: 0
Location: România(Iaşi)
Has thanked: 2 times
Contact:

30 May 2020, 01:08

Nu, ma injura dar, sunt la inceput am facut ce-am putut sper sa fie bun.
| Afiseaza codul
#include <amxmodx>
#include <engine>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>

new const SilahBilgi[27][3] = {
    {0,0,0},
    {12,1,4},
    {9,52,1},
    {5,32,5},
    {14,1,6},
    {6,100,7},
    {4,90,8},
    {13,1,9},
    {10,120,10},
    {7,100,11},
    {6,100,12},
    {4,90,14},
    {4,90,15},
    {6,100,16},
    {10,120,17},
    {10,120,19},
    {3,200,20},
    {5,32,21},
    {4,90,22},
    {10,120,23},
    {11,2,25},
    {8,35,26},
    {4,90,27},
    {2,90,28},
    {7,100,30},
    {0,0,29},
    {0,0,0}
}
new scope[33];
new const sprites[6][4][64] = {
    {"Cross Adi","Txt Yolu","Sprite Yolu","Txt Adi"},
    {"CS:GO Crosshair","sprites/custom_cross2_fix.txt","sprites/csgo_crosshair_32.spr","custom_cross2_fix"},
    {"Normal Sabit","sprites/custom_cross_fix_yeni3.txt","sprites/csgo_nisan_yeni3.spr","custom_cross_fix_yeni3"},
    {"CS:GO Arti Crosshair","sprites/custom_cross3_fix.txt","sprites/artinisan.spr","custom_cross3_fix"},
    {"CS:GO Ufak","sprites/custom_cross5_fix4.txt","sprites/dahakucuk4.spr","custom_cross5_fix4"},
    {"CS:GO Baslangic","sprites/custom_cross_baslangic.txt","sprites/csgo_baslangic.spr","custom_cross_baslangic"}
}

new weapon_weapon[][] =
{
    "weapon_aug",
    "weapon_sg552"
}

new cross[33];
public plugin_init()
{
    register_plugin("CS:GO Crosshair","1.1","KriTo");
    register_event("CurWeapon","Event_CurWeapon","be","1=1");
    register_clcmd("buyammo1","guncelle1");
    register_clcmd("buyammo2","guncelle1");
    register_clcmd("custom_cross2_fix","FakeSwitch");
    register_clcmd("say /crosshair","crossmenu");
    register_clcmd("say .crosshair","crossmenu");

    for(new i = 0; i < sizeof weapon_weapon; i++)
        RegisterHam(Ham_Weapon_Reload, weapon_weapon, "fw_Weapon_Reload_Post", 1)
}

public fw_Weapon_Reload_Post(ent)
{
    static id;
    id = pev(ent, pev_owner);
    
    if(get_user_weapon(id) == CSW_AUG || get_user_weapon(id) == CSW_SG552)
        if(scope[id]==1)
            scope[id]=0;
        
    return HAM_HANDLED
}

/*public client_disconnected(id){
    cross[id] = 1;
}*/
public client_putinserver(id){
    client_cmd(id, "crosshair 1")
    cross[id] = 0;
}
public client_PreThink(id)
{
    new button = pev(id, pev_oldbuttons);
    new oldbutton = pev(id, pev_button);
    if(oldbutton & IN_ATTACK2)
    {
        if(button & IN_ATTACK2)
            return PLUGIN_CONTINUE;

        new weapon = get_user_weapon(id);
        if(weapon == CSW_AUG || weapon == CSW_SG552)
        {
            if(scope[id]==0)
                scope[id]=1;
            else
                scope[id]=0;
            Guncelle(id);
        } else if(weapon != CSW_AUG || weapon != CSW_SG552)
        {
            scope[id]=0;
        }
    }
    
    return PLUGIN_CONTINUE;
}
public crossmenu(id)
{
    new Menu=menu_create("\rCS:GO \yCrosshair \wMenu^n","crossdevam");
    menu_additem(Menu,"Default Crosshair","1");
    for(new i=1;i<sizeof(sprites);i++)
    {
        new Item[128],text[12];
        formatex(Item,127,"%s",sprites[0]);
        num_to_str(i+1,text,11);
        menu_additem(Menu,Item,text);
    }
    menu_setprop(Menu, MPROP_EXIT, MEXIT_ALL);
    menu_display(id,Menu,0);
}
public crossdevam(id, menu, item)
{

    if( item == MENU_EXIT )
    {
        menu_destroy(menu);
        return PLUGIN_HANDLED;
    }

    new data[6], iName[64];
    new access, callback;
    menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
    new key = str_to_num(data);
    cross[id] = key-1;
    if(cross[id] == 0)
    {
        message_begin(MSG_ONE, get_user_msgid("HideWeapon"),  .player=id);
        write_byte(1<<7);
        message_end();
    }
    Guncelle(id);
    client_cmd(id, "lastinv;wait;wait;wait;wait;wait;wait;lastinv")

    return PLUGIN_HANDLED;
}
public guncelle1(id)
{
    set_task(0.1,"Guncelle",id);
    return PLUGIN_CONTINUE;
}
public Guncelle(id)
{
    if(!is_user_alive(id) || cross[id] == 0)
        return PLUGIN_HANDLED;
    new weapon = get_user_weapon(id);
    if( weapon == CSW_AWP || weapon == CSW_SCOUT || weapon == CSW_SG550 || weapon == CSW_G3SG1 || weapon == CSW_KNIFE)
        return PLUGIN_CONTINUE

    if(weapon != CSW_SG552 && weapon != CSW_AUG)
        scope[id]=0

    new i;
    for(i=0;i<sizeof(SilahBilgi);i++)
    {
        new yeniweap = SilahBilgi[2];
        if(weapon == yeniweap)
        {
            break;
        } else if(i==sizeof(SilahBilgi)-1)
        {
            return PLUGIN_CONTINUE;
        }
    }
    message_begin(MSG_ONE, get_user_msgid("HideWeapon"),  .player=id);
    write_byte(1<<6);
    message_end();

    message_begin(MSG_ONE,get_user_msgid("WeaponList"),   .player=id);
    write_string(sprites[cross[id]][3]);
    write_byte(SilahBilgi[i-1][0]);
    write_byte(SilahBilgi[i-1][1]);
    write_byte(-1);
    write_byte(-1);
    write_byte(6);
    write_byte(0);
    write_byte(2);
    write_byte(0);
    message_end();

    new ammo,bpammo;
    get_user_ammo(id,weapon,ammo,bpammo);

    message_begin(MSG_ONE,get_user_msgid("CurWeapon"),    .player=id);
    write_byte(1);
    write_byte(2);
    write_byte(ammo);
    message_end();
    if(weapon != CSW_KNIFE) {
        message_begin(MSG_ONE,get_user_msgid("AmmoX"),      .player=id);
        write_byte(SilahBilgi[i-1][0]);
        write_byte(bpammo);
        message_end();
    }

    return PLUGIN_HANDLED;
}
public FakeSwitch(const client)engclient_cmd(client,"weapon_shield");
public plugin_precache()
{
    for(new i=1;i<sizeof(sprites);i++)
    {
        precache_generic(sprites[1]);
        precache_generic(sprites[2]);
    }
}

public Event_CurWeapon(id)
{
    if(!is_user_alive(id) || cross[id] == 0)
        return PLUGIN_HANDLED;
    new weapon = read_data(2);
    if( weapon == CSW_AWP || weapon == CSW_SCOUT || weapon == CSW_SG550 || weapon == CSW_G3SG1)
        return PLUGIN_CONTINUE
    new i;
    for(i=0;i<sizeof(SilahBilgi);i++)
    {
        new yeniweap = SilahBilgi[2];
        if(weapon == yeniweap)
        {
            break;
        }
    }

    if(weapon == CSW_KNIFE)
    {
        message_begin(MSG_ONE,get_user_msgid("WeaponList"),   .player=id);
        write_string(sprites[cross[id]][3]);
        write_byte(-1);
        write_byte(-1);
        write_byte(-1);
        write_byte(-1);
        write_byte(0);
        write_byte(11);
        write_byte(2);
        write_byte(0);
        message_end();

        message_begin(MSG_ONE,get_user_msgid("CurWeapon"),    .player=id);
        write_byte(1);
        write_byte(2);
        write_byte(-1);
        message_end();

        return PLUGIN_CONTINUE
    }

    message_begin(MSG_ONE, get_user_msgid("HideWeapon"),  .player=id);
    write_byte(1<<6);
    message_end();

    message_begin(MSG_ONE,get_user_msgid("WeaponList"),   .player=id);
    write_string(sprites[cross[id]][3]);
    write_byte(SilahBilgi[i-1][0]);
    write_byte(SilahBilgi[i-1][1]);
    write_byte(-1);
    write_byte(-1);
    write_byte(6);
    write_byte(0);
    write_byte(2);
    write_byte(0);
    message_end();

    if(weapon != CSW_SG552 && weapon != CSW_AUG)
        scope[id]=0

    new ammo,bpammo;
    get_user_ammo(id,weapon,ammo,bpammo);

    message_begin(MSG_ONE,get_user_msgid("CurWeapon"),    .player=id);
    write_byte(1);
    write_byte(2);
    write_byte(ammo);
    message_end();

    if(weapon != CSW_KNIFE) {
        message_begin(MSG_ONE,get_user_msgid("AmmoX"),      .player=id);
        write_byte(SilahBilgi[i-1][0]);
        write_byte(bpammo);
        message_end();
    }


    return PLUGIN_HANDLED;
}
TakiZO
Membru, skill 0
Membru, skill 0
Posts: 22
Joined: 14 May 2020, 21:24
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Detinator server CS: GoX.GoDoM.Ro
Fond eXtream: 0
Contact:

31 May 2020, 01:45

Perfect frate poti sa imi faci si acesta pentru mvp cred ca e bun vreau sa se auda la final ceva melodii stii ce zic, si la asta de eroare la compilare

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta_util>
#include <dhudmessage>
#include <csx>

#define PLUGIN "MVP"
#define VERSION "1.0.3"
#define AUTHOR "Kia"

// ===============================================================================
// 	Variables
// ===============================================================================

/* Defines */

#define NO_BOMB_PLANTED 9191
#define NO_BOMB_DEFUSED 1919

#define CHECK_DELAY 0.5

/* Integers */

new g_iEnemiesKilled[33]
new g_iHostagesRescued[33]

new g_iBombPlanter
new g_iBombDefuser

/* Boolean */

new bool:g_bBombExploded
new bool:g_bAllHostagesRescued

// ===============================================================================
// 	plugin_init
// ===============================================================================

public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	/* Events */
	
	register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0") 
	
	register_event("SendAudio", "Event_RoundWon_T" , "a", "2&%!MRAD_terwin") 
	register_event("SendAudio", "Event_RoundWon_CT", "a", "2&%!MRAD_ctwin")
	register_event("TextMsg", "Event_AllHostagesRescued", "a", "2&#All_Hostages_R");
	
	register_logevent("Event_HostageRescued", 3, "2=Rescued_A_Hostage") 
	
	register_event("DeathMsg", "Event_DeathMsg", "a")
}

// ===============================================================================
// 	Event_NewRound - Called when a new Round begins
// ===============================================================================

public Event_NewRound()
{
	g_iBombPlanter = NO_BOMB_PLANTED
	g_iBombDefuser = NO_BOMB_DEFUSED
	
	g_bBombExploded = false
	g_bAllHostagesRescued = false
	
	arrayset(g_iEnemiesKilled, 0, sizeof(g_iEnemiesKilled))
	arrayset(g_iHostagesRescued, 0 , sizeof(g_iHostagesRescued))
}

// ===============================================================================
// 	Event_RoundWon_T - Called when the Counter-Terrorists when the Round
// ===============================================================================

public Event_RoundWon_T()
{
	set_task(CHECK_DELAY, "CheckTConditions")
}

public CheckTConditions()
{
	if(g_iBombPlanter != NO_BOMB_PLANTED && g_bBombExploded == false)
	{
		new iTopKiller = GetTopKiller(1)
		ShowMVPMessage(iTopKiller, 1)
		
		return PLUGIN_HANDLED
	}
	
	/*new iTopKiller = GetTopKiller(1)
	ShowMVPMessage(iTopKiller, 1)*/
	
	return PLUGIN_HANDLED
}

// ===============================================================================
// 	Event_RoundWon_CT - Called when the Counter-Terrorists when the Round
// ===============================================================================

public Event_RoundWon_CT()
{
	set_task(CHECK_DELAY, "CheckCTConditions")
}

public CheckCTConditions()
{
	if(g_iBombDefuser != NO_BOMB_DEFUSED)
	{
		ShowMVPMessage(g_iBombDefuser, 2)
		return PLUGIN_HANDLED
	}
	
	if(g_bAllHostagesRescued)
	{
		new iTopRescuer = GetTopRescuer()
		ShowMVPMessage(iTopRescuer, 4)
		
		return PLUGIN_HANDLED
	}
	
	new iTopKiller = GetTopKiller(2)
	ShowMVPMessage(iTopKiller, 1)
	
	return PLUGIN_HANDLED
}

// ===============================================================================
// 	Event_AllHostagesRescued - Called when ALL Hostages were rescued
// ===============================================================================

public Event_AllHostagesRescued()
{
	g_bAllHostagesRescued = true
	
	new iTopRescuer = GetTopRescuer()
	ShowMVPMessage(iTopRescuer, 4)	
}

// ===============================================================================
// 	Event_HostageRescued - Called when ONE Hostage was rescued
// ===============================================================================

public Event_HostageRescued()
{
	static szLog[80], szName[32], id
	
	read_logargv(0, szLog, charsmax(szLog))
	parse_loguser(szLog, szName, charsmax(szName))
	
	id = get_user_index(szName)
	
	g_iHostagesRescued[id]++
}	

// ===============================================================================
// 	Event_DeathMsg - Called when someone dies
// ===============================================================================

public Event_DeathMsg()
	g_iEnemiesKilled[read_data(1)]++

// ===============================================================================
// 	bomb_planted - Called when the Bomb was planted
// ===============================================================================

public bomb_planted(iPlanter)
	g_iBombPlanter = iPlanter
	
// ===============================================================================
//  	bomb_explode - Called when the Bomb exploded
// ===============================================================================

public bomb_explode(iPlanter, iDefuser)
{
	g_bBombExploded = true
	ShowMVPMessage(g_iBombPlanter, 3)
}
	
// ===============================================================================
// 	bomb_defused - Called when the Bomb was defused
// ===============================================================================

public bomb_defused(iDefuser)
	g_iBombDefuser = iDefuser
	
// ===============================================================================
// 	GetTopKiller - Returns the id of the player who made the most kills
// ===============================================================================

public GetTopKiller(iTeam) // 1 : Terrorist - 2 : Counter-Terrorists
{
	new iPlayers[32], iPlayersnum;
	
	get_players(iPlayers, iPlayersnum, "e", iTeam == 1 ? "TERRORIST" : "CT")
	SortCustom1D(iPlayers, iPlayersnum, "SortByKills")
	
	return iPlayers[0]
}

public SortByKills(elem1, elem2) 
{
	if ( g_iEnemiesKilled[elem1] > g_iEnemiesKilled[elem2] )
		return -1
	else if ( g_iEnemiesKilled[elem1] < g_iEnemiesKilled[elem2] )
		return 1
	return 0
}

// ===============================================================================
// 	GetTopRescuer - Returns the id of the player who rescued the most hostages
// ===============================================================================

public GetTopRescuer() // 1 : Terrorist - 2 : Counter-Terrorists
{
	new iPlayers[32], iPlayersnum;
	
	get_players(iPlayers, iPlayersnum, "e", "CT")
	SortCustom1D(iPlayers, iPlayersnum, "SortByHostages")
	
	return iPlayers[0]
}

public SortByHostages(elem1, elem2) 
{
	if ( g_iHostagesRescued[elem1] > g_iHostagesRescued[elem2] )
		return -1
	else if ( g_iHostagesRescued[elem1] < g_iHostagesRescued[elem2] )
		return 1
	return 0
}

// ===============================================================================
// 	ShowMVPMessage - Shows the Director HUD Message
// ===============================================================================

public ShowMVPMessage(iMVP, iReason) // 1 : Kills - 2 : Bomb defused - 3 : Bomb exploded - 4 : Hostage rescued
{
	new szMVPName[33]
	get_user_name(iMVP, szMVPName, charsmax(szMVPName))
	
	set_dhudmessage(0, 255, 0, -1.0, 0.15, 0, 6.0, 12.0)
	
	switch(iReason)
	{
	//	case 1: show_dhudmessage(0, "MVP : %s for making the most kills this round.", szMVPName)
	//	case 2: show_dhudmessage(0, "MVP : %s for defusing the Bomb.", szMVPName)
	//	case 3: show_dhudmessage(0, "MVP : %s for planting the Bomb.", szMVPName)
	//	case 4: show_dhudmessage(0, "MVP : %s for rescuing %i Hostages.", szMVPName, g_iHostagesRescued[iMVP])

                case 1: client_print(0, print_chat, "MVP : %s for making the most kills this round.", szMVPName)
		case 2: client_print(0, print_chat, "MVP : %s for defusing the Bomb.", szMVPName)
		case 3: client_print(0, print_chat, "MVP : %s for planting the Bomb.", szMVPName)
		case 4: client_print(0, print_chat, "MVP : %s for rescuing %i Hostages.", szMVPName, g_iHostagesRescued[iMVP])
	}		
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1031\\ f0\\ fs16 \n\\ par }
Post Reply

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

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests