View difference between Paste ID: SvQt5MM5 and yRTSP5zf
SHOW: | | - or go back to the newest paste.
1
StartEvent()
2
{
3
	new string[256];
4
    if(DostupanEvent == 1)
5
	{
6
		MoveDynamicObject(ChiliadStart, -2259.64, -2126.86,30,5, -1000, -1000, -1000);
7
		SetTimerEx("CloseGate", 8000, 0, "i", 9);
8
	}
9
	if(DostupanEvent == 2)
10
	{
11
		MoveDynamicObject(SFRaceGate1, -2930.87, 1168.25,4.65,5, -1000, -1000, -1000);
12
		MoveDynamicObject(SFRaceGate2, -2962.4, 1168.25,4.65,5, -1000, -1000, -1000);
13
		SetTimerEx("CloseGate", 8000, 0, "i", 10);
14
	}
15
	if(DostupanEvent == 3)
16
	{
17
		MoveDynamicObject(RCStart, -106.12,66.41, -5,5, -1000, -1000, -1000);
18
		SetTimerEx("CloseGate", 8000, 0, "i", 11);
19
	}
20
	if(DostupanEvent == 4)
21
	{
22
		MoveDynamicObject(HJGate[0], 1095.52, 2531.9, 5.5, 5, -1000, -1000, -1000);
23
		MoveDynamicObject(HJGate[1], 1076.32, 2531.9, 5.5, 5, -1000, -1000, -1000);
24
		SetTimerEx("CloseGate", 8000, 0, "i", 14);
25
	}
26
	if(DostupanEvent == 5)
27
	{
28
		MoveDynamicObject(DakarGate[0], -33.6, 2493.5, 10.2, 5, -1000, -1000, -1000);
29
		MoveDynamicObject(DakarGate[1], -33.6, 2512.69, 10.2, 5, -1000, -1000, -1000);
30
		SetTimerEx("CloseGate", 8000, 0, "i", 15);
31
	}
32
	DostupanEvent = 255;
33
	PortEnable = 0;
34
35
	for(new i = 0; i < MAX_PLAYERS; i++)
36
	{
37
	    if(IsPlayerConnected(i))
38
	    {
39
	        if(IsOnEvent(i))
40
	        {
41
				SendClientMessage(i,COLOR_YELLOW," ORGANIZACIJA EVENTA: Dakar je upravo poceo!");
42
				GameTextForPlayer(i,"~y~srecno!", 3000, 3);
43
44
	            if(SFrCP[i] > 1 || RCTourCP[i] > 1 || ChiliadCP[i] > 1 || HJCP[i] > 1 || GetPVarInt(i, "Dakar") > 1)
45
	        	{
46
	        	    format(string, 256," * "#COL_WHITE"%s"#COL_RED" je dobio kick zbog varanja na eventu.",pName(i));
47
	        	    SendClientMessageToAll(COLOR_RED,string);
48
	        	    KickEx(i);
49
     	    	}
50
			}
51
		}
52
	}
53
	return 1;
54
}
55
56
	//--------------------------------------------------
57
public OnRconLoginAttempt(ip[], password[], success)
58
{
59
	new pip[64];
60
61
	for(new i = 0; i < MAX_PLAYERS; i++)
62
	{
63
		if(!IsAdmin(i, 1338) && success)
64
		{
65
		    GetPlayerIp(i, pip, 24);
66
		    if(IsSame(pip, ip))
67
		    {
68
				ClearChatBox(i,25);
69
				SERVER(i, "Zabranjeno je koristenje RCONa - Kick.");
70
				KickEx(i);
71
			}
72
		}
73
 	}
74
 	return 1;
75
}
76
77
BanLog(string[]) // Svi logovi su u ScriptFiles > UF > Logs
78
{
79
	new entry[512];
80
	format(entry, sizeof(entry), "%s\r\n",string);
81
	new File:hFile;
82
	hFile = fopen("UF/Logs/ban.log", io_append);
83
	fwrite(hFile, entry);
84
	fclose(hFile);
85
	return 1;
86
}
87
88
KickLog(string[])
89
{
90
	new entry[512];
91
	format(entry, sizeof(entry), "%s\r\n",string);
92
	new File:hFile;
93
	hFile = fopen("UF/Logs/kick.log", io_append);
94
	fwrite(hFile, entry);
95
	fclose(hFile);
96
	return 1;
97
}
98
99
MoneyLog(string[])
100
{
101
	new entry[512];
102
	format(entry, sizeof(entry), "%s\r\n",string);
103
	new File:hFile;
104
	hFile = fopen("UF/Logs/novac.log", io_append);
105
	fwrite(hFile, entry);
106
	fclose(hFile);
107
	return 1;
108
}
109
110
CreateLog(string[])
111
{
112
	new entry[512];
113
	format(entry, sizeof(entry), "%s\r\n",string);
114
	new File:hFile;
115
	hFile = fopen("UF/Logs/create.log", io_append);
116
	fwrite(hFile, entry);
117
	fclose(hFile);
118
	return 1;
119
}
120
121
MakeLog(string[])
122
{
123
	new entry[512];
124
	format(entry, sizeof(entry), "%s\r\n",string);
125
	new File:hFile;
126
	hFile = fopen("UF/Logs/make.log", io_append);
127
	fwrite(hFile, entry);
128
	fclose(hFile);
129
	return 1;
130
}
131
132
RenameLog(string[])
133
{
134
	new entry[512];
135
	format(entry, sizeof(entry), "%s\r\n",string);
136
	new File:hFile;
137
	hFile = fopen("UF/Logs/rename.log", io_append);
138
	fwrite(hFile, entry);
139
	fclose(hFile);
140
	return 1;
141
}
142
143
SayLog(string[])
144
{
145
	new entry[512];
146
	format(entry, sizeof(entry), "%s\r\n",string);
147
	new File:hFile;
148
	hFile = fopen("UF/Logs/say.log", io_append);
149
	fwrite(hFile, entry);
150
	fclose(hFile);
151
	return 1;
152
}
153
154
WarnLog(string[])
155
{
156
	new entry[512];
157
	format(entry, sizeof(entry), "%s\r\n",string);
158
	new File:hFile;
159
	hFile = fopen("UF/Logs/warn.log", io_append);
160
	fwrite(hFile, entry);
161
	fclose(hFile);
162
	return 1;
163
}
164
165
TeamLog(string[])
166
{
167
	new entry[512];
168
	format(entry, sizeof(entry), "%s\r\n",string);
169
	new File:hFile;
170
	hFile = fopen("UF/Logs/team.log", io_append);
171
	fwrite(hFile, entry);
172
	fclose(hFile);
173
	return 1;
174
}
175
176
LoginLog(string[])
177
{
178
	new entry[512];
179
	format(entry, sizeof(entry), "%s\r\n",string);
180
	new File:hFile;
181
	hFile = fopen("UF/Logs/login.log", io_append);
182
	fwrite(hFile, entry);
183
	fclose(hFile);
184
	return 1;
185
}
186
187
BiznisLog(string[])
188
{
189
	new entry[512];
190
	format(entry, sizeof(entry), "%s\r\n",string);
191
	new File:hFile;
192
	hFile = fopen("UF/Logs/biznis.log", io_append);
193
	fwrite(hFile, entry);
194
	fclose(hFile);
195
	return 1;
196
}
197
198
CommandLog(string[])
199
{
200
	new entry[512];
201
	format(entry, sizeof(entry), " (%s) %s\r\n", PrintDate(), string);
202
	new File:hFile;
203
	hFile = fopen("UF/Logs/cmds.log", io_append);
204
	fwrite(hFile, entry);
205
	fclose(hFile);
206
	return 1;
207
}
208
209
PropertyLog(string[])
210
{
211
	new entry[512];
212
	format(entry, sizeof(entry), " (%s - %s) %s\r\n", PrintDate(), PrintTime(1), string);
213
	new File:hFile;
214
	hFile = fopen("UF/Logs/cmds.log", io_append);
215
	fwrite(hFile, entry);
216
	fclose(hFile);
217
	return 1;
218
}
219
220
AdminKomande(playerid, level)   // totalni remont prebacivanjem na RP (1,2,3,4,1337,1338 + big edit po levelima), edit 12.09.13
221
{
222
 	if(level == 1)
223
	{
224
		SendClientMessage(playerid, COLOR_LGREEN," 1 ADMIN:"#COL_WHITE" /a /am /duty /cc /removeveh /recon(off) /teles /checkbiz /clnews /kick /goto /banip");
225
		SendClientMessage(playerid, COLOR_LGREEN," 1 ADMIN:"#COL_WHITE" /masked /prisoned /cmc /pweapons /freeze /mute(d) /conut /check /slap /afriskbag");
226
	}
227
	if(level == 2)
228
	{
229
		SendClientMessage(playerid, COLOR_LGREEN," 2 ADMIN:"#COL_WHITE" /ban /gethere /settime /eventstart /startevent /setweather /say /disarm /jail /flip");
230
		SendClientMessage(playerid, COLOR_LGREEN," 2 ADMIN:"#COL_WHITE" /warn /rac /getip /setint /setvw /open(close)cell /maindoor /unmute /auntie /players");
231
	}
232
	if(level == 3)
233
	{
234
		SendClientMessage(playerid, COLOR_LGREEN," 3 ADMIN:"#COL_WHITE" /write /unwarn /charge /setskin /givegun /spawn /crash/pickupo /bizo /gotoxxx");
235
		SendClientMessage(playerid, COLOR_LGREEN," 3 ADMIN:"#COL_WHITE" /mark /gotomark /aerogate /dsc /sethp /setarmour /fly /getcar /gotocar");
236
	}
237
	if(level == 4)
238
	{
239
	    SendClientMessage(playerid, COLOR_LGREEN," 4 ADMIN:"#COL_WHITE" /veh /givegun /givemoney /setmoney /msg /setteam /unjail /skladiste /setvehgas");
240
		SendClientMessage(playerid, COLOR_LGREEN," 4 ADMIN:"#COL_WHITE" /houseo /offban /fixcar /fuelcars /bizenterpos /bizexitpos /nch /resetad");
241
	}
242
	if(level == 1337)
243
	{
244
	    SendClientMessage(playerid, COLOR_LGREEN," 1337 ADMIN:"#COL_WHITE" /makeleader /makeircadmin /baninfo /reloadch /edit /editpickup /hinfo /asellbiz");
245
		SendClientMessage(playerid, COLOR_LGREEN," 1337 ADMIN:"#COL_WHITE" /edithouse /houseint /gmx /asellhouse /cde /editcharge ");
246
	}
247
	if(level == 1338)
248
	{
249
	    SendClientMessage(playerid, COLOR_LGREEN," 1338 ADMIN:"#COL_WHITE" /makeadmin /makegm /control /unban /setstat /savedata /createpickup /createbiz");
250
	    SendClientMessage(playerid, COLOR_LGREEN," 1338 ADMIN:"#COL_WHITE" /deleteacc /housetome");
251
	}
252
	return 1;
253
}
254
255
GMKomande(playerid, level) // dodat lvl3 prebacivanjem na RP + promjena komandi po levelima, edit 12.09.13
256
{
257
	if(level == 1)
258
	{
259
	    SendClientMessage(playerid, COLOR_LIGHTBLUE,"  Level "#COL_WHITE"1"#COL_LIGHTBLUE" GameMaster");
260
		SendClientMessage(playerid, COLOR_WHITE,"   /duty /a /gmm /pm /kick /goto /check /muted /recon(off) /pweapons /muted");
261
		SendClientMessage(playerid, COLOR_WHITE,"   /cmc /pweapons /muted /gotols /gotolv /gotosf /prisoned /gotoevent /count");
262
	}
263
	if(level == 2)
264
	{
265
	    SendClientMessage(playerid, COLOR_LIGHTBLUE,"  Level "#COL_WHITE"2"#COL_LIGHTBLUE" GameMaster");
266
		SendClientMessage(playerid, COLOR_WHITE,"   /rtc /banip /mute /cc /disarm /slap /gotoahq /gotomats /gotojail /gotobank");
267
		SendClientMessage(playerid, COLOR_WHITE,"   /freeze /setint /afrikbag /gotoaero /auntie /setint /setvw");
268
	}
269
	if(level == 3)
270
	{
271
	    SendClientMessage(playerid, COLOR_LIGHTBLUE,"  Level "#COL_WHITE"3"#COL_LIGHTBLUE" GameMaster");
272
		SendClientMessage(playerid, COLOR_WHITE,"   /players /checkbiz /unmute /getip /removeveh /disarm /rac /skladiste /say");
273
		SendClientMessage(playerid, COLOR_WHITE,"   /setskin /aerogate /fly /write /msg");
274
	}
275
	return 1;
276
}
277
278
JailUpdate(playerid) // Update 16.02.13
279
{
280
	if(!Ulogovan[playerid]) return 1;
281
	if(IsPlayerInArea(playerid, 95, 1797, 334, 1942, -32, 14) || IsPlayerInArea(playerid, 95, 1797, 287.5, 1942, -32, 40)) return 1;
282
 	SetPlayerPosEx(playerid, 271.68, 1858.13, 8.75, 0, 0, 0);
283
	GameTextForPlayer(playerid, "~r~ne napustajte areu!", 3000, 3);
284
	return 1;
285
}
286
287
JailFree(playerid, mode) // Kraj jaila
288
{
289
	new sendername[24],
290
		string[256];
291
	GetPlayerName(playerid, sendername, 24);
292
	PlayerSound(playerid, 1053);
293
	PlayerInfo[playerid][pJailed] = 0;
294
	PlayerInfo[playerid][pJailTime] = 0;
295
	TextDrawHideForPlayer(playerid, JailTimer[playerid]);
296
	SendClientMessage(playerid,COLOR_YELLOW," ["#COL_WHITE"SLOBODA"#COL_YELLOW"] - Potrudite se da vise ne zavrsavate u zatvoru.");
297
	format(string, 256," ** %s je istekla kazna u Arei 69.", sendername);
298
	if(mode == 2) AdminBoard(1, COLOR_RED, string);
299
	GameTextForPlayer(playerid,"~g~slobodni ste.~n~ ~w~pokusajte biti bolji od sad.",5000, 1);
300
301
	if(mode == 1) SetPlayerPosEx(playerid, 1552.73, -1675.63, 16.19, 0, 0, 0);
302
	if(mode == 2) SetPlayerPosEx(playerid, 89.08, 1920.33, 17.9, 0, 0, 0); // area free
303
 	return 1;
304
}
305
306
PayDay(playerid)    // rebuild on 17.09.13
307
{
308
	new string[512],
309
	    expneed,
310
	    hKey,
311
	    rKey,
312
	    bKey,
313
	    plata,
314
	    struja,
315
	    stanarina,
316
	    porez,
317
	    kredit,
318
		kamata[3];
319
320
	expneed = PlayerInfo[playerid][pLevel]*4+4;
321
	PlayerInfo[playerid][pRespekti] ++;
322
	PlayerInfo[playerid][pHours] ++;
323
	PlayerInfo[playerid][pPayDayTimer] = 3600;
324
	PlayerInfo[playerid][pJobFree] = 0;
325
	PlayerInfo[playerid][pDutyGuns] = 0;
326
327
	if(PlayerInfo[playerid][pHouseKey] < 999) hKey = PlayerInfo[playerid][pHouseKey];
328
	if(PlayerInfo[playerid][pRentKey] < 999) rKey = PlayerInfo[playerid][pRentKey];
329
	if(PlayerInfo[playerid][pBizKey] < 999) bKey = PlayerInfo[playerid][pBizKey];
330
	if(PlayerInfo[playerid][pJob] >= 1)
331
	{
332
	    PlayerInfo[playerid][pUgovor] ++;
333
	    plata = 50 + PlayerInfo[playerid][pUgovor]/2 + random(25);
334
	}
335
	if(PlayerInfo[playerid][pHouseKey] < 349)
336
	{
337
		hKey = PlayerInfo[playerid][pHouseKey];
338
		struja = HouseInfo[hKey][hPrice]/1000 + random(20);
339
	}
340
	if(PlayerInfo[playerid][pRentKey] < 349)
341
	{
342
	    rKey = PlayerInfo[playerid][pRentKey];
343
		if(SafeGetPlayerMoney(playerid) < HouseInfo[rKey][hRentPrice])
344
		{
345
		    SendClientMessage(playerid, COLOR_RED," Izbaceni ste iz kuce, jer niste u stanju da platite stanarinu.");
346
		    PlayerInfo[playerid][pRentKey] = 999;
347
		    rKey = 999;
348
  		}
349
  		if(SafeGetPlayerMoney(playerid) >= HouseInfo[rKey][hRentPrice])
350
  		{
351
  		    stanarina = HouseInfo[rKey][hRentPrice];
352
  		    SafeGivePlayerMoney(playerid, -stanarina);
353
  		    HouseInfo[rKey][hRentPrice] += stanarina;
354
    	}
355
	}
356
	if(PlayerInfo[playerid][pBizKey] != 255)
357
	{
358
	    bKey = PlayerInfo[playerid][pBizKey];
359
	    porez = Biznis[bKey][Cijena] / 500 + random(40);
360
	    ServerInfo[sBudzet] += porez;
361
	}
362
	if(PlayerInfo[playerid][pCredit] >= 1)
363
	{
364
	    PlayerInfo[playerid][pRate] --;
365
	    if(PlayerInfo[playerid][pCredit] == 1) kredit = 220;
366
	    if(PlayerInfo[playerid][pCredit] == 2) kredit = 550;
367
	    if(PlayerInfo[playerid][pCredit] == 3) kredit = 1100;
368
	  	if(PlayerInfo[playerid][pPovjerioc] == 1) Biznis[3][Blagajna] += kredit/11;
369
	   	if(PlayerInfo[playerid][pPovjerioc] == 2) Biznis[26][Blagajna] += kredit/11;
370
	    if(PlayerInfo[playerid][pPovjerioc] == 3) Biznis[27][Blagajna] += kredit/11;
371
	    if(PlayerInfo[playerid][pPovjerioc] == 1) PlayerInfo[playerid][pLsBank] -= kredit;
372
	    if(PlayerInfo[playerid][pPovjerioc] == 2) PlayerInfo[playerid][pLvBank] -= kredit;
373
	    if(PlayerInfo[playerid][pPovjerioc] == 3) PlayerInfo[playerid][pSfBank] -= kredit;
374
	    if(!PlayerInfo[playerid][pRate])
375
	    {
376
	        SendClientMessage(playerid, COLOR_LYELLOW," Otplatili ste poslednju ratu kredita. Sada mozete dici novi.");
377
	        PlayerInfo[playerid][pCredit] = 0;
378
	        PlayerInfo[playerid][pPovjerioc] = 0;
379
     	}
380
	}
381
	kamata[0] = PlayerInfo[playerid][pLsBank]/750;
382
	kamata[1] = PlayerInfo[playerid][pLvBank]/750;
383
	kamata[2] = PlayerInfo[playerid][pSfBank]/750;
384
385
	if(PlayerInfo[playerid][pLsBank] >= struja && struja > 0)
386
	{
387
		PlayerInfo[playerid][pLsBank] -= struja;
388
		struja = 0;
389
	}
390
	if(PlayerInfo[playerid][pSfBank] >= struja && struja > 0)
391
	{
392
		PlayerInfo[playerid][pSfBank] -= struja;
393
		struja = 0;
394
	}
395
	if(struja > 0)
396
	{
397
		PlayerInfo[playerid][pLvBank] -= struja;
398
		struja = 0;
399
	}
400
	if(PlayerInfo[playerid][pLsBank] >= porez && porez > 0)
401
	{
402
		PlayerInfo[playerid][pLsBank] -= porez;
403
		struja = 0;
404
	}
405
	if(PlayerInfo[playerid][pSfBank] >= porez && porez > 0)
406
	{
407
		PlayerInfo[playerid][pSfBank] -= porez;
408
		struja = 0;
409
	}
410
	if(porez > 0)
411
	{
412
		PlayerInfo[playerid][pLvBank] -= porez;
413
		struja = 0;
414
	}
415
	PlayerInfo[playerid][pLsBank] += kamata[0];
416
	PlayerInfo[playerid][pSfBank] += kamata[1];
417
	PlayerInfo[playerid][pLvBank] += kamata[2];
418
419
	if(PlayerInfo[playerid][pSpawnHealth] < 100.0) PlayerInfo[playerid][pSpawnHealth] += 0.5;
420
421
	GorivoTextdraws(playerid, 0);
422
	if(PlayerInfo[playerid][pRespekti] >= expneed)
423
	{
424
	    PlayerInfo[playerid][pLevel] ++;
425
	    PlayerInfo[playerid][pRespekti] = 0;
426
	    if(PlayerInfo[playerid][pJob] >= 1) plata += PlayerInfo[playerid][pLevel];
427
428
		format(string, 512, "~g~P A Y D A Y~n~Dobili ste level ~w~%d~g~!~n~~y~Plata:~w~ %d$~n~~y~Kamata:~w~ %d$~n~~r~Struja: ~w~%d$~n~~r~Stanarina: ~w~%d$~n~~r~Porez: ~w~%d$~n~~r~Kredit:~w~ %d$",
429
		PlayerInfo[playerid][pLevel], plata, kamata[0]+kamata[1]+kamata[2], struja, stanarina, porez, kredit);
430
		TextDrawSetString(PayDayTD[playerid], string);
431
 	    TextDrawShowForPlayer(playerid, PayDayTD[playerid]);
432
 	    TextDrawShowForPlayer(playerid, Time);
433
 	    SetPVarInt(playerid, "PayDayTextDraw", 1);
434
 	    return 1;
435
	}
436
	if(PlayerInfo[playerid][pRespekti] < expneed)
437
	{
438
	    if(PlayerInfo[playerid][pJob] >= 1) plata += PlayerInfo[playerid][pLevel];
439
	    format(string, 512, "~g~P A Y D A Y~n~Respekti: ~w~%d/%d~g~!~n~~n~~y~Plata:~w~ %d$~n~~y~Kamata:~w~ %d$~n~~r~Struja: ~w~%d$~n~~r~Stanarina: ~w~%d$~n~~r~Porez: ~w~%d$~n~~r~Kredit: ~w~%d$~n~~n~~y~ENTER~w~ da sakrijete",
440
		PlayerInfo[playerid][pRespekti], expneed, plata, kamata[0]+kamata[1]+kamata[2], struja, stanarina, porez, kredit);
441
		TextDrawSetString(PayDayTD[playerid], string);
442
 	    TextDrawShowForPlayer(playerid, PayDayTD[playerid]);
443
 	    TextDrawShowForPlayer(playerid, Time);
444
 	    SetPVarInt(playerid, "PayDayTextDraw", 1);
445
	}
446
	return 1;
447
}
448
449
public CountStart()
450
{
451
	new string[512];
452
	if(Count == 0)
453
	{
454
    	SoundForAll(1057);
455
	    Count = -1;
456
	 	GameTextForAll("~r~-~w~ GO GO GO~w~ ~r~-", 1000,6);
457
		if(DostupanEvent != 255)
458
		{
459
	 		StartEvent();
460
		}
461
	}
462
	if(Count >= 1)
463
	{
464
		format(string, 256," ~w~- ~r~%d ~w~-",Count);
465
		GameTextForAll(string, 800, 6);
466
		Count --;
467
		SoundForAll(1052);
468
 	}
469
	return 1;
470
}
471
472
public ReportTimer(playerid)
473
{
474
	JustReported[playerid] = 0; // Moze se opet poslati report
475
	return 1;
476
}
477
478
SoundForAll(soundid)
479
{
480
	for(new i = 0; i < MAX_PLAYERS; i++)
481
	{
482
	    if(IsPlayerConnected(i)) PlayerSound(i, soundid);
483
	}
484
	return 1;
485
}
486
487
Slap(playerid, metri) // upisete recimo Slap(playerid, 100); i server slapa igraca za 100 metara
488
{
489
	if(IsPlayerConnected(playerid))
490
	{
491
		new Float:Pos[3];
492
		GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
493
		SetPlayerPosEx(playerid, Pos[0], Pos[1], Pos[2]+metri, 0, ScriptInterior[playerid], GetPlayerVirtualWorld(playerid));
494
	}
495
	return 1;
496
}
497
498
LoadSkladiste()
499
{
500
	Skladiste[UkupnoMaterijala] = dini_Int(SKLADISTE, "UkupnoMaterijala");
501
 	Skladiste[CijenaMatsa] = dini_Int(SKLADISTE, "CijenaMatsa");
502
   	Skladiste[UpdateTimer] = dini_Int(SKLADISTE, "UpdateTimer");
503
    Skladiste[UpdateCountDown] = dini_Int(SKLADISTE, "UpdateCountDown");
504
    Skladiste[PunoSkladiste] = dini_Int(SKLADISTE, "PunoSkladiste");
505
    PrintLines(1);
506
    return 1;
507
}
508
509
SaveSkladiste()
510
{
511
    dini_IntSet(SKLADISTE, "UkupnoMaterijala", Skladiste[UkupnoMaterijala]);
512
    dini_IntSet(SKLADISTE, "CijenaMatsa", Skladiste[CijenaMatsa]);
513
    dini_IntSet(SKLADISTE, "UpdateTimer", Skladiste[UpdateTimer]);
514
    dini_IntSet(SKLADISTE, "UpdateCountDown", Skladiste[UpdateCountDown]);
515
    dini_IntSet(SKLADISTE, "PunoSkladiste", Skladiste[PunoSkladiste]);
516
	return 1;
517
}
518
519
LoadServerstats()
520
{
521
	ServerInfo[sVisits] = dini_Int("UF/server.sav", "Visits");
522
	ServerInfo[sLogs] = dini_Int("UF/server.sav", "Logs");
523
	ServerInfo[sRegs] = dini_Int("UF/server.sav", "Regs");
524
	ServerInfo[sKicks] = dini_Int("UF/server.sav", "Kicks");
525
	ServerInfo[sBans] = dini_Int("UF/server.sav", "Bans");
526
	ServerInfo[sDeaths] = dini_Int("UF/server.sav", "Deaths");
527
	set(ServerInfo[sOwner], dini_Get("UF/server.sav", "Owner"));
528
	ServerInfo[sLoads] = dini_Int("UF/server.sav", "Loads");
529
	ServerInfo[sMaxPlayers] = dini_Int("UF/server.sav", "MaxPlayers");
530
	ServerInfo[sWeather] = dini_Int("UF/server.sav", "Weather");
531
	ServerInfo[sTime] = dini_Int("UF/server.sav", "Time");
532
	ServerInfo[sSpeed] = dini_Int("UF/server.sav", "Speed");
533
	ServerInfo[sExtazy] = dini_Int("UF/server.sav", "Extazy");
534
	ServerInfo[sMarihuana] = dini_Int("UF/server.sav", "Marihuana");
535
	ServerInfo[sSirovine] = dini_Int("UF/server.sav", "Sirovine");
536
	ServerInfo[sAccounts] = dini_Int("UF/server.sav", "Accounts");
537
	ServerInfo[sBudzet] = dini_Int("UF/server.sav", "Budzet");
538
	ServerInfo[sLottoFond] = dini_Int("UF/server.sav", "LottoFond");
539
	ServerInfo[sHitmanCode] = dini_Int("UF/server.sav", "HitmanCode");
540
	ServerInfo[sSrFuel] = dini_Int("UF/server.sav", "SrFuel");
541
	ServerInfo[sSrSlot1] = dini_Int("UF/server.sav", "SrSlot1");
542
	ServerInfo[sSrSlot2] = dini_Int("UF/server.sav", "SrSlot2");
543
	ServerInfo[sSrSlot3] = dini_Int("UF/server.sav", "SrSlot3");
544
	return 1;
545
}
546
547
SaveServerstats()
548
{
549
	dini_IntSet("UF/server.sav", "Visits", ServerInfo[sVisits]);
550
	dini_IntSet("UF/server.sav", "Logs", ServerInfo[sLogs]);
551
	dini_IntSet("UF/server.sav", "Regs", ServerInfo[sRegs]);
552
	dini_IntSet("UF/server.sav", "Kicks", ServerInfo[sKicks]);
553
	dini_IntSet("UF/server.sav", "Bans", ServerInfo[sBans]);
554
	dini_IntSet("UF/server.sav", "Deaths", ServerInfo[sDeaths]);
555
	dini_IntSet("UF/server.sav", "MaxPlayers", ServerInfo[sMaxPlayers]);
556
	dini_Set("UF/server.sav", "Owner", ServerInfo[sOwner]);
557
	dini_IntSet("UF/server.sav", "Loads", ServerInfo[sLoads]);
558
	dini_IntSet("UF/server.sav", "Weather", ServerInfo[sWeather]);
559
	dini_IntSet("UF/server.sav", "Time", ServerInfo[sTime]);
560
	dini_IntSet("UF/server.sav", "Speed", ServerInfo[sSpeed]);
561
	dini_IntSet("UF/server.sav", "Extazy", ServerInfo[sExtazy]);
562
	dini_IntSet("UF/server.sav", "Marihuana", ServerInfo[sMarihuana]);
563
	dini_IntSet("UF/server.sav", "Sirovine", ServerInfo[sSirovine]);
564
	dini_IntSet("UF/server.sav", "Accounts", ServerInfo[sAccounts]);
565
	dini_IntSet("UF/server.sav", "Budzet", ServerInfo[sBudzet]);
566
	dini_IntSet("UF/server.sav", "LottoFond", ServerInfo[sLottoFond]);
567
	dini_IntSet("UF/server.sav", "HitmanCode", ServerInfo[sHitmanCode]);
568
	dini_IntSet("UF/server.sav", "SrFuel", ServerInfo[sSrFuel]);
569
	dini_IntSet("UF/server.sav", "SrSlot1", ServerInfo[sSrSlot1]);
570
	dini_IntSet("UF/server.sav", "SrSlot2", ServerInfo[sSrSlot2]);
571
	dini_IntSet("UF/server.sav", "SrSlot3", ServerInfo[sSrSlot3]);
572
	return 1;
573
}
574
575
PogresanPw(playerid)
576
{
577
   	LoginTrys[playerid] ++;
578
	new string[512];
579
	new LLPname[24];
580
	new LLIp[64];
581
	GetPlayerIp(playerid,LLIp,sizeof(LLIp));
582
	GetPlayerName(playerid,LLPname,sizeof(LLPname));
583
	new dan,mjesec,godina,sat,sekund,minut;
584
	gettime(sat,minut,sekund);
585
	getdate(godina,mjesec,dan);
586
	format(string,sizeof(string),"[PogresanPassword] %d.%d.%d - %d:%d:%dh - %s - %s",dan,mjesec,godina,sat,minut,sekund,LLPname,LLIp);
587
	LoginLog(string);
588
	SetPlayerHealth(playerid, 100);
589
590
   	if(LoginTrys[playerid] == 3)
591
	{
592
	    ClearChatBox(playerid,30);
593
	    format(string,256,"AdmWarn: %s je pogrijesio 4 puta passwrod, pa je njegova IP (%s) automatski banovana.",LLPname,LLIp);
594
	    SendAdminMessage(COLOR_YELLOW,string);
595
		SendClientMessage(playerid, -1,"SERVER: Pogrijesili ste 4 puta. Vasa IP adresa je automatski banovana.");
596
		format(string,sizeof(string),"[PogresanPassword - IP Ban] %d.%d.%d - %d:%d:%dh - %s - %s",dan,mjesec,godina,sat,minut,sekund,LLPname,LLIp);
597
		LoginLog(string);
598
		BanWait(playerid);
599
		return 1;
600
	}
601
	SendClientMessage(playerid, -1,"SERVER: Ako pogrijesite 4 puta, Vasa IP adresa ce biti banovana.");
602
	return 1;
603
}
604
605
PlayerSound(playerid,soundid)
606
{
607
	PlayerPlaySound(playerid, soundid, 0.0, 0.0, 0.0);
608
	return 1;
609
}
610
611
public ClearSpam()
612
{
613
	for(new i = 0; i < MAX_PLAYERS; i++)
614
	{
615
	    if(IsPlayerConnected(i))
616
	    {
617
			if(Spammer[i] > 0) Spammer[i] --;
618
		}
619
	}
620
	return 1;
621
}
622
623
SpamWarn(playerid) // Opomena spameru da prestane
624
{
625
	if(IsPlayerConnected(playerid))
626
	{
627
	    if(Spammer[playerid] == 5 && PlayerInfo[playerid][pAdmin] <= 1)
628
	    {
629
	        SERVER(playerid,"Pripazite na spam. Ako nastavite, dobicete kick.");
630
	        return 0;
631
     	}
632
	}
633
	return 1;
634
}
635
636
RemovePlayerWeapon(playerid, weaponid)
637
{
638
	new plyWeapons[12] = 0;
639
	new plyAmmo[12] = 0;
640
	for(new slot = 0; slot != 12; slot++)
641
	{
642
		new wep, ammo;
643
		GetPlayerWeaponData(playerid, slot, wep, ammo);
644
645
		if(wep != weaponid && ammo != 0)
646
		{
647
			GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
648
		}
649
	}
650
	SafeResetPlayerWeapons(playerid);
651
	for(new slot = 0; slot != 12; slot++)
652
	{
653
	    if(plyAmmo[slot] != 0)
654
	    {
655
			SafeGivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot]);
656
		}
657
	}
658
	return 1;
659
}
660
661
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
662
{
663
	new IntTimer;
664
	KillTimer(IntTimer);
665
	IntTimer = SetTimerEx("IntChange", 50, 0, "i", playerid);  // Vrijeme dok se ScriptInt ne sredi (Izbjegavanje kicka neduznih,zanemarljiv vremenski period)
666
	return 1;
667
}
668
669
SafeSetPlayerInterior(playerid,interior) // Onemogucen interior hack
670
{
671
	SetPlayerInterior(playerid,interior);
672
	ScriptInterior[playerid] = interior;
673
	return 1;
674
}
675
676
public IntChange(playerid) // radio dok sam bio amater lol (comment: 05.04.14)
677
{
678
	if(IsPlayerConnected(playerid))
679
	{
680
    	if(GetPlayerInterior(playerid) != ScriptInterior[playerid])
681
		{
682
		    if(!IsPlayerInRangeOfPoint(playerid,30,617, -2, 1000)) // tuning garaza za obicna auta
683
			{
684
				if(!IsPlayerInRangeOfPoint(playerid,30,615, -124,997)) // tuning za SR auta
685
			    {
686
			        if(!IsPlayerInRangeOfPoint(playerid,30,616.7863, -74.8149,997.8)) // tuning za Lowridere
687
			        {
688
				    	new string[512];
689
				    	new pname[24];
690
			    		GetPlayerName(playerid,pname,sizeof(pname));
691
			    		PlayerInfo[playerid][pCheater] = 2;
692
			    		//
693
				    	if(!GetAdminsNumber(3))
694
				    	{
695
				    		format(string,sizeof(string),"Anticheat: "#COL_WHITE"%s"#COL_RED" je dobio kick zbog koristenja interior hacka.",pname);
696
				 			SendClientMessageToAll(COLOR_RED,string);
697
				 			KickEx(playerid);
698
				 			return 1;
699
						}
700
						if(GetAdminsNumber(3) >= 1)
701
						{
702
						    format(string,sizeof(string),"AdmWarn: "#COL_WHITE"%s"#COL_YELLOW" vjerovatno koristi interior hack. Provjerite ga.",pname);
703
						    SendAdminMessage(COLOR_YELLOW,string);
704
						    return 1;
705
						}
706
					}
707
				}
708
   			}
709
		}
710
	}
711
	return 1;
712
}
713
714
SaveBizID(id)
715
{
716
	new string[256];
717
	format(string, 256, "UF/Biznisi/%d.ini", id);
718
	if(!fexist(string)) return 1;
719
720
	new INI:bFile = INI_Open(string);
721
 	INI_WriteInt(bFile, "Cijena", Biznis[id][Cijena]);
722
  	INI_WriteInt(bFile, "Kupljen", Biznis[id][Kupljen]);
723
	INI_WriteInt(bFile, "Blagajna", Biznis[id][Blagajna]);
724
	INI_WriteInt(bFile, "Level", Biznis[id][Level]);
725
	INI_WriteFloat(bFile, "X", Biznis[id][X]);
726
	INI_WriteFloat(bFile, "Y", Biznis[id][Y]);
727
	INI_WriteFloat(bFile, "Z", Biznis[id][Z]);
728
	INI_WriteFloat(bFile, "eX", Biznis[id][eX]);
729
	INI_WriteFloat(bFile, "eY", Biznis[id][eY]);
730
	INI_WriteFloat(bFile, "eZ", Biznis[id][eZ]);
731
	INI_WriteString(bFile, "Vlasnik", Biznis[id][Vlasnik]);
732
	INI_WriteString(bFile, "Name", Biznis[id][Name]);
733
	INI_WriteInt(bFile, "Products", Biznis[id][Products]);
734
	INI_WriteInt(bFile, "Locked", Biznis[id][Locked]);
735
	INI_WriteInt(bFile, "Type", Biznis[id][Type]);
736
	INI_WriteInt(bFile, "EnterPrice", Biznis[id][EnterPrice]);
737
	INI_WriteInt(bFile, "CanEnter", Biznis[id][CanEnter]);
738
	INI_WriteInt(bFile, "Interior", Biznis[id][bInterior]);
739
	INI_WriteInt(bFile, "VirtualWorld", Biznis[id][bVirtualWorld]);
740
	INI_WriteInt(bFile, "ProductPrice", Biznis[id][ProductPrice]);
741
	INI_WriteInt(bFile, "Reket", Biznis[id][Reket]);
742
	INI_WriteInt(bFile, "CijenaUsluge", Biznis[id][CijenaUsluge]);
743
	INI_Close(bFile);
744
	return 1;
745
}
746
747
LoadBizID(id)
748
{
749
	new string[256];
750
 	format(string, 256,"UF/Biznisi/%d.ini", id);
751
  	if(fexist(string))
752
   	{
753
		INI_ParseFile(string, "LoadBizData", .bExtra = true, .extra = id);
754
   		SetTimerEx("CreateBizFiles", 300, 0, "i", id);
755
		Biznisi ++;
756
	}
757
	return 1;
758
}