You are not logged in.

Dear visitor, welcome to sourceserver.info. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Changelog.txt

Intermediate

  • "Changelog.txt" started this thread

Posts: 175

wcf.user.option.userOption53: Nein

  • Send private message

1

Sunday, May 31st 2015, 9:48pm

Ergeben/Capitulate Plugin von Jackmaster verändern

Hallo

Mit dem Plugin Ergeben/Capitulate von Jackmaster kann man leider nur 1 mal pro Runde benutzen. Möchte es aber auf 10 mal pro Runde erweitern, was müsste ich da verändern?

Plugin:

Spoiler Spoiler

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#include <sourcemod>
#include <cstrike>
#include <colors>
#include <sdktools>
#pragma semicolon 1

#define PLUGIN_VERSION "1.0"


new Handle:g_c_knife = INVALID_HANDLE;
new Handle:g_c_enabled = INVALID_HANDLE;
new bool:g_capitulated[MAXPLAYERS+1] = false;
new Handle:Timer_c[MAXPLAYERS+1];

public Plugin:myinfo = 
{
	name = "Capitulation/Ergeben",
	author = "Jackmaster",
	description = "Strips all sweps",
	version = PLUGIN_VERSION,
	url = "nourl"
}


public OnPluginStart()
{
	HookEvent("round_start", EventRoundStart);
	RegConsoleCmd("sm_c", capitu);
	RegConsoleCmd("sm_e", capitu);
	RegConsoleCmd("sm_ergeben", capitu);
	RegConsoleCmd("sm_capitulation", capitu);
	LoadTranslations("capitulation");
	g_c_enabled = CreateConVar("sm_capitulation_enable", "1.0", "Enable or Disable capitulation Plugin");
	g_c_knife = CreateConVar("sm_capitulation_timer", "10.0", "Time after the player gets a knife");
	AutoExecConfig(true, "plugin.capitulation");
}

public Action:capitu(client, args)
{
	new isOn = GetConVarBool(g_c_enabled);
	if ((isOn) == 1)
	{
		if (GetClientTeam(client) == CS_TEAM_T && (IsPlayerAlive(client)))
		{
			if (!(g_capitulated[client]))
			{
				new Float:timerca = GetConVarFloat(g_c_knife);
				g_capitulated[client] = true;
				TextPrintc(client);
				SetEntityRenderMode(client,RENDER_TRANSCOLOR);
				SetEntityRenderColor(client, 0, 255, 0, 255);
				Timer_c[client] = CreateTimer(timerca, knifes, client);
				new index;
				for (new i; i <= 4; i++)
				{
					if((index = GetPlayerWeaponSlot(client, i)) != -1)
					{
						CS_DropWeapon(client, index, true, false);
						AcceptEntityInput(index, "Kill");
					}
				}
			}
			else
			{
				CPrintToChat(client, "%t", "MESSAGE_ALREADYCAPITULATED");
			}
		}
		else
		{
			CPrintToChat(client, "%t", "MESSAGE_NOTORDEATH");
		}
	}
	return Plugin_Handled;
}

public Action:EventRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
	for(new client=1; client<=MaxClients; client++)
	{
		if (IsClientConnected(client))
		{
			g_capitulated[client] = false;
			if (Timer_c[client] != INVALID_HANDLE)
			{
				CloseHandle(Timer_c[client]);
				Timer_c[client] = INVALID_HANDLE;
			}
		}
	}
	return Plugin_Continue;
}

public OnClientDisconnect(client)
{
	if (Timer_c[client] != INVALID_HANDLE)
	{
		CloseHandle(Timer_c[client]);
		Timer_c[client] = INVALID_HANDLE;
	}
}

public Action:TextPrintc(client)
{	
	new String:getName[MAX_NAME_LENGTH];
	GetClientName(client, getName, sizeof(getName));
	CPrintToChatAll("%t", "MESSAGE_CAPITULATION", getName);
	PrintCenterTextAll("%t", "CENTERMESSAGE_CAPITULATION", getName);
}

public Action:knifes(Handle:timer, any:client)
{
	if (IsClientConnected(client))
	{
		GivePlayerItem(client,"weapon_knife");
		CPrintToChat(client, "%t", "MESSAGE_KNIFEBACK");
		SetEntityRenderMode(client,RENDER_TRANSCOLOR);
		SetEntityRenderColor(client, 255, 255, 255, 255);
	}
	Timer_c[client] = INVALID_HANDLE;
}

Changelog.txt

Intermediate

  • "Changelog.txt" started this thread

Posts: 175

wcf.user.option.userOption53: Nein

  • Send private message

2

Tuesday, June 9th 2015, 9:14pm

hier die Lösung für alle andere.

Linie 48: g_capitulated[client] = true; in g_capitulated[client] = false;

This post has been edited 4 times, last edit by "Changelog.txt" (Jun 13th 2015, 11:45pm)


Similar threads