-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxCraft.pwn
593 lines (530 loc) · 24.7 KB
/
xCraft.pwn
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
/* --------------------------------
... xCraft ...
Version (1.0)
=> Scripted by
(inv3rse) a.k.a (Inverse)
Email: [email protected]
Personal Blog: inv3rse.cf
------------------------------------ */
#define FILTERSCRIPT
//-----------------------------------------------------------------------------------------------------------------------------
/* Preprocessor Directives
----------------------------- */
//Includes
#include <a_samp>
#include <a_mysql>
#include <YSI\y_commands>
#include <YSI\y_master>
//Defines (Equipments)
#define SmallBomb 1
#define NormalBomb 2
#define HeavyBomb 3
#define M4 4
#define AK47 5
#define RPG 6
#define Grenade 7
#define Hat 8
#define Glasses 9
#define Armour 10
//Defines (Materials)
#define Dynamite 1
#define ElectronicWire 2
#define RemoteTrigger 3
#define WoodenStock 4
#define PlasticStock 5
#define AK47Magazine 6
#define M4Magazine 7
#define GunReceiver 8
#define GunBarrel 9
#define RPGGrenade 10
#define RPGLauncher 11
#define SafetyPin 12
#define MechanicalFuse 13
#define TNT 14
#define HatCloth 15
#define Cardboard 16
#define Plastic 17
#define Lenses 18
#define ArmourFabric 19
#define MetalPlate 20
//Defines (MySQL)
#define MySQL_HOST localhost
#define MySQL_USER root
#define MySQL_PASS 123
#define MySQL_DATABASE inv3rse
//Defines (Dialog ID's)
#define DIALOG_BUYMATERIALS 7628147
#define DIALOG_CRAFT 7628148
#define DIALOG_INVENTORY 7628149
//Defines (Materials' Shop Coordinates)
#define ShopX 0.0
#define ShopY 0.0
#define ShopZ 0.0
//Defines (Materials' Prices)
#define DynamitePrice 0
#define ElectronicWirePrice 0
#define RemoteTriggerPrice 0
#define WoodenStockPrice 0
#define PlasticStockPrice 0
#define AK47MagazinePrice 0
#define M4MagazinePrice 0
#define GunReceiverPrice 0
#define GunBarrelPrice 0
#define RPGGrenadePrice 0
#define RPGLauncherPrice 0
#define SafetyPinPrice 0
#define MechanicalFusePrice 0
#define TNTPrice 0
#define HatClothPrice 0
#define CardboardPrice 0
#define PlasticPrice 0
#define LensesPrice 0
#define ArmourFabricPrice 0
#define MetalPlatePrice 0
//Defines (Colour Defines)
#define EmbedWhite "{FFFFFF}"
#define EmbedRed "{FF0000}"
#define EmbedOrange "{FFA500}"
#define EmbedYellow "{FFFF00}"
#define EmbedGreen "{008000}"
#define EmbedBlue "{42C0FB}"
#define EmbedTeal "{008080}"
//-----------------------------------------------------------------------------------------------------------------------------
/* Data Storage
------------------ */
//Constants
enum xCraft
{
ORM:ORM_ID,
ID,
Name[MAX_PLAYER_NAME+1],
qSmallBomb,
qNormalBomb,
qHeavyBomb,
qM4,
qAK47,
qRPG,
qGrenade,
qHat,
qGlasses,
qArmour,
qDynamite,
qElectronicWire,
qRemoteTrigger,
qWoodenStock,
qPlasticStock,
qAK47Magazine,
qM4Magazine,
qGunReceiver,
qGunBarrel,
qRPGGrenade,
qRPGLauncher,
qSafetyPin,
qMechanicalFuse,
qTNT,
qHatCloth,
qCardboard,
qPlastic,
qLenses,
qArmourFabric,
qMetalPlate
};
//Variables
new xInfo[MAX_PLAYERS][xCraft];
new PlayerHasPlantedBomb[MAX_PLAYERS];
//-----------------------------------------------------------------------------------------------------------------------------
/* Functions
--------------- */
//Custom Functions
ShowMaterialsToPlayer(playerid)
{
new str1[500], str2[250];
format(str1, sizeof(str1), ""EmbedWhite"Dynamite (%i)\nElectronic Wire (%i)\nRemote Trigger (%i)\nWooden Stock (%i)\nPlastic Stock (%i)\nAK-47 Magazine (%i)\nM4 Magazine (%i)\nGun Receiver (%i)\nGun Barrel (%i)\nRPG Grenade (%i)", xInfo[playerid][qDynamite], xInfo[playerid][qElectronicWire], xInfo[playerid][qRemoteTrigger], xInfo[playerid][qWoodenStock], xInfo[playerid][qPlasticStock], xInfo[playerid][qAK47Magazine], xInfo[playerid][qM4Magazine], xInfo[playerid][qGunReceiver], xInfo[playerid][qGunBarrel], xInfo[playerid][qRPGGrenade]);
format(str2, sizeof(str2), "\nRPG Launcher (%i)\nSafety Pin (%i)\nMechanical Fuse (%i)\nTNT (%i)\nHat Cloth (%i)\nCardboard (%i)\nPlastic (%i)\nLenses (%i)\nArmour Fabric (%i)\nMetal Plate (%i)", xInfo[playerid][qRPGLauncher], xInfo[playerid][qSafetyPin], xInfo[playerid][qMechanicalFuse], xInfo[playerid][qTNT], xInfo[playerid][qHatCloth], xInfo[playerid][qCardboard], xInfo[playerid][qPlastic], xInfo[playerid][qLenses], xInfo[playerid][qArmourFabric], xInfo[playerid][qMetalPlate]);
strcat(str1, str2, sizeof(str1));
ShowPlayerDialog(playerid, DIALOG_BUYMATERIALS, DIALOG_STYLE_LIST, ""EmbedTeal"Materials Shop!", str1, "Buy!", "Cancel");
PlayerPlaySound(playerid, 4203, 0, 0, 0);
}
forward OnPlayerDataLoad(playerid);
public OnPlayerDataLoad(playerid)
{
orm_setkey(xInfo[playerid][ORM_ID], "ID");
switch(orm_errno(xInfo[playerid][ORM_ID])) {
case ERROR_NO_DATA: {
orm_insert(xInfo[playerid][ORM_ID]);
}
}
return true;
}
//-----------------------------------------------------------------------------------------------------------------------------
//Callbacks
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" |xCraft (v1.0) by inv3rse loaded!| ");
print("--------------------------------------\n");
mysql_connect(MySQL_HOST, MySQL_USER, MySQL_DATABASE, MySQL_PASS);
Command_AddAltNamed("inventory", "inv");
return true;
}
public OnPlayerConnect(playerid)
{
GetPlayerName(playerid, xInfo[playerid][Name], MAX_PLAYER_NAME);
new ORM:ormid = xInfo[playerid][ORM_ID] = orm_create("xInfo");
orm_addvar_int(ormid, xInfo[playerid][ID], "ID");
orm_addvar_string(ormid, xInfo[playerid][Name], MAX_PLAYER_NAME+1, "Name");
//Equipments
orm_addvar_int(ormid, xInfo[playerid][qSmallBomb], "Small Bombs");
orm_addvar_int(ormid, xInfo[playerid][qNormalBomb], "Normal Bombs");
orm_addvar_int(ormid, xInfo[playerid][qHeavyBomb], "Heavy Bombs");
orm_addvar_int(ormid, xInfo[playerid][qM4], "M4");
orm_addvar_int(ormid, xInfo[playerid][qAK47], "AK-47");
orm_addvar_int(ormid, xInfo[playerid][qRPG], "RPG");
orm_addvar_int(ormid, xInfo[playerid][qGrenade], "Grenades");
orm_addvar_int(ormid, xInfo[playerid][qHat], "Hats");
orm_addvar_int(ormid, xInfo[playerid][qGlasses], "Glasses");
orm_addvar_int(ormid, xInfo[playerid][qArmour], "Armours");
//Materials
orm_addvar_int(ormid, xInfo[playerid][qDynamite], "Dynamites");
orm_addvar_int(ormid, xInfo[playerid][qElectronicWire], "Electronic Wires");
orm_addvar_int(ormid, xInfo[playerid][qRemoteTrigger], "Remote Triggers");
orm_addvar_int(ormid, xInfo[playerid][qWoodenStock], "Wooden Stocks");
orm_addvar_int(ormid, xInfo[playerid][qPlasticStock], "Plastic Stocks");
orm_addvar_int(ormid, xInfo[playerid][qAK47Magazine], "AK-47 Magazines");
orm_addvar_int(ormid, xInfo[playerid][qM4Magazine], "M4 Magazines");
orm_addvar_int(ormid, xInfo[playerid][qGunReceiver], "Gun Receivers");
orm_addvar_int(ormid, xInfo[playerid][qGunBarrel], "Gun Barrels");
orm_addvar_int(ormid, xInfo[playerid][qRPGGrenade], "RPG Grenades");
orm_addvar_int(ormid, xInfo[playerid][qRPGLauncher], "RPG Launchers");
orm_addvar_int(ormid, xInfo[playerid][qSafetyPin], "Safety Pins");
orm_addvar_int(ormid, xInfo[playerid][qMechanicalFuse], "Mechanical Fuses");
orm_addvar_int(ormid, xInfo[playerid][qTNT], "TNT");
orm_addvar_int(ormid, xInfo[playerid][qHatCloth], "Hat Cloths");
orm_addvar_int(ormid, xInfo[playerid][qCardboard], "Cardboards");
orm_addvar_int(ormid, xInfo[playerid][qPlastic], "Plastics");
orm_addvar_int(ormid, xInfo[playerid][qLenses], "Lenses");
orm_addvar_int(ormid, xInfo[playerid][qArmourFabric], "Armour Fabrics");
orm_addvar_int(ormid, xInfo[playerid][qMetalPlate], "Metal Plates");
orm_setkey(ormid, "Name");
orm_select(ormid, "OnPlayerDataLoad", "d", playerid);
return true;
}
public OnPlayerDisconnect(playerid, reason)
{
PlayerHasPlantedBomb[playerid] = false;
if(xInfo[playerid][ID] != 0) orm_update(xInfo[playerid][ORM_ID]);
orm_destroy(xInfo[playerid][ORM_ID]);
for(new xCraft:e; e < xCraft; ++e) {
xInfo[playerid][e] = 0;
}
return true;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch (dialogid) {
case DIALOG_BUYMATERIALS: {
if(!response) return false;
switch (listitem) {
case 0: {
if(GetPlayerMoney(playerid) >= DynamitePrice)
{
GivePlayerMoney(playerid, -(DynamitePrice));
xInfo[playerid][qDynamite] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Dynamite!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 1: {
if(GetPlayerMoney(playerid) >= ElectronicWirePrice)
{
GivePlayerMoney(playerid, -(ElectronicWirePrice));
xInfo[playerid][qElectronicWire] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased an "EmbedTeal"Electronic Wire!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 2: {
if(GetPlayerMoney(playerid) >= RemoteTriggerPrice)
{
GivePlayerMoney(playerid, -(RemoteTriggerPrice));
xInfo[playerid][qRemoteTrigger] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Remote Trigger!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 3: {
if(GetPlayerMoney(playerid) >= WoodenStockPrice)
{
GivePlayerMoney(playerid, -(WoodenStockPrice));
xInfo[playerid][qWoodenStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Wooden Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 4: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 5: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 6: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 7: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 8: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 9: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 10: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 11: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 12: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 13: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 14: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 15: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 16: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 17: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 18: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
case 19: {
if(GetPlayerMoney(playerid) >= PlasticStockPrice)
{
GivePlayerMoney(playerid, -(PlasticStockPrice));
xInfo[playerid][qPlasticStock] += 1;
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You have successfully purchased a "EmbedTeal"Plastic Stock!");
ShowMaterialsToPlayer(playerid);
}
else
{
SendClientMessage(playerid, -1, ""EmbedTeal"Materials Shop: "EmbedWhite"You don't have enough money to purchase that material.");
ShowMaterialsToPlayer(playerid);
}
}
}
return true;
}
}
return false;
}
//-----------------------------------------------------------------------------------------------------------------------------
//Commands
YCMD:buymaterials(playerid, params[]) {
if(!IsPlayerInRangeOfPoint(playerid, 4.0, ShopX, ShopY, ShopZ)) return SendClientMessage(playerid, -1, ""EmbedTeal"ERROR: "EmbedWhite"You are not near a materials shop!");
ShowMaterialsToPlayer(playerid);
return true;
}
YCMD:price(playerid, params[]) {
if(!IsPlayerInRangeOfPoint(playerid, 4.0, ShopX, ShopY, ShopZ)) return SendClientMessage(playerid, -1, ""EmbedTeal"ERROR: "EmbedWhite"You are not near a materials shop!");
return true;
}
YCMD:craft(playerid, params[]) {
return true;
}
YCMD:inventory(playerid, params[]) {
return true;
}