Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- StartEvent()
- {
- new string[256];
- if(DostupanEvent == 1)
- {
- MoveDynamicObject(ChiliadStart, -2259.64, -2126.86,30,5, -1000, -1000, -1000);
- SetTimerEx("CloseGate", 8000, 0, "i", 9);
- }
- if(DostupanEvent == 2)
- {
- MoveDynamicObject(SFRaceGate1, -2930.87, 1168.25,4.65,5, -1000, -1000, -1000);
- MoveDynamicObject(SFRaceGate2, -2962.4, 1168.25,4.65,5, -1000, -1000, -1000);
- SetTimerEx("CloseGate", 8000, 0, "i", 10);
- }
- if(DostupanEvent == 3)
- {
- MoveDynamicObject(RCStart, -106.12,66.41, -5,5, -1000, -1000, -1000);
- SetTimerEx("CloseGate", 8000, 0, "i", 11);
- }
- if(DostupanEvent == 4)
- {
- MoveDynamicObject(HJGate[0], 1095.52, 2531.9, 5.5, 5, -1000, -1000, -1000);
- MoveDynamicObject(HJGate[1], 1076.32, 2531.9, 5.5, 5, -1000, -1000, -1000);
- SetTimerEx("CloseGate", 8000, 0, "i", 14);
- }
- if(DostupanEvent == 5)
- {
- MoveDynamicObject(DakarGate[0], -33.6, 2493.5, 10.2, 5, -1000, -1000, -1000);
- MoveDynamicObject(DakarGate[1], -33.6, 2512.69, 10.2, 5, -1000, -1000, -1000);
- SetTimerEx("CloseGate", 8000, 0, "i", 15);
- }
- DostupanEvent = 255;
- PortEnable = 0;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(IsOnEvent(i))
- {
- SendClientMessage(i,COLOR_YELLOW," ORGANIZACIJA EVENTA: Dakar je upravo poceo!");
- GameTextForPlayer(i,"~y~srecno!", 3000, 3);
- if(SFrCP[i] > 1 || RCTourCP[i] > 1 || ChiliadCP[i] > 1 || HJCP[i] > 1 || GetPVarInt(i, "Dakar") > 1)
- {
- format(string, 256," * "#COL_WHITE"%s"#COL_RED" je dobio kick zbog varanja na eventu.",pName(i));
- SendClientMessageToAll(COLOR_RED,string);
- KickEx(i);
- }
- }
- }
- }
- return 1;
- }
- //--------------------------------------------------
- public OnRconLoginAttempt(ip[], password[], success)
- {
- new pip[64];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(!IsAdmin(i, 1338) && success)
- {
- GetPlayerIp(i, pip, 24);
- if(IsSame(pip, ip))
- {
- ClearChatBox(i,25);
- SERVER(i, "Zabranjeno je koristenje RCONa - Kick.");
- KickEx(i);
- }
- }
- }
- return 1;
- }
- BanLog(string[]) // Svi logovi su u ScriptFiles > UF > Logs
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/ban.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- KickLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/kick.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- MoneyLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/novac.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- CreateLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/create.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- MakeLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/make.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- RenameLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/rename.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- SayLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/say.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- WarnLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/warn.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- TeamLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/team.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- LoginLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/login.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- BiznisLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), "%s\r\n",string);
- new File:hFile;
- hFile = fopen("UF/Logs/biznis.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- CommandLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), " (%s) %s\r\n", PrintDate(), string);
- new File:hFile;
- hFile = fopen("UF/Logs/cmds.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- PropertyLog(string[])
- {
- new entry[512];
- format(entry, sizeof(entry), " (%s - %s) %s\r\n", PrintDate(), PrintTime(1), string);
- new File:hFile;
- hFile = fopen("UF/Logs/cmds.log", io_append);
- fwrite(hFile, entry);
- fclose(hFile);
- return 1;
- }
- AdminKomande(playerid, level) // totalni remont prebacivanjem na RP (1,2,3,4,1337,1338 + big edit po levelima), edit 12.09.13
- {
- if(level == 1)
- {
- SendClientMessage(playerid, COLOR_LGREEN," 1 ADMIN:"#COL_WHITE" /a /am /duty /cc /removeveh /recon(off) /teles /checkbiz /clnews /kick /goto /banip");
- SendClientMessage(playerid, COLOR_LGREEN," 1 ADMIN:"#COL_WHITE" /masked /prisoned /cmc /pweapons /freeze /mute(d) /conut /check /slap /afriskbag");
- }
- if(level == 2)
- {
- SendClientMessage(playerid, COLOR_LGREEN," 2 ADMIN:"#COL_WHITE" /ban /gethere /settime /eventstart /startevent /setweather /say /disarm /jail /flip");
- SendClientMessage(playerid, COLOR_LGREEN," 2 ADMIN:"#COL_WHITE" /warn /rac /getip /setint /setvw /open(close)cell /maindoor /unmute /auntie /players");
- }
- if(level == 3)
- {
- SendClientMessage(playerid, COLOR_LGREEN," 3 ADMIN:"#COL_WHITE" /write /unwarn /charge /setskin /givegun /spawn /crash/pickupo /bizo /gotoxxx");
- SendClientMessage(playerid, COLOR_LGREEN," 3 ADMIN:"#COL_WHITE" /mark /gotomark /aerogate /dsc /sethp /setarmour /fly /getcar /gotocar");
- }
- if(level == 4)
- {
- SendClientMessage(playerid, COLOR_LGREEN," 4 ADMIN:"#COL_WHITE" /veh /givegun /givemoney /setmoney /msg /setteam /unjail /skladiste /setvehgas");
- SendClientMessage(playerid, COLOR_LGREEN," 4 ADMIN:"#COL_WHITE" /houseo /offban /fixcar /fuelcars /bizenterpos /bizexitpos /nch /resetad");
- }
- if(level == 1337)
- {
- SendClientMessage(playerid, COLOR_LGREEN," 1337 ADMIN:"#COL_WHITE" /makeleader /makeircadmin /baninfo /reloadch /edit /editpickup /hinfo /asellbiz");
- SendClientMessage(playerid, COLOR_LGREEN," 1337 ADMIN:"#COL_WHITE" /edithouse /houseint /gmx /asellhouse /cde /editcharge ");
- }
- if(level == 1338)
- {
- SendClientMessage(playerid, COLOR_LGREEN," 1338 ADMIN:"#COL_WHITE" /makeadmin /makegm /control /unban /setstat /savedata /createpickup /createbiz");
- SendClientMessage(playerid, COLOR_LGREEN," 1338 ADMIN:"#COL_WHITE" /deleteacc /housetome");
- }
- return 1;
- }
- GMKomande(playerid, level) // dodat lvl3 prebacivanjem na RP + promjena komandi po levelima, edit 12.09.13
- {
- if(level == 1)
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE," Level "#COL_WHITE"1"#COL_LIGHTBLUE" GameMaster");
- SendClientMessage(playerid, COLOR_WHITE," /duty /a /gmm /pm /kick /goto /check /muted /recon(off) /pweapons /muted");
- SendClientMessage(playerid, COLOR_WHITE," /cmc /pweapons /muted /gotols /gotolv /gotosf /prisoned /gotoevent /count");
- }
- if(level == 2)
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE," Level "#COL_WHITE"2"#COL_LIGHTBLUE" GameMaster");
- SendClientMessage(playerid, COLOR_WHITE," /rtc /banip /mute /cc /disarm /slap /gotoahq /gotomats /gotojail /gotobank");
- SendClientMessage(playerid, COLOR_WHITE," /freeze /setint /afrikbag /gotoaero /auntie /setint /setvw");
- }
- if(level == 3)
- {
- SendClientMessage(playerid, COLOR_LIGHTBLUE," Level "#COL_WHITE"3"#COL_LIGHTBLUE" GameMaster");
- SendClientMessage(playerid, COLOR_WHITE," /players /checkbiz /unmute /getip /removeveh /disarm /rac /skladiste /say");
- SendClientMessage(playerid, COLOR_WHITE," /setskin /aerogate /fly /write /msg");
- }
- return 1;
- }
- JailUpdate(playerid) // Update 16.02.13
- {
- if(!Ulogovan[playerid]) return 1;
- if(IsPlayerInArea(playerid, 95, 1797, 334, 1942, -32, 14) || IsPlayerInArea(playerid, 95, 1797, 287.5, 1942, -32, 40)) return 1;
- SetPlayerPosEx(playerid, 271.68, 1858.13, 8.75, 0, 0, 0);
- GameTextForPlayer(playerid, "~r~ne napustajte areu!", 3000, 3);
- return 1;
- }
- JailFree(playerid, mode) // Kraj jaila
- {
- new sendername[24],
- string[256];
- GetPlayerName(playerid, sendername, 24);
- PlayerSound(playerid, 1053);
- PlayerInfo[playerid][pJailed] = 0;
- PlayerInfo[playerid][pJailTime] = 0;
- TextDrawHideForPlayer(playerid, JailTimer[playerid]);
- SendClientMessage(playerid,COLOR_YELLOW," ["#COL_WHITE"SLOBODA"#COL_YELLOW"] - Potrudite se da vise ne zavrsavate u zatvoru.");
- format(string, 256," ** %s je istekla kazna u Arei 69.", sendername);
- if(mode == 2) AdminBoard(1, COLOR_RED, string);
- GameTextForPlayer(playerid,"~g~slobodni ste.~n~ ~w~pokusajte biti bolji od sad.",5000, 1);
- if(mode == 1) SetPlayerPosEx(playerid, 1552.73, -1675.63, 16.19, 0, 0, 0);
- if(mode == 2) SetPlayerPosEx(playerid, 89.08, 1920.33, 17.9, 0, 0, 0); // area free
- return 1;
- }
- PayDay(playerid) // rebuild on 17.09.13
- {
- new string[512],
- expneed,
- hKey,
- rKey,
- bKey,
- plata,
- struja,
- stanarina,
- porez,
- kredit,
- kamata[3];
- expneed = PlayerInfo[playerid][pLevel]*4+4;
- PlayerInfo[playerid][pRespekti] ++;
- PlayerInfo[playerid][pHours] ++;
- PlayerInfo[playerid][pPayDayTimer] = 3600;
- PlayerInfo[playerid][pJobFree] = 0;
- PlayerInfo[playerid][pDutyGuns] = 0;
- if(PlayerInfo[playerid][pHouseKey] < 999) hKey = PlayerInfo[playerid][pHouseKey];
- if(PlayerInfo[playerid][pRentKey] < 999) rKey = PlayerInfo[playerid][pRentKey];
- if(PlayerInfo[playerid][pBizKey] < 999) bKey = PlayerInfo[playerid][pBizKey];
- if(PlayerInfo[playerid][pJob] >= 1)
- {
- PlayerInfo[playerid][pUgovor] ++;
- plata = 50 + PlayerInfo[playerid][pUgovor]/2 + random(25);
- }
- if(PlayerInfo[playerid][pHouseKey] < 349)
- {
- hKey = PlayerInfo[playerid][pHouseKey];
- struja = HouseInfo[hKey][hPrice]/1000 + random(20);
- }
- if(PlayerInfo[playerid][pRentKey] < 349)
- {
- rKey = PlayerInfo[playerid][pRentKey];
- if(SafeGetPlayerMoney(playerid) < HouseInfo[rKey][hRentPrice])
- {
- SendClientMessage(playerid, COLOR_RED," Izbaceni ste iz kuce, jer niste u stanju da platite stanarinu.");
- PlayerInfo[playerid][pRentKey] = 999;
- rKey = 999;
- }
- if(SafeGetPlayerMoney(playerid) >= HouseInfo[rKey][hRentPrice])
- {
- stanarina = HouseInfo[rKey][hRentPrice];
- SafeGivePlayerMoney(playerid, -stanarina);
- HouseInfo[rKey][hRentPrice] += stanarina;
- }
- }
- if(PlayerInfo[playerid][pBizKey] != 255)
- {
- bKey = PlayerInfo[playerid][pBizKey];
- porez = Biznis[bKey][Cijena] / 500 + random(40);
- ServerInfo[sBudzet] += porez;
- }
- if(PlayerInfo[playerid][pCredit] >= 1)
- {
- PlayerInfo[playerid][pRate] --;
- if(PlayerInfo[playerid][pCredit] == 1) kredit = 220;
- if(PlayerInfo[playerid][pCredit] == 2) kredit = 550;
- if(PlayerInfo[playerid][pCredit] == 3) kredit = 1100;
- if(PlayerInfo[playerid][pPovjerioc] == 1) Biznis[3][Blagajna] += kredit/11;
- if(PlayerInfo[playerid][pPovjerioc] == 2) Biznis[26][Blagajna] += kredit/11;
- if(PlayerInfo[playerid][pPovjerioc] == 3) Biznis[27][Blagajna] += kredit/11;
- if(PlayerInfo[playerid][pPovjerioc] == 1) PlayerInfo[playerid][pLsBank] -= kredit;
- if(PlayerInfo[playerid][pPovjerioc] == 2) PlayerInfo[playerid][pLvBank] -= kredit;
- if(PlayerInfo[playerid][pPovjerioc] == 3) PlayerInfo[playerid][pSfBank] -= kredit;
- if(!PlayerInfo[playerid][pRate])
- {
- SendClientMessage(playerid, COLOR_LYELLOW," Otplatili ste poslednju ratu kredita. Sada mozete dici novi.");
- PlayerInfo[playerid][pCredit] = 0;
- PlayerInfo[playerid][pPovjerioc] = 0;
- }
- }
- kamata[0] = PlayerInfo[playerid][pLsBank]/750;
- kamata[1] = PlayerInfo[playerid][pLvBank]/750;
- kamata[2] = PlayerInfo[playerid][pSfBank]/750;
- if(PlayerInfo[playerid][pLsBank] >= struja && struja > 0)
- {
- PlayerInfo[playerid][pLsBank] -= struja;
- struja = 0;
- }
- if(PlayerInfo[playerid][pSfBank] >= struja && struja > 0)
- {
- PlayerInfo[playerid][pSfBank] -= struja;
- struja = 0;
- }
- if(struja > 0)
- {
- PlayerInfo[playerid][pLvBank] -= struja;
- struja = 0;
- }
- if(PlayerInfo[playerid][pLsBank] >= porez && porez > 0)
- {
- PlayerInfo[playerid][pLsBank] -= porez;
- struja = 0;
- }
- if(PlayerInfo[playerid][pSfBank] >= porez && porez > 0)
- {
- PlayerInfo[playerid][pSfBank] -= porez;
- struja = 0;
- }
- if(porez > 0)
- {
- PlayerInfo[playerid][pLvBank] -= porez;
- struja = 0;
- }
- PlayerInfo[playerid][pLsBank] += kamata[0];
- PlayerInfo[playerid][pSfBank] += kamata[1];
- PlayerInfo[playerid][pLvBank] += kamata[2];
- if(PlayerInfo[playerid][pSpawnHealth] < 100.0) PlayerInfo[playerid][pSpawnHealth] += 0.5;
- GorivoTextdraws(playerid, 0);
- if(PlayerInfo[playerid][pRespekti] >= expneed)
- {
- PlayerInfo[playerid][pLevel] ++;
- PlayerInfo[playerid][pRespekti] = 0;
- if(PlayerInfo[playerid][pJob] >= 1) plata += PlayerInfo[playerid][pLevel];
- 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$",
- PlayerInfo[playerid][pLevel], plata, kamata[0]+kamata[1]+kamata[2], struja, stanarina, porez, kredit);
- TextDrawSetString(PayDayTD[playerid], string);
- TextDrawShowForPlayer(playerid, PayDayTD[playerid]);
- TextDrawShowForPlayer(playerid, Time);
- SetPVarInt(playerid, "PayDayTextDraw", 1);
- return 1;
- }
- if(PlayerInfo[playerid][pRespekti] < expneed)
- {
- if(PlayerInfo[playerid][pJob] >= 1) plata += PlayerInfo[playerid][pLevel];
- 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",
- PlayerInfo[playerid][pRespekti], expneed, plata, kamata[0]+kamata[1]+kamata[2], struja, stanarina, porez, kredit);
- TextDrawSetString(PayDayTD[playerid], string);
- TextDrawShowForPlayer(playerid, PayDayTD[playerid]);
- TextDrawShowForPlayer(playerid, Time);
- SetPVarInt(playerid, "PayDayTextDraw", 1);
- }
- return 1;
- }
- public CountStart()
- {
- new string[512];
- if(Count == 0)
- {
- SoundForAll(1057);
- Count = -1;
- GameTextForAll("~r~-~w~ GO GO GO~w~ ~r~-", 1000,6);
- if(DostupanEvent != 255)
- {
- StartEvent();
- }
- }
- if(Count >= 1)
- {
- format(string, 256," ~w~- ~r~%d ~w~-",Count);
- GameTextForAll(string, 800, 6);
- Count --;
- SoundForAll(1052);
- }
- return 1;
- }
- public ReportTimer(playerid)
- {
- JustReported[playerid] = 0; // Moze se opet poslati report
- return 1;
- }
- SoundForAll(soundid)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i)) PlayerSound(i, soundid);
- }
- return 1;
- }
- Slap(playerid, metri) // upisete recimo Slap(playerid, 100); i server slapa igraca za 100 metara
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:Pos[3];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- SetPlayerPosEx(playerid, Pos[0], Pos[1], Pos[2]+metri, 0, ScriptInterior[playerid], GetPlayerVirtualWorld(playerid));
- }
- return 1;
- }
- LoadSkladiste()
- {
- Skladiste[UkupnoMaterijala] = dini_Int(SKLADISTE, "UkupnoMaterijala");
- Skladiste[CijenaMatsa] = dini_Int(SKLADISTE, "CijenaMatsa");
- Skladiste[UpdateTimer] = dini_Int(SKLADISTE, "UpdateTimer");
- Skladiste[UpdateCountDown] = dini_Int(SKLADISTE, "UpdateCountDown");
- Skladiste[PunoSkladiste] = dini_Int(SKLADISTE, "PunoSkladiste");
- PrintLines(1);
- return 1;
- }
- SaveSkladiste()
- {
- dini_IntSet(SKLADISTE, "UkupnoMaterijala", Skladiste[UkupnoMaterijala]);
- dini_IntSet(SKLADISTE, "CijenaMatsa", Skladiste[CijenaMatsa]);
- dini_IntSet(SKLADISTE, "UpdateTimer", Skladiste[UpdateTimer]);
- dini_IntSet(SKLADISTE, "UpdateCountDown", Skladiste[UpdateCountDown]);
- dini_IntSet(SKLADISTE, "PunoSkladiste", Skladiste[PunoSkladiste]);
- return 1;
- }
- LoadServerstats()
- {
- ServerInfo[sVisits] = dini_Int("UF/server.sav", "Visits");
- ServerInfo[sLogs] = dini_Int("UF/server.sav", "Logs");
- ServerInfo[sRegs] = dini_Int("UF/server.sav", "Regs");
- ServerInfo[sKicks] = dini_Int("UF/server.sav", "Kicks");
- ServerInfo[sBans] = dini_Int("UF/server.sav", "Bans");
- ServerInfo[sDeaths] = dini_Int("UF/server.sav", "Deaths");
- set(ServerInfo[sOwner], dini_Get("UF/server.sav", "Owner"));
- ServerInfo[sLoads] = dini_Int("UF/server.sav", "Loads");
- ServerInfo[sMaxPlayers] = dini_Int("UF/server.sav", "MaxPlayers");
- ServerInfo[sWeather] = dini_Int("UF/server.sav", "Weather");
- ServerInfo[sTime] = dini_Int("UF/server.sav", "Time");
- ServerInfo[sSpeed] = dini_Int("UF/server.sav", "Speed");
- ServerInfo[sExtazy] = dini_Int("UF/server.sav", "Extazy");
- ServerInfo[sMarihuana] = dini_Int("UF/server.sav", "Marihuana");
- ServerInfo[sSirovine] = dini_Int("UF/server.sav", "Sirovine");
- ServerInfo[sAccounts] = dini_Int("UF/server.sav", "Accounts");
- ServerInfo[sBudzet] = dini_Int("UF/server.sav", "Budzet");
- ServerInfo[sLottoFond] = dini_Int("UF/server.sav", "LottoFond");
- ServerInfo[sHitmanCode] = dini_Int("UF/server.sav", "HitmanCode");
- ServerInfo[sSrFuel] = dini_Int("UF/server.sav", "SrFuel");
- ServerInfo[sSrSlot1] = dini_Int("UF/server.sav", "SrSlot1");
- ServerInfo[sSrSlot2] = dini_Int("UF/server.sav", "SrSlot2");
- ServerInfo[sSrSlot3] = dini_Int("UF/server.sav", "SrSlot3");
- return 1;
- }
- SaveServerstats()
- {
- dini_IntSet("UF/server.sav", "Visits", ServerInfo[sVisits]);
- dini_IntSet("UF/server.sav", "Logs", ServerInfo[sLogs]);
- dini_IntSet("UF/server.sav", "Regs", ServerInfo[sRegs]);
- dini_IntSet("UF/server.sav", "Kicks", ServerInfo[sKicks]);
- dini_IntSet("UF/server.sav", "Bans", ServerInfo[sBans]);
- dini_IntSet("UF/server.sav", "Deaths", ServerInfo[sDeaths]);
- dini_IntSet("UF/server.sav", "MaxPlayers", ServerInfo[sMaxPlayers]);
- dini_Set("UF/server.sav", "Owner", ServerInfo[sOwner]);
- dini_IntSet("UF/server.sav", "Loads", ServerInfo[sLoads]);
- dini_IntSet("UF/server.sav", "Weather", ServerInfo[sWeather]);
- dini_IntSet("UF/server.sav", "Time", ServerInfo[sTime]);
- dini_IntSet("UF/server.sav", "Speed", ServerInfo[sSpeed]);
- dini_IntSet("UF/server.sav", "Extazy", ServerInfo[sExtazy]);
- dini_IntSet("UF/server.sav", "Marihuana", ServerInfo[sMarihuana]);
- dini_IntSet("UF/server.sav", "Sirovine", ServerInfo[sSirovine]);
- dini_IntSet("UF/server.sav", "Accounts", ServerInfo[sAccounts]);
- dini_IntSet("UF/server.sav", "Budzet", ServerInfo[sBudzet]);
- dini_IntSet("UF/server.sav", "LottoFond", ServerInfo[sLottoFond]);
- dini_IntSet("UF/server.sav", "HitmanCode", ServerInfo[sHitmanCode]);
- dini_IntSet("UF/server.sav", "SrFuel", ServerInfo[sSrFuel]);
- dini_IntSet("UF/server.sav", "SrSlot1", ServerInfo[sSrSlot1]);
- dini_IntSet("UF/server.sav", "SrSlot2", ServerInfo[sSrSlot2]);
- dini_IntSet("UF/server.sav", "SrSlot3", ServerInfo[sSrSlot3]);
- return 1;
- }
- PogresanPw(playerid)
- {
- LoginTrys[playerid] ++;
- new string[512];
- new LLPname[24];
- new LLIp[64];
- GetPlayerIp(playerid,LLIp,sizeof(LLIp));
- GetPlayerName(playerid,LLPname,sizeof(LLPname));
- new dan,mjesec,godina,sat,sekund,minut;
- gettime(sat,minut,sekund);
- getdate(godina,mjesec,dan);
- format(string,sizeof(string),"[PogresanPassword] %d.%d.%d - %d:%d:%dh - %s - %s",dan,mjesec,godina,sat,minut,sekund,LLPname,LLIp);
- LoginLog(string);
- SetPlayerHealth(playerid, 100);
- if(LoginTrys[playerid] == 3)
- {
- ClearChatBox(playerid,30);
- format(string,256,"AdmWarn: %s je pogrijesio 4 puta passwrod, pa je njegova IP (%s) automatski banovana.",LLPname,LLIp);
- SendAdminMessage(COLOR_YELLOW,string);
- SendClientMessage(playerid, -1,"SERVER: Pogrijesili ste 4 puta. Vasa IP adresa je automatski banovana.");
- format(string,sizeof(string),"[PogresanPassword - IP Ban] %d.%d.%d - %d:%d:%dh - %s - %s",dan,mjesec,godina,sat,minut,sekund,LLPname,LLIp);
- LoginLog(string);
- BanWait(playerid);
- return 1;
- }
- SendClientMessage(playerid, -1,"SERVER: Ako pogrijesite 4 puta, Vasa IP adresa ce biti banovana.");
- return 1;
- }
- PlayerSound(playerid,soundid)
- {
- PlayerPlaySound(playerid, soundid, 0.0, 0.0, 0.0);
- return 1;
- }
- public ClearSpam()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(Spammer[i] > 0) Spammer[i] --;
- }
- }
- return 1;
- }
- SpamWarn(playerid) // Opomena spameru da prestane
- {
- if(IsPlayerConnected(playerid))
- {
- if(Spammer[playerid] == 5 && PlayerInfo[playerid][pAdmin] <= 1)
- {
- SERVER(playerid,"Pripazite na spam. Ako nastavite, dobicete kick.");
- return 0;
- }
- }
- return 1;
- }
- RemovePlayerWeapon(playerid, weaponid)
- {
- new plyWeapons[12] = 0;
- new plyAmmo[12] = 0;
- for(new slot = 0; slot != 12; slot++)
- {
- new wep, ammo;
- GetPlayerWeaponData(playerid, slot, wep, ammo);
- if(wep != weaponid && ammo != 0)
- {
- GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
- }
- }
- SafeResetPlayerWeapons(playerid);
- for(new slot = 0; slot != 12; slot++)
- {
- if(plyAmmo[slot] != 0)
- {
- SafeGivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot]);
- }
- }
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- new IntTimer;
- KillTimer(IntTimer);
- IntTimer = SetTimerEx("IntChange", 50, 0, "i", playerid); // Vrijeme dok se ScriptInt ne sredi (Izbjegavanje kicka neduznih,zanemarljiv vremenski period)
- return 1;
- }
- SafeSetPlayerInterior(playerid,interior) // Onemogucen interior hack
- {
- SetPlayerInterior(playerid,interior);
- ScriptInterior[playerid] = interior;
- return 1;
- }
- public IntChange(playerid) // radio dok sam bio amater lol (comment: 05.04.14)
- {
- if(IsPlayerConnected(playerid))
- {
- if(GetPlayerInterior(playerid) != ScriptInterior[playerid])
- {
- if(!IsPlayerInRangeOfPoint(playerid,30,617, -2, 1000)) // tuning garaza za obicna auta
- {
- if(!IsPlayerInRangeOfPoint(playerid,30,615, -124,997)) // tuning za SR auta
- {
- if(!IsPlayerInRangeOfPoint(playerid,30,616.7863, -74.8149,997.8)) // tuning za Lowridere
- {
- new string[512];
- new pname[24];
- GetPlayerName(playerid,pname,sizeof(pname));
- PlayerInfo[playerid][pCheater] = 2;
- //
- if(!GetAdminsNumber(3))
- {
- format(string,sizeof(string),"Anticheat: "#COL_WHITE"%s"#COL_RED" je dobio kick zbog koristenja interior hacka.",pname);
- SendClientMessageToAll(COLOR_RED,string);
- KickEx(playerid);
- return 1;
- }
- if(GetAdminsNumber(3) >= 1)
- {
- format(string,sizeof(string),"AdmWarn: "#COL_WHITE"%s"#COL_YELLOW" vjerovatno koristi interior hack. Provjerite ga.",pname);
- SendAdminMessage(COLOR_YELLOW,string);
- return 1;
- }
- }
- }
- }
- }
- }
- return 1;
- }
- SaveBizID(id)
- {
- new string[256];
- format(string, 256, "UF/Biznisi/%d.ini", id);
- if(!fexist(string)) return 1;
- new INI:bFile = INI_Open(string);
- INI_WriteInt(bFile, "Cijena", Biznis[id][Cijena]);
- INI_WriteInt(bFile, "Kupljen", Biznis[id][Kupljen]);
- INI_WriteInt(bFile, "Blagajna", Biznis[id][Blagajna]);
- INI_WriteInt(bFile, "Level", Biznis[id][Level]);
- INI_WriteFloat(bFile, "X", Biznis[id][X]);
- INI_WriteFloat(bFile, "Y", Biznis[id][Y]);
- INI_WriteFloat(bFile, "Z", Biznis[id][Z]);
- INI_WriteFloat(bFile, "eX", Biznis[id][eX]);
- INI_WriteFloat(bFile, "eY", Biznis[id][eY]);
- INI_WriteFloat(bFile, "eZ", Biznis[id][eZ]);
- INI_WriteString(bFile, "Vlasnik", Biznis[id][Vlasnik]);
- INI_WriteString(bFile, "Name", Biznis[id][Name]);
- INI_WriteInt(bFile, "Products", Biznis[id][Products]);
- INI_WriteInt(bFile, "Locked", Biznis[id][Locked]);
- INI_WriteInt(bFile, "Type", Biznis[id][Type]);
- INI_WriteInt(bFile, "EnterPrice", Biznis[id][EnterPrice]);
- INI_WriteInt(bFile, "CanEnter", Biznis[id][CanEnter]);
- INI_WriteInt(bFile, "Interior", Biznis[id][bInterior]);
- INI_WriteInt(bFile, "VirtualWorld", Biznis[id][bVirtualWorld]);
- INI_WriteInt(bFile, "ProductPrice", Biznis[id][ProductPrice]);
- INI_WriteInt(bFile, "Reket", Biznis[id][Reket]);
- INI_WriteInt(bFile, "CijenaUsluge", Biznis[id][CijenaUsluge]);
- INI_Close(bFile);
- return 1;
- }
- LoadBizID(id)
- {
- new string[256];
- format(string, 256,"UF/Biznisi/%d.ini", id);
- if(fexist(string))
- {
- INI_ParseFile(string, "LoadBizData", .bExtra = true, .extra = id);
- SetTimerEx("CreateBizFiles", 300, 0, "i", id);
- Biznisi ++;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment