Guest User

Untitled

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