Sie sind nicht angemeldet.

[CS:S] Jail Awards

1

Mittwoch, 24. April 2013, 19:47

Jail Awards

Hallo

Wollte mal fragen ob mir jemand das Jail Awards ein wenig umschreiben kann bzw nur die befehle und halt auf deutsch :D

https://forums.alliedmods.net/showthread.php?t=174843

Wäre nett denn befehl von !awards zu !shop machen könnte und das das [SM_JailAwards] zu [Shop] wird mehr eing nicht da ich ka habe vom decompilen bzw das selbst zu machen könnt ihr mir das machen ? bitte

PS: bitte die preise etwas höher machen ausser Knife :D

Newbie'

Profi

Beiträge: 580

Wohnort: Zuhause

Rootserver vorhanden: Nein

  • Nachricht senden

2

Mittwoch, 24. April 2013, 19:53

Bitte schön hier

3

Mittwoch, 24. April 2013, 19:54

haha thanks :D

aber bis ich die tuts geschaut habe dauert es bestimmt 1-2 std jenach dem wie lang die videos sind :D

Newbie'

Profi

Beiträge: 580

Wohnort: Zuhause

Rootserver vorhanden: Nein

  • Nachricht senden

4

Mittwoch, 24. April 2013, 19:56

Es reicht aus nur die ersten beiden zu schauen, das reicht dann kannst dir die sp selbst anpassen ist nicht schwer.
Commands sowie Textstellen ändern ist einfach versuch es halt!

5

Mittwoch, 24. April 2013, 19:57

das lustige ist es gibt beim jail award keine sp O.o nur die smx

MadMakz

Super Moderator

Beiträge: 1 878

Wohnort: ~#

Rootserver vorhanden: Ja

  • Nachricht senden

6

Mittwoch, 24. April 2013, 20:10

das lustige ist es gibt beim jail award keine sp O.o nur die smx

...or Get Source (jail_awards.sp - 209 views - 26.6 KB)

:rolleyes:

7

Mittwoch, 24. April 2013, 20:14

wo hastden bitte seh die gefunden ? xD

MadMakz

Super Moderator

Beiträge: 1 878

Wohnort: ~#

Rootserver vorhanden: Ja

  • Nachricht senden

8

Mittwoch, 24. April 2013, 20:20

wo hastden bitte seh die gefunden ? xD


9

Mittwoch, 24. April 2013, 20:30

rolf -.- bin ick schon sofertig mit meine nerven -.-


ha trdz danke dir xD



lol habe die .sp angepasst und aufm server gehauen + restart und es geht trdz net -.-

10

Mittwoch, 24. April 2013, 20:55

so habe die .sp bearbeitet und aufm server kopiert aber wieso nimmt er das nicht an ? habe bis is jetzt nur dassm_jailawars zu shop gemacht O.o

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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
#include <sourcemod>
#include <sdktools>
#include <sdktools_sound>
#include <cstrike>
#include <sdkhooks>
#include <clientprefs>

#pragma semicolon 1

new bool:g_Fly[MAXPLAYERS+1] = {false, ...};
new bool:g_Godmode[MAXPLAYERS+1] = {false, ...};
new bool:g_AmmoInfi[MAXPLAYERS+1] = {false, ...};


#define VERSION "1.2 public version"

new g_iCredits[MAXPLAYERS+1];


new Handle:cvarCreditsMax = INVALID_HANDLE;
new Handle:cvarCreditsKill = INVALID_HANDLE;
new Handle:cvarCreditsSave = INVALID_HANDLE;

new activeOffset = -1;
new clip1Offset = -1;
new clip2Offset = -1;
new secAmmoTypeOffset = -1;
new priAmmoTypeOffset = -1;

new Handle:cvarInterval;
new Handle:AmmoTimer;


new Handle:c_GameCredits = INVALID_HANDLE;


public Plugin:myinfo =
{
	name = "SM Franug Jail Awards",
	author = "Franc1sco steam: franug",
	description = "For buy awards in jail",
	version = VERSION,
	url = "http://servers-cfg.foroactivo.com/"
};

public OnPluginStart()
{

	LoadTranslations("common.phrases");

	c_GameCredits = RegClientCookie("Credits", "Credits", CookieAccess_Private);
	
	// ======================================================================
	
	HookEvent("player_spawn", PlayerSpawn);
	HookEvent("player_death", PlayerDeath);
	//HookEvent("player_hurt", Event_hurt);
	//HookEvent("player_jump", PlayerJump);
	
	// ======================================================================
	
	RegConsoleCmd("sm_awards", DOMenu);
	RegConsoleCmd("sm_credits", VerCreditos);
	RegConsoleCmd("sm_revive", Resucitar);
	RegConsoleCmd("sm_medic", Curarse);

	RegAdminCmd("sm_setcredits", FijarCreditos, ADMFLAG_ROOT);
	
	// ======================================================================
	
	// ======================================================================
	
	cvarCreditsMax = CreateConVar("awards_credits_max", "0", "max of credits allowed (0: No limit)");
	cvarCreditsKill = CreateConVar("awards_credits_kill", "1", "credits for kill");
	cvarCreditsSave = CreateConVar("awards_credits_save", "1", "enable or disable that credits can be saved");
	

	// unlimited ammo by http://forums.alliedmods.net/showthread.php?t=107900
	cvarInterval = CreateConVar("ammo_interval", "5", "How often to reset ammo (in seconds).", _, true, 1.0);

	activeOffset = FindSendPropOffs("CAI_BaseNPC", "m_hActiveWeapon");
	CreateConVar("sm_jailawards_version", VERSION, "plugin info", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY|FCVAR_DONTRECORD);
	
	clip1Offset = FindSendPropOffs("CBaseCombatWeapon", "m_iClip1");
	clip2Offset = FindSendPropOffs("CBaseCombatWeapon", "m_iClip2");
	
	priAmmoTypeOffset = FindSendPropOffs("CBaseCombatWeapon", "m_iPrimaryAmmoCount");
	secAmmoTypeOffset = FindSendPropOffs("CBaseCombatWeapon", "m_iSecondaryAmmoCount");
	

	if(GetConVarBool(cvarCreditsSave))
		for(new client = 1; client <= MaxClients; client++)
		{
		if(IsClientInGame(client))
		{
			if(AreClientCookiesCached(client))
			{
				OnClientCookiesCached(client);
			}
		}
   	}
}

public OnPluginEnd()
{
	if(!GetConVarBool(cvarCreditsSave))
		return;

	for(new client = 1; client <= MaxClients; client++)
	{
		if(IsClientInGame(client))
		{
			OnClientDisconnect(client);
		}
	}
}

public OnClientCookiesCached(client)
{
	if(!GetConVarBool(cvarCreditsSave))
		return;

	new String:CreditsString[12];
	GetClientCookie(client, c_GameCredits, CreditsString, sizeof(CreditsString));
	g_iCredits[client]  = StringToInt(CreditsString);
}

public OnClientDisconnect(client)
{
	if(!GetConVarBool(cvarCreditsSave))
	{
		g_iCredits[client] = 0;
		return;
	}

	if(AreClientCookiesCached(client))
	{
		new String:CreditsString[12];
		Format(CreditsString, sizeof(CreditsString), "%i", g_iCredits[client]);
		SetClientCookie(client, c_GameCredits, CreditsString);
	}
}

public OnConfigsExecuted()
{


	PrecacheModel("models/props/de_train/barrel.mdl");

	PrecacheModel("models/pigeon.mdl");

	PrecacheModel("models/crow.mdl");


	if (AmmoTimer != INVALID_HANDLE) {
		KillTimer(AmmoTimer);
	}
	new Float:interval = GetConVarFloat(cvarInterval);
	AmmoTimer = CreateTimer(interval, ResetAmmo, _, TIMER_REPEAT);
}


public Action:MensajesSpawn(Handle:timer, any:client)
{
 if (IsClientInGame(client))
 {
   PrintToChat(client, "\x04[Shop] \x05Kill players to get credits");
   PrintToChat(client, "\x04[Shop] \x05Type \x03!awards \x05to spend your credits on prizes");
 }
}

public Action:PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
	new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
	new client = GetClientOfUserId(GetEventInt(event, "userid"));

	CreateTimer(2.0, MensajesMuerte, client);
	
	if (!attacker)
    	return;

	if (attacker == client)
    	return;
	
	g_iCredits[attacker] += GetConVarInt(cvarCreditsKill);
	
	if (g_iCredits[attacker] < GetConVarInt(cvarCreditsMax))
	{
    	PrintToChat(attacker, "\x04[Shop] \x05Your credits: %i (+%i)", g_iCredits[attacker],GetConVarInt(cvarCreditsKill));
	}
	else
	{
    	g_iCredits[attacker] = GetConVarInt(cvarCreditsMax);
    	PrintToChat(attacker, "\x04[Shop] \x05Your credits: %i (Maximum allowed)", g_iCredits[attacker]);
	}
}

public Action:MensajesMuerte(Handle:timer, any:client)
{
 if (IsClientInGame(client))
 {
   PrintToChat(client, "\x04[Shop] \x05You died, now you can use \x03!revive \x05for revive (4 credits required)");
 }
}

public Action:VerCreditos(client, args)
{
	if(client == 0)
	{
		PrintToServer("%t","Command is in-game only");
		return;
	}
    	PrintToChat(client, "\x04[Shop] \x05Your current credits are: %i", g_iCredits[client]);
}

public Action:DOMenu(client,args)
{
	if(client == 0)
	{
		PrintToServer("%t","Command is in-game only");
		return;
	}
		DID(client);
   	PrintToChat(client, "\x04[Shop] \x05Your credits: %i", g_iCredits[client]);
}

public Action:Resucitar(client,args)
{
	if(client == 0)
	{
		PrintToServer("%t","Command is in-game only");
		return;
	}

	if (!IsPlayerAlive(client))
    	{
          	if (g_iCredits[client] >= 4)
          	{

                  	CS_RespawnPlayer(client);

                  	g_iCredits[client] -= 4;

                  	decl String:nombre[32];
                  	GetClientName(client, nombre, sizeof(nombre));

                  	PrintToChatAll("\x04[Shop] \x05The player\x03 %s \x05has revived!", nombre);
                  	PrintCenterTextAll("The player %s has revived!", nombre);

          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit to revive! Need 4)", g_iCredits[client]);
          	}
    	}
    	else
    	{
        	PrintToChat(client, "\x04[Shop] \x05Must be dead to use!");
    	}
}

public Action:Curarse(client,args)
{
	if(client == 0)
	{
		PrintToServer("%t","Command is in-game only");
		return;
	}

	if (IsPlayerAlive(client))
    	{
          	if (g_iCredits[client] >= 1)
          	{

                  	SetEntityHealth(client, 100);

                  	g_iCredits[client] -= 1;

                  	//EmitSoundToAll("medicsound/medic.wav");


                  	decl String:nombre[32];
                  	GetClientName(client, nombre, sizeof(nombre));

                  	PrintToChatAll("\x04[Shop] \x05The player\x03 %s \x05has healed!", nombre);

                  	PrintToChat(client, "\x04[Shop] \x05You are cured. Your credits: %i (-1)", g_iCredits[client]);

          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit to revive! Need 1)", g_iCredits[client]);
          	}
    	}
    	else
    	{
        	PrintToChat(client, "\x04[Shop] \x05But if you're dead...!!");
    	}
}

public Action:DID(clientId) 
{
	new Handle:menu = CreateMenu(DIDMenuHandler);
	SetMenuTitle(menu, "Awards of store. Your credits: %i", g_iCredits[clientId]);
	AddMenuItem(menu, "option1", "View information on the plugin");
	AddMenuItem(menu, "option5", "Be invisible - 10 Credits");
	AddMenuItem(menu, "option6", "Buy AWP - 9  Credits");
	AddMenuItem(menu, "option7", "Becoming a barrel  - 8 Credits");
	AddMenuItem(menu, "option8", "INMORTAL 20 seconds - 7  Credits");
	AddMenuItem(menu, "option9", "Infinite ammo - 6  Credits");
	AddMenuItem(menu, "option10", "More speed - 5  Credits");
	AddMenuItem(menu, "option11", "Becoming BIRD - 5  Credits");
	AddMenuItem(menu, "option12", "Have 200 HP - 4  Credits");
	AddMenuItem(menu, "option13", "Buy USP pistol - 2  Credits");
	AddMenuItem(menu, "option14", "Buy Flashbang - 1  Credits");
	AddMenuItem(menu, "option15", "Healing - 1  Credits");
	AddMenuItem(menu, "option16", "Buy knife - 1  Credits");
	SetMenuExitButton(menu, true);
	DisplayMenu(menu, clientId, MENU_TIME_FOREVER);
	
	
	return Plugin_Handled;
}

public DIDMenuHandler(Handle:menu, MenuAction:action, client, itemNum) 
{
	if ( action == MenuAction_Select ) 
	{
    	new String:info[32];
    	
    	GetMenuItem(menu, itemNum, info, sizeof(info));

    	if ( strcmp(info,"option1") == 0 ) 
    	{
        	{
          	DID(client);
          	PrintToChat(client,"\x04[Shop] \x05Kill players for win credits.");
          	//PrintToChat(client, "\x04[Shop] \x05Version:\x03 %s \x05created for SourceMod.", VERSION);
        	}
        	
    	}


    	
    	else if ( strcmp(info,"option5") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 10)
          	{
               	if (IsPlayerAlive(client))
               	{
                  	SetEntityRenderMode(client, RENDER_TRANSCOLOR);
                  	SetEntityRenderColor(client, 255, 255, 255, 0);

                  	g_iCredits[client] -= 10;

                  	PrintToChat(client, "\x04[Shop] \x05Now you are invisible! Your credits: %i (-10)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}
          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 10)", g_iCredits[client]);
          	}
        	}
        	
    	}

    	else if ( strcmp(info,"option6") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 9)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	GivePlayerItem(client, "weapon_awp");

                  	g_iCredits[client] -= 9;

                  	PrintToChat(client, "\x04[Shop] \x05Now you have a AWP! Your credits: %i (-9)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}
          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 9)", g_iCredits[client]);
          	}
        	}
        	
    	}

    	else if ( strcmp(info,"option7") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 8)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	SetEntityModel(client, "models/props/de_train/barrel.mdl");

                  	g_iCredits[client] -= 8;

                  	PrintToChat(client, "\x04[Shop] \x05Now you are a Barrel! Your credits: %i (-8)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}
          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 8)", g_iCredits[client]);
          	}
        	}
        	
    	}

    	else if ( strcmp(info,"option8") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 7)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	g_Godmode[client] = true;
                  	SetEntityRenderColor(client, 0, 255, 255, 255);
                  	CreateTimer(10.0, OpcionNumero16b, client);

                  	g_iCredits[client] -= 7;

                  	PrintToChat(client, "\x04[Shop] \x05Now you are inmortal for 20 seconds! Your credits: %i (-7)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}
          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 7)", g_iCredits[client]);
          	}
        	}
        	
    	}

    	else if ( strcmp(info,"option9") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 6)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	g_AmmoInfi[client] = true;

                  	g_iCredits[client] -= 6;

                  	PrintToChat(client, "\x04[Shop] \x05Now you have infinite ammo! Your credits: %i (-6)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}
          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 6)", g_iCredits[client]);
          	}
        	}
        	
    	}

    	else if ( strcmp(info,"option10") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 5)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.3);

                  	g_iCredits[client] -= 5;

                  	PrintToChat(client, "\x04[Shop] \x05Now you have more speed! Your credits: %i (-5)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}
          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 5)", g_iCredits[client]);
          	}
        	}
        	
    	}

    	else if ( strcmp(info,"option11") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 5)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	SetEntityMoveType(client, MOVETYPE_FLY);

                  	if (GetClientTeam(client) == CS_TEAM_CT)
                  	{
                      	SetEntityModel(client, "models/pigeon.mdl");
                  	}
                  	else
                  	{
                      	SetEntityModel(client, "models/crow.mdl");
                  	}

                  	new wepIdx;

                  	// strip all weapons
                  	for (new s = 0; s < 4; s++)
                  	{
	             	if ((wepIdx = GetPlayerWeaponSlot(client, s)) != -1)
	             	{
		             	RemovePlayerItem(client, wepIdx);
		             	RemoveEdict(wepIdx);
	             	}
                  	}

                  	GivePlayerItem(client, "weapon_knife");

                  	g_Fly[client] = true;

                  	g_iCredits[client] -= 5;

                  	PrintToChat(client, "\x04[Shop] \x05Now you are a bird and you can fly! Your credits: %i (-5)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}
          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 5)", g_iCredits[client]);
          	}
        	}
        	
    	}


    	else if ( strcmp(info,"option12") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 4)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	SetEntityHealth(client, 200);

                  	g_iCredits[client] -= 4;

                  	PrintToChat(client, "\x04[Shop] \x05Now you have 200 HP! Your credits: %i (-4)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}
          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 4)", g_iCredits[client]);
          	}
        	}
        	
    	}


    	else if ( strcmp(info,"option13") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 2)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	GivePlayerItem(client, "weapon_usp");

                  	g_iCredits[client] -= 2;

                  	PrintToChat(client, "\x04[Shop] \x05You bought a USP pistol! Your credits: %i (-2)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}

          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 2)", g_iCredits[client]);
          	}
        	}
        	
    	}

    	else if ( strcmp(info,"option14") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 1)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	GivePlayerItem(client, "weapon_flashbang");

                  	g_iCredits[client] -= 1;

                  	PrintToChat(client, "\x04[Shop] \x05You bought a flashbang! Your credits: %i (-1)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}

          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 1)", g_iCredits[client]);
          	}
        	}
        	
    	}

    	else if ( strcmp(info,"option15") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 1)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	SetEntityHealth(client, 100);

                  	g_iCredits[client] -= 1;

                  	EmitSoundToAll("medicsound/medic.wav");


                  	decl String:nombre[32];
                  	GetClientName(client, nombre, sizeof(nombre));

                  	PrintToChatAll("\x04[Shop] \x05The player\x03 %s \x05has healed!", nombre);

                  	PrintToChat(client, "\x04[Shop] \x05You are cured. Your credits: %i (-1)", g_iCredits[client]);


               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}

          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 1)", g_iCredits[client]);
          	}
        	}
        	
    	}

    	else if ( strcmp(info,"option16") == 0 ) 
    	{
        	{
          	DID(client);
          	if (g_iCredits[client] >= 1)
          	{
               	if (IsPlayerAlive(client))
               	{

                  	GivePlayerItem(client, "weapon_knife");

                  	g_iCredits[client] -= 1;

                  	PrintToChat(client, "\x04[Shop] \x05You bought a knife! Your credits: %i (-1)", g_iCredits[client]);
               	}
               	else
               	{
                  	PrintToChat(client, "\x04[Shop] \x05You have to be alive to buy prizes");
               	}

          	}
          	else
          	{
             	PrintToChat(client, "\x04[Shop] \x05Your credits: %i (Not have enough credit! Need 1)", g_iCredits[client]);
          	}
        	}
        	
    	}

    	else if ( strcmp(info,"option17") == 0 ) 
    	{
        	{
          	DID(client);
          	PrintToChat(client, "\x04[Shop] \x05Your current credits are: %i", g_iCredits[client]);
        	}
        	
    	}
   	
	}
}

public Action:FijarCreditos(client, args)
{
	if(client == 0)
	{
		PrintToServer("%t","Command is in-game only");
		return Plugin_Handled;
	}

	if(args < 2) // Not enough parameters
	{
    	ReplyToCommand(client, "[SM] Use: sm_setcredits <#userid|name> [amount]");
    	return Plugin_Handled;
	}

	decl String:arg2[10];
	//GetCmdArg(1, arg, sizeof(arg));
	GetCmdArg(2, arg2, sizeof(arg2));

	new amount = StringToInt(arg2);
	//new target;

	//decl String:patt[MAX_NAME]

	//if(args == 1) 
	//{ 
	decl String:strTarget[32]; GetCmdArg(1, strTarget, sizeof(strTarget)); 

	// Process the targets 
	decl String:strTargetName[MAX_TARGET_LENGTH]; 
	decl TargetList[MAXPLAYERS], TargetCount; 
	decl bool:TargetTranslate; 

	if ((TargetCount = ProcessTargetString(strTarget, client, TargetList, MAXPLAYERS, COMMAND_FILTER_CONNECTED, 
                                       	strTargetName, sizeof(strTargetName), TargetTranslate)) <= 0) 
	{ 
      	ReplyToTargetError(client, TargetCount); 
      	return Plugin_Handled; 
	} 

	// Apply to all targets 
	for (new i = 0; i < TargetCount; i++) 
	{ 
    	new iClient = TargetList[i]; 
    	if (IsClientInGame(iClient)) 
    	{ 
          	g_iCredits[iClient] = amount;
          	PrintToChat(client, "\x04[Shop] \x05Set %i credits in the player %N", amount, iClient);
    	} 
	} 
	//}  



//	SetEntProp(target, Prop_Data, "m_iDeaths", amount);


	return Plugin_Continue;
}


public Action:ResetAmmo(Handle:timer)
{
	for (new client = 1; client <= MaxClients; client++)
	{
		if (IsClientConnected(client) && !IsFakeClient(client) && IsClientInGame(client) && IsPlayerAlive(client) && (g_AmmoInfi[client]))
		{
			Client_ResetAmmo(client);
		}
	}
}

public Client_ResetAmmo(client)
{
	new zomg = GetEntDataEnt2(client, activeOffset);
	if (clip1Offset != -1 && zomg != -1)
		SetEntData(zomg, clip1Offset, 200, 4, true);
	if (clip2Offset != -1 && zomg != -1)
		SetEntData(zomg, clip2Offset, 200, 4, true);
	if (priAmmoTypeOffset != -1 && zomg != -1)
		SetEntData(zomg, priAmmoTypeOffset, 200, 4, true);
	if (secAmmoTypeOffset != -1 && zomg != -1)
		SetEntData(zomg, secAmmoTypeOffset, 200, 4, true);
}


public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
  	if (g_Godmode[victim])
  	{
           	damage = 0.0;
           	return Plugin_Changed;
  	}
  	return Plugin_Continue;
}

public Action:OnWeaponCanUse(client, weapon)
{
  if (g_Fly[client])
  {
  	decl String:sClassname[32];
  	GetEdictClassname(weapon, sClassname, sizeof(sClassname));
  	if (!StrEqual(sClassname, "weapon_knife"))
      	return Plugin_Handled;
  }
  return Plugin_Continue;
}

public OnClientPutInServer(client)
{
   SDKHook(client, SDKHook_OnTakeDamage, OnTakeDamage);
   SDKHook(client, SDKHook_WeaponCanUse, OnWeaponCanUse);
}

public OnClientPostAdminCheck(client)
{
	g_Godmode[client] = false;
	g_Fly[client] = false;
	g_AmmoInfi[client] = false;
}

public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
  new client = GetClientOfUserId(GetEventInt(event, "userid"));

  if (GetClientTeam(client) == 1 && !IsPlayerAlive(client))
  {
     	return;
  }

  CreateTimer(1.0, MensajesSpawn, client);




  if (g_Fly[client])
  {
	g_Fly[client] = false;
	SetEntityMoveType(client, MOVETYPE_WALK);
  }
  if (g_Godmode[client])
  {
	g_Godmode[client] = false;
  }
  if (g_AmmoInfi[client])
  {
	g_AmmoInfi[client] = false;
  }
}


public Action:OpcionNumero16b(Handle:timer, any:client)
{
 if ( (IsClientInGame(client)) && (IsPlayerAlive(client)) )
 {
   PrintToChat(client, "\x04[Shop] \x05You have 10 seconds of invulnerability!");
   CreateTimer(10.0, OpcionNumero16c, client);
 }
}

public Action:OpcionNumero16c(Handle:timer, any:client)
{
 if ( (IsClientInGame(client)) && (IsPlayerAlive(client)) )
 {
   PrintToChat(client, "\x04[Shop] \x05Now you are a mortal!");
   g_Godmode[client] = false;
   SetEntityRenderColor(client, 255, 255, 255, 255);
 }
}



oder muss ich noch extra die smx bearbeiten ?


haha fail wollte die sp compilen und er sagt mir an das es nciht geht wegen sdkhooks

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »iNSANNE« (24. April 2013, 21:01)


General_V

Super Moderator

Beiträge: 1 043

Wohnort: Mönchengladbach

Beruf: Brückenkranführer / Staplerfahrer

Rootserver vorhanden: Nein

  • Nachricht senden

11

Mittwoch, 24. April 2013, 21:36

Sind wir hier im Kindergarten ??? sucht euch einen anderen Platz dafür, hier jedenfalls nicht.

Blacksilver

Fortgeschrittener

Beiträge: 298

Wohnort: 127.0.0.1

Beruf: FISI

Rootserver vorhanden: Nein

  • Nachricht senden

12

Donnerstag, 25. April 2013, 07:37

Dann am besten sourcemod Download, in den Addons/sourcemod/Scripting Ordner gehen und deine .sp auf die spcompile.exe(könnte so heißen xD) ziehen.
Beim neusten SM ist SDKHooks schon enthalten, was du dann brauchst zum Compilen.
Come to the dark side,
we have cookies ;)

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »General_V« (25. April 2013, 08:57) aus folgendem Grund: Download Link eingefügt


13

Donnerstag, 25. April 2013, 09:44

Dann am besten sourcemod Download, in den Addons/sourcemod/Scripting Ordner gehen und deine .sp auf die spcompile.exe(könnte so heißen xD) ziehen.
Beim neusten SM ist SDKHooks schon enthalten, was du dann brauchst zum Compilen.
jo danke dir habs gestern aber schon hinbekommen :D

komischer weiße bekomm ich aber den befehl nicht geändert :D

Blacksilver

Fortgeschrittener

Beiträge: 298

Wohnort: 127.0.0.1

Beruf: FISI

Rootserver vorhanden: Nein

  • Nachricht senden

14

Donnerstag, 25. April 2013, 10:16

Habe es nicht getestet, aber hier :D
»Blacksilver« hat folgende Dateien angehängt:
  • shop.sp (26,72 kB - 119 mal heruntergeladen - zuletzt: 26. März 2024, 14:33)
  • shop.smx (14,95 kB - 93 mal heruntergeladen - zuletzt: 29. Januar 2024, 15:17)
Come to the dark side,
we have cookies ;)

15

Donnerstag, 25. April 2013, 11:35

danke dir aber deine sieht genau aus wie meine habe auch das sm_awards zu shop gemacht aber geht net befehl bleibt komischer weiße !awards finde auch nirgendwo ein andere zeile füt den command

Quellcode

1
2
3
4
5
6
  RegConsoleCmd("sm_shop", DOMenu);
	RegConsoleCmd("sm_credits", VerCreditos);
	RegConsoleCmd("sm_newlive", Resucitar);
	RegConsoleCmd("sm_medic", Curarse);

	RegAdminCmd("sm_setcredits", FijarCreditos, ADMFLAG_ROOT);



meine sah so aus :D

16

Donnerstag, 25. April 2013, 20:34

sooooo nun funkt alles soweit :D nur eine frage habe ich den wert 0 bei maxi male credits machen müsste ja eing bis 9999 credits bzw mehr gehn oder ? eing ja ^^ problem ist wenn ich denn wert auf 0 habe sagt er mir an nach ein kill das ich maximale credits habe ): und wenn ich auf 99999 setzte genau so kann mir da einer helfen ?

es sollte schon bis 9999999 gehn aber es funkt net ):

Quellcode

1
2
3
cvarCreditsMax = CreateConVar("awards_credits_max", "999999", "max of credits allowed (0: No limit)");
	cvarCreditsKill = CreateConVar("awards_credits_kill", "1", "credits for kill");
	cvarCreditsSave = CreateConVar("awards_credits_save", "1", "enable or disable that credits can be saved");



so es ist egal welchen wert ich mache es werden keine credits zu geschrieben ausser mitn befehl aber das ist nicht der sinn des plugins

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »iNSANNE« (25. April 2013, 20:41)


Ähnliche Themen