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

[CSGO] usp for ct


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 06-22-2017 , 08:03   [CSGO] usp for ct
Reply With Quote #1

So basically I need a plugin that gives to Counter Terrorist every round a USPS at the start round
__________________
sHoC is offline
_GamerX
AlliedModders Donor
Join Date: Jun 2011
Location: Fun Server
Old 06-22-2017 , 13:41   Re: [CSGO] usp for ct
Reply With Quote #2

try this put in console: mp_ct_default_secondary "weapon_usp_silencer"
__________________
_GamerX is offline
Send a message via ICQ to _GamerX Send a message via Skype™ to _GamerX
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 06-22-2017 , 17:22   Re: [CSGO] usp for ct
Reply With Quote #3

Code:
//Pragma
#pragma semicolon 1
#pragma newdecls required

//Sourcemod Includes
#include <sourcemod>
#include <sdktools>
#include <cstrike>

//Plugin Info
public Plugin myinfo = 
{
	name = "USP on round start", 
	author = "Keith Warren (Drixevel)", 
	description = "Gives a USP to CT players on round start.", 
	version = "1.0.0", 
	url = "http://www.drixevel.com/"
};

public void OnPluginStart()
{
	HookEvent("round_start", Event_OnRoundStart);
}

public void Event_OnRoundStart(Event event, const char[] name, bool dontBroadcast)
{
	CreateTimer(1.0, Timer_GiveUSP, _, TIMER_FLAG_NO_MAPCHANGE);
}

public Action Timer_GiveUSP(Handle timer)
{
	for (int i = 1; i <= MaxClients; i++)
	{
		if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_CT)
		{
			int weapon = GivePlayerItem2(i, "weapon_usp_silencer");
			EquipPlayerWeapon(i, weapon);
		}
	}
}

int GivePlayerItem2(int client, const char[] item)
{
	int team = GetClientTeam(client);
	SetEntProp(client, Prop_Send, "m_iTeamNum", team == 3 ? 2 : 3);
	int weapon = GivePlayerItem(client, item);
	SetEntProp(client, Prop_Send, "m_iTeamNum", team);
	return weapon;
}
Attached Files
File Type: sp Get Plugin or Get Source (usponroundstart.sp - 467 views - 1.2 KB)
Drixevel is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 06-23-2017 , 05:14   Re: [CSGO] usp for ct
Reply With Quote #4

Quote:
Originally Posted by Drixevel View Post
Code:
//Pragma
#pragma semicolon 1
#pragma newdecls required

//Sourcemod Includes
#include <sourcemod>
#include <sdktools>
#include <cstrike>

//Plugin Info
public Plugin myinfo = 
{
	name = "USP on round start", 
	author = "Keith Warren (Drixevel)", 
	description = "Gives a USP to CT players on round start.", 
	version = "1.0.0", 
	url = "http://www.drixevel.com/"
};

public void OnPluginStart()
{
	HookEvent("round_start", Event_OnRoundStart);
}

public void Event_OnRoundStart(Event event, const char[] name, bool dontBroadcast)
{
	CreateTimer(1.0, Timer_GiveUSP, _, TIMER_FLAG_NO_MAPCHANGE);
}

public Action Timer_GiveUSP(Handle timer)
{
	for (int i = 1; i <= MaxClients; i++)
	{
		if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_CT)
		{
			int weapon = GivePlayerItem2(i, "weapon_usp_silencer");
			EquipPlayerWeapon(i, weapon);
		}
	}
}

int GivePlayerItem2(int client, const char[] item)
{
	int team = GetClientTeam(client);
	SetEntProp(client, Prop_Send, "m_iTeamNum", team == 3 ? 2 : 3);
	int weapon = GivePlayerItem(client, item);
	SetEntProp(client, Prop_Send, "m_iTeamNum", team);
	return weapon;
}
ty its working
__________________
sHoC is offline
waylander3
Senior Member
Join Date: Sep 2015
Location: Russia, Norilsk
Old 07-04-2017 , 14:54   Re: [CSGO] usp for ct
Reply With Quote #5

Can anyone modify this plugin? I need to replace p2000 to usp-s, and only p2000, if player have deagle, 57 and any other pistol - don't give him usp-s, only if he have p2000. Thanks.
waylander3 is offline
sim242
AlliedModders Donor
Join Date: Dec 2012
Location: England
Old 07-04-2017 , 15:25   Re: [CSGO] usp for ct
Reply With Quote #6

I can do this for you when I'm home. Send me a PM so I don't forget.
__________________
Steam - Sim
Request a private plugin
Not accepting requests at this time
sim242 is offline
Send a message via Skype™ to sim242
sim242
AlliedModders Donor
Join Date: Dec 2012
Location: England
Old 07-04-2017 , 16:50   Re: [CSGO] usp for ct
Reply With Quote #7

This should work Let me know if it doesn't.

Code:
//Pragma
#pragma semicolon 1
#pragma newdecls required

//Sourcemod Includes
#include <sourcemod>
#include <sdktools>
#include <cstrike>

//Plugin Info
public Plugin myinfo = 
{
	name = "USP on round start", 
	author = "Keith Warren (Drixevel)", 
	description = "Gives a USP to CT players on round start.", 
	version = "1.0.0", 
	url = "http://www.drixevel.com/"
};

public void OnPluginStart()
{
	HookEvent("round_start", Event_OnRoundStart);
}

public void Event_OnRoundStart(Event event, const char[] name, bool dontBroadcast)
{
	CreateTimer(1.0, Timer_GiveUSP, _, TIMER_FLAG_NO_MAPCHANGE);
}

public Action Timer_GiveUSP(Handle timer)
{
	for (int i = 1; i <= MaxClients; i++)
	{
		if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == CS_TEAM_CT)
		{
			char weaponName[32];
			int weaponIndex = GetPlayerWeaponSlot(i, CS_SLOT_SECONDARY);
			GetEntityClassname(weaponIndex, weaponName, sizeof(weaponName));
			
			if (StrEqual(weaponName, "weapon_hkp2000"))
			{
				AcceptEntityInput(weaponIndex, "Kill");
				RemovePlayerItem(i, weaponIndex);
				
				int weapon = GivePlayerItem2(i, "weapon_usp_silencer");
				EquipPlayerWeapon(i, weapon);
			}
		}
	}
}

int GivePlayerItem2(int client, const char[] item)
{
	int team = GetClientTeam(client);
	SetEntProp(client, Prop_Send, "m_iTeamNum", team == 3 ? 2 : 3);
	int weapon = GivePlayerItem(client, item);
	SetEntProp(client, Prop_Send, "m_iTeamNum", team);
	return weapon;
}
__________________
Steam - Sim
Request a private plugin
Not accepting requests at this time
sim242 is offline
Send a message via Skype™ to sim242
waylander3
Senior Member
Join Date: Sep 2015
Location: Russia, Norilsk
Old 07-04-2017 , 20:04   Re: [CSGO] usp for ct
Reply With Quote #8

I haven't time for test it fully, but i joined on server, buy 5-7, and in next round usp don't given Later will test fully
waylander3 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 06:06.


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