You are not logged in.

INIURIA

Intermediate

  • "INIURIA" started this thread

Posts: 409

Occupation: Kaufman im Einzelhandel

wcf.user.option.userOption53: Ja

  • Send private message

1

Friday, October 25th 2013, 1:59pm

Stamm Knfe = 2 Points

Hallo,

Gibt es eine Möglichkeit, dass wenn man jemanden messert das man 2 Punkte in STAMM bekommt statt nur 1 ? Aber es soll nur bei Messer sein.

MfG
INIURIA

Newbie'

Professional

Posts: 580

Location: Zuhause

wcf.user.option.userOption53: Nein

  • Send private message

2

Friday, October 25th 2013, 2:12pm

Gibt es für diese Funktion ein Stamm Module? Wenn ja welches? Könnte man wenn eines vorhanden ist sicher leicht adden.

INIURIA

Intermediate

  • "INIURIA" started this thread

Posts: 409

Occupation: Kaufman im Einzelhandel

wcf.user.option.userOption53: Ja

  • Send private message

3

Friday, October 25th 2013, 9:44pm

Ich stelle ja die frage ob es eine Möglichkeit gibt ....

MFG
INIURIA

Blacksilver

Intermediate

Posts: 298

Location: 127.0.0.1

Occupation: FISI

wcf.user.option.userOption53: Nein

  • Send private message

4

Sunday, October 27th 2013, 12:15pm

Den Plugin Auto(Popoklopsi) im Thread schreiben, dann baut er es vlt standardmäßig ein :)

https://forums.alliedmods.net/showthread…dda817&t=142073
Come to the dark side,
we have cookies ;)

Posts: 18

wcf.user.option.userOption53: Nein

  • Send private message

5

Sunday, October 27th 2013, 1:34pm

Wie wäre es damit?

Spoiler Spoiler


//Ungetestet

PHP 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
#include <sourcemod>
#include <stamm>

new Handle:hStammPoints INVALID_HANDLE;
new Handle:hStammKnifeEnable INVALID_HANDLE;
new Handle:hStammMinPlayer INVALID_HANDLE;
public CountOnlinePlayer()
{
    new Counter;
    for (new 1<= GetMaxClients(); i++)
    {
        if ((IsClientInGame(i)) && IsPlayerAlive(i))
        {
            Counter++;
        }
    }
    return Counter;    
}
public OnPluginStart()
{
    HookEvent("player_death"EventPlayerDeath);
    hStammKnifeEnable CreateConVar("sm_stammknife_enable""1""StammKnife aktivieren?"_true0.0true1.0);
    hStammKnifeEnable CreateConVar("sm_stammknife_points""1""Wie viele Stammpunkte soll der Spieler bekommen?");
    hStammMinPlayer FindConVar("stamm_min_player");

}
public EventPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(GetConVarInt(hStammKnifeEnable))
    {
        if(CountOnlinePlayer() >= GetConVarInt(hStammMinPlayer))
        {
            new String:weapon[64];
            GetEventString(event"weapon"weaponsizeof(weapon));
            new attacker GetClientOfUserId(GetEventInt(event"attacker"));
            
            if(StrEqual(weapon"weapon_knife"))
            {
                STAMM_AddClientPoints(attackerGetConVarInt(hStammPoints));
            }
        }
    }
}

This post has been edited 1 times, last edit by "Toastbrot_290" (Oct 27th 2013, 1:49pm)


INIURIA

Intermediate

  • "INIURIA" started this thread

Posts: 409

Occupation: Kaufman im Einzelhandel

wcf.user.option.userOption53: Ja

  • Send private message

6

Sunday, October 27th 2013, 3:01pm

Danke Toastbrot_290 ich werde es mal testen wenn es nicht klappen sollte mache ich es wie Blacksilver geschrieben hat :)

EDIT:

Spoiler Spoiler

PHP 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
#include <sourcemod>
#include <stamm>

new Handle:hStammPoints INVALID_HANDLE;
new Handle:hStammKnifeEnable INVALID_HANDLE;
new Handle:hStammMinPlayer INVALID_HANDLE;
public CountOnlinePlayer()
{
    new Counter;
    for (new 1<= GetMaxClients(); i++)
    {
        if ((IsClientInGame(i)) && IsPlayerAlive(i))
        {
            Counter++;
        }
    }
    return Counter;    
}
public OnPluginStart()
{
    HookEvent("player_death"EventPlayerDeath);
    hStammKnifeEnable CreateConVar("sm_stammknife_enable""1""StammKnife aktivieren?"_true0.0true1.0);
    hStammKnifeEnable CreateConVar("sm_stammknife_points""1""Wie viele Stammpunkte soll der Spieler bekommen?");
    hStammMinPlayer FindConVar("stamm_min_player");

}
public EventPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(GetConVarInt(hStammKnifeEnable))
    {
        if(CountOnlinePlayer() >= GetConVarInt(hStammMinPlayer))
        {
            new String:weapon[64];
            GetEventString(event"weapon"weaponsizeof(weapon));
            new attacker GetClientOfUserId(GetEventInt(event"attacker"));
            
            if(StrEqual(weapon"weapon_knife"))
            {
                STAMM_AddClientPoints(attackerGetConVarInt(hStammPoints));
            }
        }
    }
}


Das geht leider nicht oder ich habe es nicht hinbekommen :D. Ich werde Popoklopsi fragen ^^

MfG
INIURIA

This post has been edited 1 times, last edit by "INIURIA" (Oct 27th 2013, 8:51pm)


Blacksilver

Intermediate

Posts: 298

Location: 127.0.0.1

Occupation: FISI

wcf.user.option.userOption53: Nein

  • Send private message

7

Monday, October 28th 2013, 7:33pm

Dann schreib/frag am Besten, ob man jede Waffe das einstellen kann ;) :p
Dann muss man in der Zukunft nicht nochmal dran abreiten ^^
Come to the dark side,
we have cookies ;)

INIURIA

Intermediate

  • "INIURIA" started this thread

Posts: 409

Occupation: Kaufman im Einzelhandel

wcf.user.option.userOption53: Ja

  • Send private message

8

Monday, October 28th 2013, 9:33pm

Dieses Thread wurde von Bara an Popoklopsi weitergeleitet.

Aber ich werde Ihn mal anschreiben. Wenn ich ihn hier im Forum finden sollte :D .

MfG
INIURIA

Posts: 18

wcf.user.option.userOption53: Nein

  • Send private message

9

Thursday, October 31st 2013, 10:17am

Hmm ja hab nen ziemlichen dummen Fehler gemacht :/
Aber hier eine funktionierende Version ;) Vlt. hilft dir das bis Popoklopsi es einbindet.

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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/* Plugin Template generated by Pawn Studio */

#include <sourcemod>
#include <stamm>
#include <morecolors>
#include <sdktools>

public Plugin:myinfo = 
{
	name = "StammWeapon",
	author = "Toast",
	description = "Gives a player x Stamm Points when he kills a player with x weapon",
	version = "1.0",
	url = "sourcemod.net"
}
new public Handle:pack = INVALID_HANDLE;
new Handle:hStammWeaponEnable = INVALID_HANDLE;
new Handle:hStammMinPlayer = INVALID_HANDLE;
new Handle:hStammWeaponMess = INVALID_HANDLE;
public OnPluginStart()
{
	HookEvent("player_death", EventPlayerDeath);
	hStammWeaponEnable = CreateConVar("sm_stammwaepon_enable", "1", "StammKnife aktivieren?", _, true, 0.0, true, 1.0);
	hStammWeaponMess = CreateConVar("sm_stammwaepon_message", "1", "Spielerbenachrichtigung aktivieren?", _, true, 0.0, true, 1.0);
	hStammMinPlayer = FindConVar("stamm_min_player");
	ReadConfig();
	RegConsoleCmd("sm_swreload", swreload);
	LoadTranslations("stammweapon.phrases");
}
public EventPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	if(GetConVarInt(hStammWeaponEnable))
	{
		if(GetTeamCount() >= GetConVarInt(hStammMinPlayer))
		{
			new String:weapon[64];
			GetEventString(event, "weapon", weapon, sizeof(weapon));
			new attackerid = GetEventInt(event, "attacker")
			new attacker = GetClientOfUserId(attackerid);
			new victimid = GetEventInt(event, "userid")
			new victim = GetClientOfUserId(victimid);
			ResetPack(pack);
			new String:buffer[1024];
			new points = 0;
			ReadPackString(pack, buffer, 1024);
			points = ReadPackCell(pack);
			
			while(!StrEqual(weapon, buffer) && !StrEqual("",buffer))
			{
				ReadPackString(pack, buffer, 1024);
				points = ReadPackCell(pack);
			}
			
			if(points == 0)
			{
			}
			else if(points >> 0)
			{
				if(GetConVarInt(hStammWeaponMess) == 1)
				{
					CPrintToChat(attacker, "%t %t","prefix", "addpoints",victim, buffer, points);
				}
				STAMM_AddClientPoints(attacker, points);
			}
			else if(points << 0)
			{
				new points2;
				points2 = 0 - points;
				if(GetConVarInt(hStammWeaponMess) == 1)
				{
					CPrintToChat(attacker, "%t %t","prefix", "delpoints",victim, buffer, points2);
				}
				STAMM_DelClientPoints(attacker, points2);
			}
		}
	}
}

public Action:swreload(client, args)
{
	if(ReadConfig())
	{
		ResetPack(pack);
		new String:buffer[1024];
		new points = 0;
		ReadPackString(pack, buffer, 1024);
		points = ReadPackCell(pack);
		CPrintToChat(client,"%t %t","prefix", "configreload");
		CPrintToChat(client,"%t %t","prefix", "configline", buffer, points);
		while(!StrEqual("",buffer))
		{
			ReadPackString(pack, buffer, 1024);
			points = ReadPackCell(pack);
			if(!StrEqual("",buffer))
			{
				CPrintToChat(client,"%t %t","prefix", "configline", buffer, points);
			}
		}
	}
	else
	{
		CPrintToChat(client,"%t %t","prefix", "configreloaderror");
	}
}
public ReadConfig()
{
	pack = CreateDataPack();
	new Handle:keyvalues = INVALID_HANDLE;
	new String:swcfg[128];
	keyvalues = CreateKeyValues("weapons");
	BuildPath(Path_SM,swcfg,sizeof(swcfg),"configs/stammweapon.cfg");
	if(FileExists(swcfg))
	{
		FileToKeyValues(keyvalues, swcfg);
		if (KvGotoFirstSubKey(keyvalues))
		{
			new String:weapon[64];
			KvGetString(keyvalues, "weapon", weapon, 64, "");
			new points = KvGetNum(keyvalues, "points", 0);
			WritePackString(pack, weapon);
			WritePackCell(pack, points);
			
			while (KvGotoNextKey(keyvalues))
			{				
				new String:weapon2[64];
				KvGetString(keyvalues, "weapon", weapon2, 64, "");
				new points2 = KvGetNum(keyvalues, "points", 0);
				WritePackString(pack, weapon2);
				WritePackCell(pack, points2);
			}
		}
		else
		{
			return false;
		}
	}
	else
	{
		return false;
	}
	return true;
}


Waffen und Punkte kannst du in der Config einstellen. Über die Cvars sm_stammweapon_enable/sm_stammweapon_message kannst du das Plugin/die Benachrichtigungen aktivieren bzw. deaktivieren. Es gibt nur ein Command !swreload zum neuladen der Config.
Toastbrot_290 has attached the following file:
  • StammWeapon.zip (15.89 kB - 133 times downloaded - latest: Jun 29th 2025, 10:25am)

This post has been edited 3 times, last edit by "Toastbrot_290" (Oct 31st 2013, 10:29am) with the following reason: zip Archiv hinzugefügt


Similar threads

Used tags

[CS:S]