/ak[Rezolvat]

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
User avatar
NemeSyS17
Membru, skill +1
Membru, skill +1
Posts: 307
Joined: 05 Apr 2017, 00:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

21 Mar 2019, 05:36

Plugin Cerut: /ak
Descriere (adica ce face el mai exact): vreau ca a atunci cand cei de la CT scriu /ak sa cumpere ak47 gold ! , sa aibe cvar pentru pret !
vreau doar ct sa poata cumpara ak47 gold ! vreau ca ak47 gold sa aibe model + DMG x2!
si urmatoarele mesaje in chat
[FR] Ai cumparat AK47 Gold.
[FR] Ai prea putini bani sa cumperi AK47 Gold , iti trebuie %cvar-ul.
[FR] Esti Furien , nu poti cumpara AK47 Gold.
Serverul ruleaza (HLDS/ReHLDS): REHLDS
Versiune AMX Mod X: -
Modul Serverului: Furien!

PS : nu-mi dati pluginul de pe allied ca nu e cea ce vreau ! si nu merge acel plugin bine !
Last edited by Rainq on 21 Mar 2019, 12:29, edited 1 time in total.
RoyalServer
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 11:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times

21 Mar 2019, 10:24

Daca ai modele cu p_ stergi comentariile. ( "//")
Netestat | Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>

#define VIP	ADMIN_LEVEL_H
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

enum Color
{
	NORMAL = 1, 	
	GREEN, 		
	TEAM_COLOR, 		
	GREY, 		
	RED, 	
	BLUE, 
};

new TeamName[  ][  ] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

new g_iMaxPlayers;

new const Ak47Model[66] = "models/v_ak.mdl";
//new const pAk47Model[66] = "models/p_ak.mdl";

new bool: AK47[33];

new cost;

public plugin_init() {
	register_plugin("Gold Ak", "1.0", "Truth*");
	
	register_clcmd("say /ak","WeaponsSaid");
	
	cost = register_cvar("cost_ak", "9000");
	
	register_event("CurWeapon", "CurentWeapon", "be", "1=1");
	RegisterHam(Ham_Spawn, "player", "Spawn", 1);
	
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	g_iMaxPlayers = get_maxplayers ( 	);	
}

public Spawn(id) {
	if(is_user_alive(id)) {
		if(!(get_user_flags(id) & VIP)) {
			AK47[id] = false;
		}
	}
}

public plugin_precache() {
	precache_model(Ak47Model);
	//precache_model(pAk47Model);
}


public CurentWeapon(id) {
	
	if(AK47[id] && get_user_weapon(id) == CSW_AK47)
		set_pev(id, pev_viewmodel2, Ak47Model);
		//set_pev(id, pev_weaponmodel2, pAk47Model);
	
}

public WeaponsSaid(id) {
	if(!(get_user_flags(id) & VIP)) {
		ColorChat(id, GREEN, "!g[FR]!n Acest meniu poate fi accesat doar de cei cu VIP.");
		return;
	}
	else if(cs_get_user_team(id) != CS_TEAM_CT) {
		ColorChat(id, GREEN, "[FR] Esti Furien , nu poti cumpara AK47 Gold.");
		return;
	}
	else if(get_pcvar_num(cost) > cs_get_user_money(id))  {
		ColorChat(id, GREEN, "[FR] Ai prea putini bani sa cumperi AK47 Gold , iti trebuie %d.", get_pcvar_num(cost));
		return;
	}
	else
	{
		fm_give_item(id, "weapon_ak47");
		cs_set_user_bpammo(id, CSW_AK47, 90);
		AK47[id] = true;
		CurentWeapon(id);
		ColorChat(id, GREEN, "[FR] Ai cumparat AK47 Gold.");
		cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cost));
	}
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )  {
	if ( IsPlayer ( iAttacker ) ) {
		if( iInflictor == iAttacker && AK47 [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_AK47) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
	}
	
	return HAM_IGNORED;
}

stock ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		default: 	szMessage[ 0 ] = 0x03;
	}

	vformat(  szMessage[ 1 ], 251, msg, 4  );

	szMessage[ 192 ] = '^0';
	

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;
	
	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer(  );
		MSG_Type = MSG_ALL;
	}
	
	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );
		
	if(  iColorChange  )	CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );

}

stock CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
	
	static bool:bSayTextUsed;
	static iMsgSayText;
	
	if(  !bSayTextUsed  )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}
	
	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  )		
	write_string(  szMessage  );
	message_end(  );
}

stock CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}
	
	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte(  id  );
	write_string(  szTeam  );
	message_end(  );

	return 1;
}

stock CC_ColorSelection(  id, const iType, Color:iColorType)
{
	switch(  iColorType  )
	{
		
		case RED:	return CC_Team_Info(  id, iType, TeamName[ 1 ]  );
		case BLUE:	return CC_Team_Info(  id, iType, TeamName[ 2 ]  );
		case GREY:	return CC_Team_Info(  id, iType, TeamName[ 0 ]  );

	}

	return 0;
}

stock CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
User avatar
NemeSyS17
Membru, skill +1
Membru, skill +1
Posts: 307
Joined: 05 Apr 2017, 00:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

21 Mar 2019, 15:29

il poti face in asa fel sa l cumpere toti de la CT , nu doar cei VIP , toti playerii si doar la CT !
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 11:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times

23 Mar 2019, 21:33

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>


#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

enum Color
{
	NORMAL = 1, 	
	GREEN, 		
	TEAM_COLOR, 		
	GREY, 		
	RED, 	
	BLUE, 
};

new TeamName[  ][  ] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

new g_iMaxPlayers;

new const Ak47Model[66] = "models/v_ak.mdl";
//new const pAk47Model[66] = "models/p_ak.mdl";

new bool: AK47[33];

new cost;

public plugin_init() {
	register_plugin("Gold Ak", "1.0", "Truth*");
	
	register_clcmd("say /ak","WeaponsSaid");
	
	cost = register_cvar("cost_ak", "9000");
	
	register_event("CurWeapon", "CurentWeapon", "be", "1=1");
	RegisterHam(Ham_Spawn, "player", "Spawn", 1);
	
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	g_iMaxPlayers = get_maxplayers ( 	);	
}

public Spawn(id) {
	if(is_user_alive(id)) {
		if(cs_get_user_team(id) != CS_TEAM_CT) {
			AK47[id] = false;
		}
	}
}

public plugin_precache() {
	precache_model(Ak47Model);
	//precache_model(pAk47Model);
}


public CurentWeapon(id) {
	
	if(AK47[id] && get_user_weapon(id) == CSW_AK47)
		set_pev(id, pev_viewmodel2, Ak47Model);
		//set_pev(id, pev_weaponmodel2, pAk47Model);
	
}

public WeaponsSaid(id) {
	if(cs_get_user_team(id) != CS_TEAM_CT) {
		ColorChat(id, GREEN, "[FR] Esti Furien , nu poti cumpara AK47 Gold.");
		return;
	}
	else if(get_pcvar_num(cost) > cs_get_user_money(id))  {
		ColorChat(id, GREEN, "[FR] Ai prea putini bani sa cumperi AK47 Gold , iti trebuie %d.", get_pcvar_num(cost));
		return;
	}
	else
	{
		fm_give_item(id, "weapon_ak47");
		cs_set_user_bpammo(id, CSW_AK47, 90);
		AK47[id] = true;
		CurentWeapon(id);
		ColorChat(id, GREEN, "[FR] Ai cumparat AK47 Gold.");
		cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cost));
	}
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )  {
	if ( IsPlayer ( iAttacker ) ) {
		if( iInflictor == iAttacker && AK47 [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_AK47) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
	}
	
	return HAM_IGNORED;
}

stock ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		default: 	szMessage[ 0 ] = 0x03;
	}

	vformat(  szMessage[ 1 ], 251, msg, 4  );

	szMessage[ 192 ] = '^0';
	

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;
	
	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer(  );
		MSG_Type = MSG_ALL;
	}
	
	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );
		
	if(  iColorChange  )	CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );

}

stock CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
	
	static bool:bSayTextUsed;
	static iMsgSayText;
	
	if(  !bSayTextUsed  )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}
	
	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  )		
	write_string(  szMessage  );
	message_end(  );
}

stock CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}
	
	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte(  id  );
	write_string(  szTeam  );
	message_end(  );

	return 1;
}

stock CC_ColorSelection(  id, const iType, Color:iColorType)
{
	switch(  iColorType  )
	{
		
		case RED:	return CC_Team_Info(  id, iType, TeamName[ 1 ]  );
		case BLUE:	return CC_Team_Info(  id, iType, TeamName[ 2 ]  );
		case GREY:	return CC_Team_Info(  id, iType, TeamName[ 0 ]  );

	}

	return 0;
}

stock CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
User avatar
NemeSyS17
Membru, skill +1
Membru, skill +1
Posts: 307
Joined: 05 Apr 2017, 00:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

24 Mar 2019, 02:38

mersi truth , functioneaza perfect!
User avatar
NemeSyS17
Membru, skill +1
Membru, skill +1
Posts: 307
Joined: 05 Apr 2017, 00:42
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 6 times
Been thanked: 2 times
Contact:

24 Mar 2019, 10:30

Truth , are totusi o problema pluginul , daca de ex iau ak intr o runda , si in runda aia mor , la urmatoarea runda inca am ak gold gen ...,il poti face cand mori sa nu mai ai tot ak47 gols , sa trebuiasca sal cumperi dinou cu 6k
User avatar
Truth*
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 766
Joined: 11 Oct 2013, 11:08
Detinator Steam: Da
SteamID: Ezeru
Reputatie: Fost moderator ajutator
Membru Club eXtreamCS (4 luni)
Nume anterior: HyperioN.
Scripter eXtreamCS
0.2 / 3
Fond eXtream: 0
Location: Sibiu
Has thanked: 44 times
Been thanked: 122 times

24 Mar 2019, 12:31

| Afiseaza codul
#include <amxmodx>
#include <cstrike>
#include <fakemeta_util>
#include <hamsandwich>


#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

enum Color
{
	NORMAL = 1, 	
	GREEN, 		
	TEAM_COLOR, 		
	GREY, 		
	RED, 	
	BLUE, 
};

new TeamName[  ][  ] = 
{
	"",
	"TERRORIST",
	"CT",
	"SPECTATOR"
};

new g_iMaxPlayers;

new const Ak47Model[66] = "models/v_ak.mdl";
//new const pAk47Model[66] = "models/p_ak.mdl";

new bool: AK47[33];

new cost;

public plugin_init() {
	register_plugin("Gold Ak", "1.0", "Truth*");
	
	register_clcmd("say /ak","WeaponsSaid");
	
	cost = register_cvar("cost_ak", "9000");
	
	register_event("CurWeapon", "CurentWeapon", "be", "1=1");
	RegisterHam(Ham_Spawn, "player", "Spawn", 1);
	
	RegisterHam ( Ham_TakeDamage, "player", "Player_TakeDamage" );
	g_iMaxPlayers = get_maxplayers ( 	);	
}

public Spawn(id) {
	if(is_user_alive(id)) {
			AK47[id] = false;
	}
}

public plugin_precache() {
	precache_model(Ak47Model);
	//precache_model(pAk47Model);
}


public CurentWeapon(id) {
	
	if(AK47[id] && get_user_weapon(id) == CSW_AK47)
		set_pev(id, pev_viewmodel2, Ak47Model);
		//set_pev(id, pev_weaponmodel2, pAk47Model);
	
}

public WeaponsSaid(id) {
	if(cs_get_user_team(id) != CS_TEAM_CT) {
		ColorChat(id, GREEN, "[FR] Esti Furien , nu poti cumpara AK47 Gold.");
		return;
	}
	else if(get_pcvar_num(cost) > cs_get_user_money(id))  {
		ColorChat(id, GREEN, "[FR] Ai prea putini bani sa cumperi AK47 Gold , iti trebuie %d.", get_pcvar_num(cost));
		return;
	}
	else
	{
		fm_give_item(id, "weapon_ak47");
		cs_set_user_bpammo(id, CSW_AK47, 90);
		AK47[id] = true;
		CurentWeapon(id);
		ColorChat(id, GREEN, "[FR] Ai cumparat AK47 Gold.");
		cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cost));
	}
}

public Player_TakeDamage ( iVictim, iInflictor, iAttacker, Float:fDamage, iDamageBits )  {
	if ( IsPlayer ( iAttacker ) ) {
		if( iInflictor == iAttacker && AK47 [ iAttacker ] && is_user_alive( iAttacker ) && get_user_weapon( iAttacker ) == CSW_AK47) {
			SetHamParamFloat( 4, fDamage * 2.0);
			return HAM_HANDLED;
		}
	}
	
	return HAM_IGNORED;
}

stock ColorChat(  id, Color:iType, const msg[  ], { Float, Sql, Result, _}:...  )
{
	if( !get_playersnum( ) ) return;
	
	new szMessage[ 256 ];

	switch( iType )
	{
		case NORMAL:	szMessage[ 0 ] = 0x01;
		
		case GREEN:	szMessage[ 0 ] = 0x04;
		
		default: 	szMessage[ 0 ] = 0x03;
	}

	vformat(  szMessage[ 1 ], 251, msg, 4  );

	szMessage[ 192 ] = '^0';
	

	new iTeam, iColorChange, iPlayerIndex, MSG_Type;
	
	if( id )
	{
		MSG_Type  =  MSG_ONE_UNRELIABLE;
		iPlayerIndex  =  id;
	}
	else
	{
		iPlayerIndex  =  CC_FindPlayer(  );
		MSG_Type = MSG_ALL;
	}
	
	iTeam  =  get_user_team( iPlayerIndex );
	iColorChange  =  CC_ColorSelection(  iPlayerIndex,  MSG_Type, iType);

	CC_ShowColorMessage(  iPlayerIndex, MSG_Type, szMessage  );
		
	if(  iColorChange  )	CC_Team_Info(  iPlayerIndex, MSG_Type,  TeamName[ iTeam ]  );

}

stock CC_ShowColorMessage(  id, const iType, const szMessage[  ]  )
{
	
	static bool:bSayTextUsed;
	static iMsgSayText;
	
	if(  !bSayTextUsed  )
	{
		iMsgSayText  =  get_user_msgid( "SayText" );
		bSayTextUsed  =  true;
	}
	
	message_begin( iType, iMsgSayText, _, id  );
	write_byte(  id  )		
	write_string(  szMessage  );
	message_end(  );
}

stock CC_Team_Info( id, const iType, const szTeam[  ] )
{
	static bool:bTeamInfoUsed;
	static iMsgTeamInfo;
	if(  !bTeamInfoUsed  )
	{
		iMsgTeamInfo  =  get_user_msgid( "TeamInfo" );
		bTeamInfoUsed  =  true;
	}
	
	message_begin( iType, iMsgTeamInfo, _, id  );
	write_byte(  id  );
	write_string(  szTeam  );
	message_end(  );

	return 1;
}

stock CC_ColorSelection(  id, const iType, Color:iColorType)
{
	switch(  iColorType  )
	{
		
		case RED:	return CC_Team_Info(  id, iType, TeamName[ 1 ]  );
		case BLUE:	return CC_Team_Info(  id, iType, TeamName[ 2 ]  );
		case GREY:	return CC_Team_Info(  id, iType, TeamName[ 0 ]  );

	}

	return 0;
}

stock CC_FindPlayer(  )
{
	new iMaxPlayers  =  get_maxplayers(  );
	
	for( new i = 1; i <= iMaxPlayers; i++ )
		if(  is_user_connected( i )  )
			return i;
	
	return -1;
}
P.S.: Netestat = Nu am avut timp să mă uit atent peste cod. Deci ceea ce am scris este posibil să fie greşit sau să aibă erori.

If i helped you and you wanna thank me, you can donate at this link : here
This will motivate me to help you in the future.
[If you want a private plugin send me a PM.(No complex plugins please, I am a student and I don't have the time to make those)]
Post Reply

Return to “Cereri”

  • Information