Sie sind nicht angemeldet.

Changelog.txt

Fortgeschrittener

  • »Changelog.txt« ist der Autor dieses Themas

Beiträge: 175

Rootserver vorhanden: Nein

  • Nachricht senden

1

Sonntag, 31. Mai 2015, 21:48

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

Quellcode

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

Fortgeschrittener

  • »Changelog.txt« ist der Autor dieses Themas

Beiträge: 175

Rootserver vorhanden: Nein

  • Nachricht senden

2

Dienstag, 9. Juni 2015, 21:14

hier die Lösung für alle andere.

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

Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »Changelog.txt« (13. Juni 2015, 23:45)


Ähnliche Themen