Raised This Month: $51 Target: $400
 12% 

can't compile plugin (pug_cs.sma)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iagopuma
Junior Member
Join Date: May 2011
Old 10-09-2014 , 10:20   can't compile plugin (pug_cs.sma)
Reply With Quote #1

http://i.imgur.com/lVz4yI8.png


this appears when i try to compile this plugin:

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#include <fakemeta>
#include <hamsandwich>

#pragma semicolon 1

#include <pug_const>
#include <pug_stocks>
#include <pug_natives>
#include <pug_forwards>
#include <pug_modspecific>

new g_pForceRestart;
new g_pSwitchDelay;
new g_pAllowShield;
new g_pAllowGrenades;
new g_pAllowKill;

new g_pAllowSpec;

new g_pMpLimitTeams;
new g_pSvRestart;

public plugin_init()
{
	register_plugin("Pug Mod (CS)",AMXX_VERSION_STR,"Twilight Suzuka");
	
	register_dictionary("pug.txt");
	register_dictionary("pug_mod.txt");
	
	g_pForceRestart = register_cvar("pug_force_restart","1");
	g_pSwitchDelay = register_cvar("pug_switch_delay","5.0");
	
	g_pAllowShield = register_cvar("pug_allow_shield","0");
	g_pAllowGrenades = register_cvar("pug_allow_grenades","0");
	g_pAllowKill = register_cvar("pug_allow_kill","1");
	
	g_pAllowSpec = get_cvar_pointer("pug_allow_spectators");
	
	g_pSvRestart = get_cvar_pointer("sv_restart");
	g_pMpLimitTeams = get_cvar_pointer("mp_limitteams");

	register_event("HLTV","ev_HLTV","a","1=0","2=0");
	
	register_event("SendAudio","ev_WonTR","a","2=%!MRAD_terwin");
	register_event("SendAudio","ev_WonCT","a","2=%!MRAD_ctwin");
	register_logevent("ev_RoundEnd",2,"1=Round_End");
	
	register_clcmd("jointeam","PugJoinTeam");
	
	register_menucmd(-2,MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"PugTeamSelect");
	register_menucmd(register_menuid("Team_Select",1),MENU_KEY_1|MENU_KEY_2|MENU_KEY_5|MENU_KEY_6,"PugTeamSelect");
	
	register_forward(FM_ClientKill,"PugFwClientKill",false);
}

public plugin_cfg()
{
	PugRegisterTeam("Terrorists");
	PugRegisterTeam("Counter-Terrorists");
}

public plugin_natives()
{
	register_native("PugGetPlayers","CS_GetPlayers");
	register_native("PugGetPlayersTeam","CS_GetPlayersTeam");
	
	register_native("PugTeamsRandomize","CS_TeamsRandomize");
	register_native("PugTeamsBalance","CS_TeamsBalance");
	register_native("PugTeamsOptmize","CS_TeamsOptmize");
	
	register_native("PugGetClientTeam","CS_GetClientTeam");
	register_native("PugSetClientTeam","CS_SetClientTeam");

	register_native("PugRespawnClient","CS_RespawnClient");
	register_native("PugSetGodMode","CS_SetGodModeClient");
	register_native("PugSetClientMoney","CS_SetClientMoney");
	
	register_native("PugRemoveC4","CS_RemoveC4");
}

public CS_GetClientTeam()
{
	return _:cs_get_user_team(get_param(1));
}	

public CS_SetClientTeam()
{
	cs_set_user_team(get_param(1),_:get_param(2));
}

public CS_RespawnClient()
{
	ExecuteHamB(Ham_CS_RoundRespawn,get_param(1));
}

public CS_SetGodModeClient()
{
	set_pev(get_param(1),pev_takedamage,get_param(2) ? DAMAGE_NO : DAMAGE_AIM);
}

public CS_SetClientMoney()
{
	cs_set_user_money(get_param(1),get_param(2),get_param(3));
}

public CS_RemoveC4()
{
	new iRemove = get_param(1);

	new iEnt = -1;

	while((iEnt = engfunc(EngFunc_FindEntityByString,iEnt,"classname",iRemove ? "func_bomb_target" : "_func_bomb_target")) > 0)
	{
		set_pev(iEnt,pev_classname,iRemove ? "_func_bomb_target" : "func_bomb_target");
	}

	while((iEnt = engfunc(EngFunc_FindEntityByString,iEnt,"classname",iRemove ? "info_bomb_target" : "_info_bomb_target")) > 0)
	{
		set_pev(iEnt,pev_classname,iRemove ? "_info_bomb_target" : "info_bomb_target");
	}
}

public CS_TeamsRandomize()
{
	new iPlayers[32],iNum;
	get_players(iPlayers,iNum,"h");
	
	for(new i;i < iNum;i++)
	{
		if(!(CS_TEAM_T <= cs_get_user_team(iPlayers[i]) <= CS_TEAM_CT))
		{
			iPlayers[i--] = iPlayers[--iNum];
		}
	}
	
	new iPlayer,CsTeams:iTeam = random(2) ? CS_TEAM_T : CS_TEAM_CT;
	
	new iRandom;
	
	while(iNum)
	{
		iRandom = random(iNum);
		
		iPlayer = iPlayers[iRandom];
		
		cs_set_user_team(iPlayer,iTeam);
		
		iPlayers[iRandom] = iPlayers[--iNum];
		
		iTeam = CsTeams:((_:iTeam) % 2 + 1);
	}
	
	if(get_pcvar_num(g_pForceRestart)) set_pcvar_num(g_pSvRestart,1);
}

public CS_TeamsBalance()
{
	new iPlayers[32],iNum,iPlayer;
	get_players(iPlayers,iNum,"h");

	new a,b,aPlayer,bPlayer;
	
	for(new i;i < iNum;i++)
	{
		iPlayer = iPlayers[i];

		switch(cs_get_user_team(iPlayer))
		{
			case 1:
			{
				++a;
				aPlayer = iPlayer;
			}
			case 2:
			{
				++b;
				bPlayer = iPlayer;
			}
		}
	}
	
	if(a == b) 
	{
		return;
	}
	else if((a + 2) == b)
	{
		cs_set_user_team(aPlayer,_:2);
	}
	else if((b + 2) == a)
	{
		cs_set_user_team(bPlayer,_:1);
	}
	else if((a + b) < GET_CVAR_MINPLAYERS())
	{
		a = PugGetTeamScore(1);
		b = PugGetTeamScore(2);

		if(a < b)
		{
			cs_set_user_team(aPlayer,_:1);
		}
		else if(b < a)
		{
			cs_set_user_team(bPlayer,_:2);
		}
	}
}

public CS_TeamsOptmize()
{
	new iSkills[33],iSorted[33];
	
	new iPlayers[32],iNum,iPlayer;
	for(new i;i < iNum;i++)
	{
		iPlayer = iPlayers[i];
		
		iSorted[iPlayer] = iSkills[iPlayer] = (get_user_time(iPlayer,1) / get_user_frags(iPlayer));
	}
	
	SortIntegers(iSorted,sizeof(iSorted),Sort_Descending);

	new iCheck = 1,iTeams = PugNumTeams();
	
	for(new i;i < sizeof(iSorted);i++)
	{
		for(new a;a < iNum;a++)
		{
			iPlayer = iPlayers[a];
			
			if(iSkills[iPlayer] == iSorted[i])
			{
				PugSetClientTeam(iPlayer,iCheck);
				
				iCheck++;
				if(iCheck > iTeams)
				{
					iCheck = 1;
				}
			}
		}
	}
}

public CS_GetPlayers()
{
	new iPlayers[32],iNum,iCount = 0;
	get_players(iPlayers,iNum,"ch");
	
	for(new i;i < iNum;i++)
	{
		if(CS_TEAM_T <= cs_get_user_team(iPlayers[i]) <= CS_TEAM_CT)
		{
			iCount++;
		}
	}
	
	return iCount;
}

public CS_GetPlayersTeam()
{
	new iPlayers[32],iNum,iPlayer,iCount = 0;
	get_players(iPlayers,iNum,"ch");
	
	new iTeam = get_param(1);
	
	for(new i;i < iNum;i++)
	{
		iPlayer = iPlayers[i];
		
		if(is_user_connected(iPlayer) && (get_user_team(iPlayer) == iTeam))
		{
			iCount++;
		}
	}
	
	return iCount;
}

new g_iWhoWon;

public ev_HLTV()
{
	if(GET_PUG_STATUS() == PUG_STATUS_LIVE)
	{
		g_iWhoWon = 0;
		
		PugCallRoundStart();
	}
}

public ev_WonTR()
{
	g_iWhoWon = 1;
}

public ev_WonCT()
{
	g_iWhoWon = 2;
}

public ev_RoundEnd()
{
	if(GET_PUG_STATUS() == PUG_STATUS_LIVE)
	{
		PugCallRoundEnd((g_iWhoWon == -1) ? 0 : g_iWhoWon);
		
		g_iWhoWon = -1;
	}
}

public PugIntermission(GEN_FORW_ID(iForward))
{
	PugSwitchTeams();
}

public PugIntermissionOT(GEN_FORW_ID(iForward))
{
	PugSwitchTeams();
}

public PugSwitchTeams()
{
	set_task(get_pcvar_float(g_pSwitchDelay),"PugSwitchTeamsReally",1337);
}

public PugSwitchTeamsReally()
{
	new iScore = PugGetTeamScore(1);
	PugSetTeamScore(1,PugGetTeamScore(2));
	PugSetTeamScore(2,iScore);

	new iLimitTeams = get_pcvar_num(g_pMpLimitTeams);
	set_pcvar_num(g_pMpLimitTeams,0);

	new iPlayers[32],iNum,iPlayer;
	get_players(iPlayers,iNum,"h");

	for(new i;i < iNum;i++)
	{
		iPlayer = iPlayers[i];

		switch(cs_get_user_team(iPlayer))
		{
			case CS_TEAM_T: cs_set_user_team(iPlayer,CS_TEAM_CT);
			case CS_TEAM_CT: cs_set_user_team(iPlayer,CS_TEAM_T);
		}
	}

	set_pcvar_num(g_pMpLimitTeams,iLimitTeams);
	
	if(get_pcvar_num(g_pForceRestart)) set_pcvar_num(g_pSvRestart,1);
}

public PugJoinTeam(id) 
{
	new sArg[3];
	read_argv(1,sArg,charsmax(sArg));

	return PugCheckTeam(id,str_to_num(sArg));
}

public PugTeamSelect(id,iKey) return PugCheckTeam(id,iKey + 1);

public PugCheckTeam(id,iTeamNew) 
{
	new iTeam = get_user_team(id);
	
	if((GET_PUG_STATUS() == PUG_STATUS_LIVE) || (PUG_STAGE_FIRSTHALF <= GET_PUG_STAGE() <= PUG_STAGE_OVERTIME))
	{
		if((iTeam == 1) || (iTeam == 2))
		{
			client_print_color
			(
				id,
				print_team_grey,
				"^4%s^1 %L",
				g_sHead,
				LANG_SERVER,
				"PUG_SELECTTEAM_NOSWITCH"
			);
			
			return PLUGIN_HANDLED;
		}
	}
	
	if(iTeam == iTeamNew)
	{
		client_print_color
		(
			id,
			print_team_grey,
			"^4%s^1 %L",
			g_sHead,
			LANG_SERVER,
			"PUG_SELECTTEAM_SAMETEAM"
		);
		
		return PLUGIN_HANDLED;
	}
	
	switch(iTeamNew)
	{
		case 1,2:
		{
			new iMaxPlayers = (GET_CVAR_MAXPLAYERS() / 2);
			
			new iPlayers[32],iNum[CsTeams];
			get_players(iPlayers,iNum[CS_TEAM_T],"eh","TERRORIST");
			get_players(iPlayers,iNum[CS_TEAM_CT],"eh","CT");
			
			if((iNum[CS_TEAM_T] >= iMaxPlayers) && (iTeamNew == 1))
			{
				client_print_color
				(
					id,
					print_team_grey,
					"^4%s^1 %L",
					g_sHead,
					LANG_SERVER,
					"PUG_SELECTTEAM_TEAMFULL"
				);
				
				return PLUGIN_HANDLED;
			}
			else if((iNum[CS_TEAM_CT] >= iMaxPlayers) && (iTeamNew == 2))
			{
				client_print_color
				(
					id,
					print_team_grey,
					"^4%s^1 %L",
					g_sHead,
					LANG_SERVER,
					"PUG_SELECTTEAM_TEAMFULL"
				);
				
				return PLUGIN_HANDLED;
			}
		}
		case 5:
		{
			client_print_color
			(
				id,
				print_team_grey,
				"^4%s^1 %L",
				g_sHead,
				LANG_SERVER,
				"PUG_SELECTTEAM_NOAUTO"
			);
			
			return PLUGIN_HANDLED;
		}
		case 6:
		{
			if(!access(id,PUG_CMD_LVL) && !get_pcvar_num(g_pAllowSpec))
			{
				client_print_color
				(
					id,
					print_team_grey,
					"^4%s^1 %L",
					g_sHead,
					LANG_SERVER,
					"PUG_SELECTTEAM_NOSPC"
				);
				
				return PLUGIN_HANDLED;
			}
		}
	}

	return PLUGIN_CONTINUE;
}

public CS_OnBuy(id,iWeapon)
{
	switch(iWeapon)
	{
		case CSI_HEGRENADE,CSI_FLASHBANG,CSI_SMOKEGRENADE:
		{
			if(GET_PUG_STATUS() != PUG_STATUS_LIVE)
			{
				return !get_pcvar_num(g_pAllowGrenades);
			}
		}
		case CSI_SHIELDGUN:
		{
			return !get_pcvar_num(g_pAllowShield);
		}
	}
	
	return PLUGIN_CONTINUE;
}

public PugFwClientKill(id)
{
	if(is_user_alive(id) && !get_pcvar_num(g_pAllowKill))
	{
		console_print(id,"%s %L",g_sHead,LANG_PLAYER,"PUG_CMD_NOTALLOWED");
		
		return FMRES_SUPERCEDE;
	}
	
	return FMRES_IGNORED;
}

you know how to help me? that topic is correct? thank you
iagopuma is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-09-2014 , 10:28   Re: can't compile plugin (pug_cs.sma)
Reply With Quote #2

You need to compile locally and add this files into your include folder:
pug_const
pug_stocks
pug_natives
pug_forwards
pug_modspecific
__________________

Last edited by HamletEagle; 10-09-2014 at 10:28.
HamletEagle is offline
iagopuma
Junior Member
Join Date: May 2011
Old 10-09-2014 , 10:33   Re: can't compile plugin (pug_cs.sma)
Reply With Quote #3

i've all of this



pug_captains
pug_const
pug_forwards
pug_menu
pug_modspecific
pug_natives
pug_ready
pug_stocks


maybe I need to change something in this included files?


edit:
when i trade CSI_HEGRENADE,CSI_FLASHBANG,CSI_SMOKEGRENADE by CSW_HEGRENADE, the errors disappear, buy continues the second error on console

Last edited by iagopuma; 10-09-2014 at 10:37.
iagopuma is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 10-09-2014 , 10:36   Re: can't compile plugin (pug_cs.sma)
Reply With Quote #4

Post your includes....
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
iagopuma
Junior Member
Join Date: May 2011
Old 10-09-2014 , 10:48   Re: can't compile plugin (pug_cs.sma)
Reply With Quote #5

pug_captains
Code:
#if defined _pug_captains_included
	#endinput
#endif
#define _pug_captains_included

#define TASK_HUDLIST 6676

new g_iCaptain[2];

public PugTeamsCaptains()
{
	new iPlayers[32],iNum;
	get_players(iPlayers,iNum,"h");
	
	new iPlayer,sName[2][32],sTeam[2][32];
	
	if(iNum > 4)
	{
		arrayset(g_iCaptain,0,sizeof(g_iCaptain));
		
		for(new i;i < iNum;i++)
		{
			iPlayer = iPlayers[i];
			
			if(!g_iCaptain[0])
			{
				g_iCaptain[0] = iPlayer;
				get_user_name(iPlayer,sName[0],charsmax(sName[]));
				
				PugSetClientTeam(iPlayer,1);
				PugGetTeamName(1,sTeam[0]);
				
				continue;
			}
			
			if(!g_iCaptain[1])
			{
				g_iCaptain[1] = iPlayer;
				get_user_name(iPlayer,sName[1],charsmax(sName[]));
				
				PugSetClientTeam(iPlayer,2);
				PugGetTeamName(2,sTeam[1]);
				
				continue;
			}
			
			user_silentkill(iPlayer);
			PugSetClientTeam(iPlayer,3);
		}
		
		set_cvar_num("sv_restart",1);
		set_task(0.5,"PugCaptainHud",TASK_HUDLIST, .flags="b");
		set_task(2.0,"PugCaptainMenu",g_iCaptain[random_num(0,1)]);
		
		client_print_color(0,print_team_grey,"^4%s^1 %L",g_sHead,LANG_SERVER,"PUG_CAPTAINS_ARE",sName[0],sTeam[0],sName[1],sTeam[1]);
	}
	else
	{
		client_print_color(0,print_team_grey,"^4%s^1 %L",g_sHead,LANG_SERVER,"PUG_CAPTAINS_MIN");
		
		ContinueGenForward(Fw_PugFirstHalf);
	}
}

public PugCaptainMenu(id)
{
	if(!is_user_connected(id))
	{
		new iPlayers[32],iNum,iPlayer;
		get_players(iPlayers,iNum,"eh","SPECTATOR");
		
		iPlayer = iPlayers[random(iNum)];
		
		new sName[32];
		get_user_name(iPlayer,sName,charsmax(sName));
		
		new sTeam[32];
	
		if(id == g_iCaptain[0])
		{
			g_iCaptain[0] = iPlayer;
			
			PugSetClientTeam(iPlayer,1);
			PugGetTeamName(1,sTeam);
		}
		else if(id == g_iCaptain[1])
		{
			g_iCaptain[1] = iPlayer;
			
			PugSetClientTeam(iPlayer,2);
			PugGetTeamName(2,sTeam);
		}
		
		client_print_color(0,print_team_grey,"^4%s^1 %L",g_sHead,LANG_SERVER,"PUG_CAPTAIN_NEW",sTeam,sName);
		
		set_task(2.0,"PugCaptainMenu",iPlayer);
		
		return;
	}
	
	new iPlayers[32],iNum;
	get_players(iPlayers,iNum,"eh","SPECTATOR");
	
	if(iNum)
	{
		if(is_user_bot(id)) PugCaptainAutoPick(id);
		
		else
		{
			PugCancelMenuClient(id);
			
			new iMenu = menu_create("Spectators:","PugMenuCaptainHandler",1);
			
			new iPlayer,sName[32],sNum[3];
			
			for(new i;i < iNum;i++)
			{
				iPlayer = iPlayers[i];
				
				num_to_str(iPlayer,sNum,charsmax(sNum));
				get_user_name(iPlayer,sName,charsmax(sName));
				
				menu_additem(iMenu,sName,sNum);
			}
			
			menu_setprop(iMenu,MPROP_EXIT,MEXIT_NEVER);
			
			PugDisplayMenuSingle(id,iMenu);
			
			set_task(10.0,"PugCaptainAutoPick",id);
		}
	}
	else
	{
		remove_task(TASK_HUDLIST);
		ContinueGenForward(Fw_PugFirstHalf);
	}
}

public PugMenuCaptainHandler(id,iMenu,iKey)
{
	if(iKey != MENU_EXIT)
	{
		new iAccess,sData[3],sOption[32],iBack;
		menu_item_getinfo(iMenu,iKey,iAccess,sData,charsmax(sData),sOption,charsmax(sOption),iBack);
		
		new iPlayer = str_to_num(sData);
		
		if(is_user_connected(iPlayer) && is_user_connected(id))
		{
			remove_task(id);
			
			PugSetClientTeam(iPlayer,PugGetClientTeam(id));
			PugRespawnClient(iPlayer);
			
			new sName[2][32];
			get_user_name(id,sName[0],charsmax(sName[]));
			get_user_name(iPlayer,sName[1],charsmax(sName[]));
			
			client_print_color(0,print_team_grey,"^4%s^1 %L",g_sHead,LANG_SERVER,"PUG_VOTE_CHOOSED",sName[0],sName[1]);
		}
		
		set_task(2.0,"PugCaptainMenu",(id == g_iCaptain[0]) ? g_iCaptain[1] : g_iCaptain[0]);
	}
	
	return PLUGIN_HANDLED;
}

public PugCaptainAutoPick(id)
{
	PugCancelMenuClient(id);
	
	new iPlayers[32],iNum;
	get_players(iPlayers,iNum,"eh","SPECTATOR");
	
	if(iNum)
	{
		new iPlayer = iPlayers[random(iNum)];
		
		if(is_user_connected(iPlayer) && is_user_connected(id))
		{
			PugSetClientTeam(iPlayer,PugGetClientTeam(id));
			PugRespawnClient(iPlayer);
			
			new sName[2][32];
			get_user_name(id,sName[0],charsmax(sName[]));
			get_user_name(iPlayer,sName[1],charsmax(sName[]));
			
			client_print_color(0,print_team_grey,"^4%s^1 %L",g_sHead,LANG_SERVER,"PUG_VOTE_CHOOSED",sName[0],sName[1]);
		}
		
		set_task(2.0,"PugCaptainMenu",(id == g_iCaptain[0]) ? g_iCaptain[1] : g_iCaptain[0]);
	}
	else
	{
		remove_task(TASK_HUDLIST);
		ContinueGenForward(Fw_PugFirstHalf);
	}
}

#include <pug_natives>

public PugCaptainHud()
{
	new sTRs[512],sCTs[512],sName[32];
	
	new iPlayers[32],iNum,iPlayer;
	get_players(iPlayers,iNum,"h");
	
	for(new i;i < iNum;i++)
	{
		iPlayer = iPlayers[i];
		
		get_user_name(iPlayer,sName,charsmax(sName));
		
		if(g_iCaptain[0] == iPlayer || g_iCaptain[1] == iPlayer)
		{
			format(sName,charsmax(sName),"%s (C)",sName);
		}
		
		switch(PugGetClientTeam(iPlayer))
		{
			case 1:
			{
				format(sTRs,charsmax(sTRs),"%s%s^n",sTRs,sName);
			}
			case 2:
			{
				format(sCTs,charsmax(sCTs),"%s%s^n",sCTs,sName);
			}
		}
	}
	
	static sTeam[2][32];
	PugGetTeamName(1,sTeam[0]);
	PugGetTeamName(2,sTeam[1]);
	
	set_hudmessage(255,0,0,0.23,0.02,0,0.0,0.6,0.0,0.0,1);
	show_hudmessage(0,"%s:",sTeam[0]);

	set_hudmessage(255,255,255,0.23,0.05,0,0.0,0.6,0.0,0.0,2);
	show_hudmessage(0,sTRs);

	set_hudmessage(0,0,255,0.58,0.02,0,0.0,0.6,0.0,0.0,3);
	show_hudmessage(0,"%s:",sTeam[1]);

	set_hudmessage(255,255,255,0.58,0.05,0,0.0,0.6,0.0,0.0,4);
	show_hudmessage(0,sCTs);
}

pug_const
Code:
#if defined _pug_const_included
	#endinput
#endif
#define _pug_const_included

#include <amxmodx>

#pragma semicolon 1

#define PUG_CMD_LVL ADMIN_LEVEL_A

#define PUG_MAX_TEAMS 32
#define PUG_MIN_PLAYERS 5

#define PUG_STATUS_LIVE 0
#define PUG_STATUS_CLEAR 0
#define PUG_STATUS_DEAD (1<<0)
#define PUG_STATUS_WAITING (1<<1)
#define PUG_STATUS_PAUSED (1<<2)
#define PUG_STATUS_UNPAUSED (1<<3)

#define get_x_var(%0) (get_xvar_num(get_xvar_id(%0)))
#define set_x_var(%0,%1) (set_xvar_num(get_xvar_id(%0),%1))

#define GET_PUG_STATUS() get_x_var("g_iStatus")
#define SET_PUG_STATUS(%0) set_x_var("g_iStatus",%0)

stock ADD_PUG_STATUS(iStatus)
{
	do
	{
		new id = get_xvar_id("g_iStatus");
		set_xvar_num(id,get_xvar_num(id) | iStatus);
	}
	while(0)
}

stock REMOVE_PUG_STATUS(iStatus)
{
	do
	{
		new id = get_xvar_id("g_iStatus");
		set_xvar_num(id,get_xvar_num(id) & ~iStatus);
	}
	while(0)
}

enum _:PugStage
{
	PUG_STAGE_WAITING = 0,
	PUG_STAGE_READY,
	PUG_STAGE_START,
	PUG_STAGE_FIRSTHALF,
	PUG_STAGE_INTERMISSION,
	PUG_STAGE_SECONDHALF,
	PUG_STAGE_OVERTIME,
	PUG_STAGE_END
};

stock const g_sStage[PugStage][] =
{
	"Waiting",
	"Readying",
	"Starting",
	"First Half",
	"Intermission",
	"Second Half",
	"Overtime",
	"Finished"
};

#define GET_PUG_STAGE() get_x_var("g_iStage")
#define SET_PUG_STAGE(%0) set_x_var("g_iStage",%0)

#define GET_PUG_ROUND() get_x_var("g_iRounds")

#define GET_CVAR_TOTAL_ROUNDS() get_pcvar_num(get_x_var("g_pMaxRounds"))
#define GET_CVAR_OT_ROUNDS() get_pcvar_num(get_x_var("g_pMaxOTRounds"))

#define GET_CVAR_MAXPLAYERS() get_pcvar_num(get_x_var("g_pMaxPlayers"))
#define SET_CVAR_MAXPLAYERS(%0) set_cvar_num("g_pMaxPlayers",%0)

#define GET_CVAR_MINPLAYERS() get_pcvar_num(get_x_var("g_pMinPlayers"))
#define SET_CVAR_MINPLAYERS(%0) set_cvar_num("g_pMinPlayers",%0)

stock PugGetConfigsDir(sName[],iLen)
{
	get_localinfo("amxx_configsdir",sName,iLen);
	
	format(sName,iLen,"%s/pug-config",sName);
}

stock g_sHead[] = "[PUG]";

pug_forwards
Code:
#if defined _pug_forwards_included
	#endinput
#endif
#define _pug_forwards_included

#include <gen_forw_stocks>

forward PugPreStart(GEN_FORW_ID(iForward));
forward PugFirstHalf(GEN_FORW_ID(iForward));
forward PugIntermission(GEN_FORW_ID(iForward));
forward PugSecondHalf(GEN_FORW_ID(iForward));
forward PugIntermissionOT(GEN_FORW_ID(iForward));
forward PugOvertime(GEN_FORW_ID(iForward));

forward PugAllReady(GEN_FORW_ID(iForward));

forward PugRoundStart();
forward PugRoundStartFailed();

forward PugRoundEnd(iWinner);
forward PugRoundEndFailed();

forward PugWinner(iWinner);
forward PugFinished();

pug_menu
Code:
#if defined _pug_menu_included
	#endinput
#endif
#define _pug_menu_included

stock bool:g_bVoted[33];
stock g_iMenuTemp[33];

stock GET_PUG_VOTING()
{
	if(xvar_exists("g_bVoting"))
	{
		return get_xvar_num(get_xvar_id("g_bVoting"));
	}
	
	return 0;
}

stock PugDisplayMenuAll(iMenu)
{
	new iPlayers[32],iNum,iPlayer;
	get_players(iPlayers,iNum,"ch");
	
	for(new i;i < iNum;i++) 
	{
		iPlayer = iPlayers[i];
		
		g_iMenuTemp[iPlayer] = iMenu;
		
		PugDisplayMenuClient(iPlayer);
	}
}

stock PugDisplayMenuSingle(id,iMenu)
{
	g_iMenuTemp[id] = iMenu;
	
	PugDisplayMenuClient(id);
}

public PugDisplayMenuClient(id)
{
	new iMenu,iKeys;
	new iMenuUP = player_menu_info(id,iMenu,iKeys);

	if((iMenuUP <= 0) || (iMenu < 0))
	{
		menu_display(id,g_iMenuTemp[id],0);
	}
	else set_task(1.0,"PugDisplayMenuClient",id);
}

stock PugCancelMenu()
{
	new iPlayers[32],iNum;
	get_players(iPlayers,iNum,"ch");
	
	for(new i;i < iNum;i++) 
	{
		menu_cancel(iPlayers[i]);
	}
	
	show_menu(0,0,"^n",1);
}

stock PugCancelMenuClient(id)
{
	menu_cancel(id);
	show_menu(id,0,"^n",1);
}

stock bool:PugShoudStopVote()
{
	new iPlayers[32],iNum;
	get_players(iPlayers,iNum,"ch");
	
	for(new i;i < iNum;i++) 
	{
		if(!g_bVoted[iPlayers[i]])
		{
			return false;
		}
	}

	return true;
}

pug_modspecific
Code:
#if defined _pug_modspecific_included
  #endinput
#endif
#define _pug_modspecific_included

native PugGetPlayers();
native PugGetPlayersTeam(iTeam);

native PugTeamsRandomize();
native PugTeamsBalance();
native PugTeamsOptmize();

native PugGetClientTeam(id);
native PugSetClientTeam(id,iTeam);

native PugRespawnClient(id);
native PugSetGodMode(id,iGodMode);
native PugSetClientMoney(id,iMoney,iFlash);

native PugRemoveC4(iRemove);

pug_natives
Code:
#if defined _pug_natives_included
	#endinput
#endif
#define _pug_natives_included

#include <amxconst>

native PugPause();
native PugUnPause();
native PugSetPauseCall(iFunctionID,iPluginID = INVALID_PLUGIN_ID);

native PugCallRoundStart();
native PugCallRoundEnd(iWinner);

native PugCallReset();

native PugSwapTeams(iTeamA,iTeamB);
native PugRegisterTeam(sTeam[]);
native PugNumTeams();

native PugGetTeamName(iTeam,sName[32]);
native PugSetTeamName(iTeam,sName[32]);

native PugSetTeamScore(iTeam,iScore);
native PugGetTeamScore(iTeam);

pug_ready
Code:
#if defined _pug_ready_included
  #endinput
#endif
#define _pug_ready_included

native PugNativeReadyPlayers(iFunctionID,iPluginID = -1);
native PugNativeRegisterReadyDisPlay(iFunctionID,iPluginID = -1);

pug_stocks
Code:
#if defined _pug_stocks_included
	#endinput
#endif
#define _pug_stocks_included

#include <pug_const>

#pragma semicolon 1

stock PugMessage(id,sLang[])
{
	if(!id) server_print("%s %L",g_sHead,LANG_SERVER,sLang);
	
	client_print_color
	(
		id,
		print_team_grey,
		"^4%s^1 %L",
		g_sHead,
		(id == 0) ? LANG_SERVER : LANG_PLAYER,
		sLang
	);
	
	return PLUGIN_HANDLED;
}

stock PugRegisterCommand(const sCommand[],const sFunction[],iFlags = 0,const sInfo[]="")
{
	static sBuffer[16];
	formatex(sBuffer,charsmax(sBuffer),".%s",sCommand);
	
	register_clcmd(sBuffer,sFunction,iFlags,sInfo);
}

stock PugRegisterAdminCommand(const sCommand[],const sFunction[],iFlags = 0,const sInfo[]="")
{
	static sBuffer[16];
	formatex(sBuffer,charsmax(sBuffer),"!%s",sCommand);
	
	register_concmd(sBuffer,sFunction,iFlags,sInfo);
}

stock PugAdminCommand(id,sCommand[],sLang[],iCheck)
{
	if(iCheck)
	{
		new sName[32];
		get_user_name(id,sName,charsmax(sName));

		client_print_color(0,print_team_grey,"^4%s^1 %L",g_sHead,LANG_SERVER,sLang,sName);
	}
	
	client_print_color(id,print_team_grey,"^4%s^1 %L",g_sHead,LANG_PLAYER,iCheck ? "PUG_CMD_SUCCESS" : "PUG_CMD_FAILURE",sCommand);
}

stock PugAdminCommandClient(id,sCommand[],sLang[],iClient,iCheck)
{
	if(iCheck)
	{
		new sName[32];
		get_user_name(iClient,sName,charsmax(sName));
		
		client_print_color(0,print_team_grey,"^4%s^1 %L",g_sHead,LANG_SERVER,sLang,sName);
	}
	
	client_print_color(id,print_team_grey,"^4%s^1 %L",g_sHead,LANG_PLAYER,iCheck ? "PUG_CMD_SUCCESS" : "PUG_CMD_FAILURE",sCommand);
}

stock PugDisconnect(const id,const sReason[] = "",any:...)
{
	if(sReason[0])
	{
		new sMessage[192];
		vformat(sMessage,charsmax(sMessage),sReason,3);

		message_begin(MSG_ONE_UNRELIABLE,SVC_DISCONNECT,{0,0,0},id);
		write_string(sMessage);
		message_end();
	}
	else server_cmd("kick #%i",get_user_userid(id));
}


like this?
iagopuma is offline
Old 10-09-2014, 15:54
iagopuma
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Old 10-10-2014, 01:30
iagopuma
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
Old 10-10-2014, 15:31
iagopuma
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 10-10-2014 , 16:35   Re: can't compile plugin (pug_cs.sma)
Reply With Quote #6

That plugin requires AMXX 1.8.3+
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
iagopuma
Junior Member
Join Date: May 2011
Old 10-10-2014 , 18:11   Re: can't compile plugin (pug_cs.sma)
Reply With Quote #7

ooh thank you, thats ok now!



you know why sometimes appears "ML_NOT_FOUND" in the chat? when I send .ready by example
iagopuma is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 10-13-2014 , 02:19   Re: can't compile plugin (pug_cs.sma)
Reply With Quote #8

Quote:
Originally Posted by iagopuma View Post
ooh thank you, thats ok now!



you know why sometimes appears "ML_NOT_FOUND" in the chat? when I send .ready by example
you need the language files that should come with the plugin in amxmodx/data/lang
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
iagopuma
Junior Member
Join Date: May 2011
Old 10-13-2014 , 09:36   Re: can't compile plugin (pug_cs.sma)
Reply With Quote #9

Quote:
Originally Posted by aron9forever View Post
you need the language files that should come with the plugin in amxmodx/data/lang
I understand, i solve this! the problem is because i have just pt-br language in the files, now i add "en" version and everything is ok!
iagopuma 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 19:28.


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