Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Streljane

a guest Feb 8th, 2015 393 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4. #include <dini>
  5. #include <streamer>
  6.  
  7. #define MAX_STRELJANA       10
  8. #define METAKA_PO_SB        50//koliko metaka igrac mora ispaliti za 1 skill bod
  9. #define MINUTI_TRENIRANJA   3 //koliko minuta treniraju igraci
  10. #define KOLICINA_MINUTA     60 //koliko minuta izmedju treniranja
  11. #define PVAR_ZA_AC          "SB_Trenira" //pvar kojim izbegavate prijavljivanje anticheata za port/weapon hack
  12.  
  13. #define playerpath      "Streljane/Igraci/%s.ini"
  14. #define streljanepath   "Streljane/%d.ini"
  15.  
  16. #define ORUZJE_PISTOL       22
  17. #define ORUZJE_SILENCED     23
  18. #define ORUZJE_DEAGLE       24
  19. #define ORUZJE_SHOTGUN      25
  20. #define ORUZJE_SAWNOFF      26
  21. #define ORUZJE_SPAS12       27
  22. #define ORUZJE_MICROSMG     28
  23. #define ORUZJE_MP5          29
  24. #define ORUZJE_AK47         30
  25. #define ORUZJE_M4           31
  26. #define ORUZJE_RIFLE        33
  27.  
  28. #define SANZER_PISTOL       34
  29. #define SANZER_SILENCED     17
  30. #define SANZER_DEAGLE       7
  31. #define SANZER_SHOTGUN      1
  32. #define SANZER_SAWNOFF      4
  33. #define SANZER_SPAS12       1
  34. #define SANZER_MICROSMG     100
  35. #define SANZER_MP5          50
  36. #define SANZER_AK47         30
  37. #define SANZER_M4           50
  38. #define SANZER_RIFLE        1
  39.  
  40. #define D_TRENIRANJE        765
  41. #define D_STRELJANA_POMERI  766
  42. #define D_STRELJANA_OBRISI  767
  43.  
  44. new bool:PrviSpawn[MAX_PLAYERS] = false;
  45. new Trenira[MAX_PLAYERS] = 0;
  46. new treniranjetimer[MAX_PLAYERS] = -1;
  47. new Trenirao[MAX_PLAYERS] = 0;
  48. new Kolicina[MAX_PLAYERS] = 0;
  49. new Brojac[MAX_PLAYERS] = 0;
  50. new Streljana[MAX_PLAYERS] = -1;
  51.  
  52. enum sbInfo {
  53.         sbPistol,
  54.         sbSilenced,
  55.         sbDeagle,
  56.         sbShotgun,
  57.         sbSawn,
  58.         sbSpas,
  59.         sbMicroSMG,
  60.         sbMP5,
  61.         sbAK47,
  62.         sbM4,
  63.         sbSniperRifle
  64. }; new SBInfo[MAX_PLAYERS][sbInfo];
  65.  
  66. enum trInfo {
  67.         Float:EnterX,
  68.         Float:EnterY,
  69.         Float:EnterZ,
  70.         Pickup,
  71.         MapIcon,
  72.         Text3D:Label
  73. }; new StreljanaInfo[MAX_STRELJANA][trInfo];
  74.  
  75. forward SyncUp();
  76. public SyncUp() {
  77.         for(new i = 0; i < MAX_PLAYERS; i++) {
  78.             if(IsPlayerConnected(i)) {
  79.                 if(Trenirao[i] > 0) Trenirao[i]--;
  80.                 }
  81.         }
  82.         return 1;
  83. }
  84.  
  85. public OnFilterScriptInit()
  86. {
  87.         SetTimer("SyncUp",60000,true);
  88.         print(" >---- Skill FS by dock ----<");
  89.         for(new i = 0; i < MAX_STRELJANA; i++) {
  90.             UcitajStreljanu(i);
  91.             CreatePickup(346,1,294.8518,-38.5149,1001.5156,i+150);
  92.             Create3DTextLabel("Streljana\nDa treniras pisi\n[ /treniraj ]",0xff9900ff,294.8518,-38.5149,1001.5156,10,i+150,1);
  93.         }
  94.         return 1;
  95. }
  96.  
  97. public OnFilterScriptExit()
  98. {
  99.         for(new i = 0; i < MAX_STRELJANA; i++) {
  100.                 ObrisiStreljanaPickupLabel(i);
  101.         }
  102.         return 1;
  103. }
  104.  
  105. public OnPlayerRequestClass(playerid, classid)
  106. {
  107.         return 1;
  108. }
  109.  
  110. public OnPlayerConnect(playerid)
  111. {
  112.         SetPVarInt(playerid,PVAR_ZA_AC,0);
  113.         PrviSpawn[playerid] = false;
  114.         Trenira[playerid] = 0;
  115.         Trenirao[playerid] = 0;
  116.         treniranjetimer[playerid] = -1;
  117.         Kolicina[playerid] = 0;
  118.         Brojac[playerid] = 0;
  119.         Streljana[playerid] = -1;
  120.  
  121.         SBInfo[playerid][sbPistol] = 0;
  122.         SBInfo[playerid][sbSilenced] = 0;
  123.         SBInfo[playerid][sbDeagle] = 0;
  124.         SBInfo[playerid][sbShotgun] = 0;
  125.         SBInfo[playerid][sbSawn] = 0;
  126.         SBInfo[playerid][sbSpas] = 0;
  127.         SBInfo[playerid][sbMicroSMG] = 0;
  128.         SBInfo[playerid][sbMP5] = 0;
  129.         SBInfo[playerid][sbAK47] = 0;
  130.         SBInfo[playerid][sbM4] = 0;
  131.         SBInfo[playerid][sbSniperRifle] = 0;
  132.         return 1;
  133. }
  134.  
  135. public OnPlayerDisconnect(playerid, reason)
  136. {
  137.         if(PrviSpawn[playerid]) {
  138.             SacuvajIgraca(playerid);
  139.             PrviSpawn[playerid] = false;
  140.         }
  141.         if(Trenira[playerid] > 0) {
  142.             KillTimer(treniranjetimer[playerid]);
  143.             treniranjetimer[playerid] = -1;
  144.         }
  145.         return 1;
  146. }
  147.  
  148. public OnPlayerSpawn(playerid)
  149. {
  150.         if(!PrviSpawn[playerid]) {
  151.                 UcitajIgraca(playerid);
  152.                 PrviSpawn[playerid] = true;
  153.         }
  154.         SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, SBInfo[playerid][sbPistol]);
  155.         SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, SBInfo[playerid][sbSilenced]);
  156.         SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, SBInfo[playerid][sbDeagle]);
  157.         SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, SBInfo[playerid][sbShotgun]);
  158.         SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, SBInfo[playerid][sbSawn]);
  159.         SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, SBInfo[playerid][sbSpas]);
  160.         SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, SBInfo[playerid][sbMicroSMG]);
  161.         SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, SBInfo[playerid][sbMP5]);
  162.         SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, SBInfo[playerid][sbAK47]);
  163.         SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, SBInfo[playerid][sbM4]);
  164.         SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, SBInfo[playerid][sbSniperRifle]);
  165.         return 1;
  166. }
  167.  
  168. public OnPlayerDeath(playerid, killerid, reason)
  169. {
  170.         return 1;
  171. }
  172.  
  173. public OnVehicleSpawn(vehicleid)
  174. {
  175.         return 1;
  176. }
  177.  
  178. public OnVehicleDeath(vehicleid, killerid)
  179. {
  180.         return 1;
  181. }
  182.  
  183. public OnPlayerText(playerid, text[])
  184. {
  185.         return 1;
  186. }
  187.  
  188. public OnPlayerCommandText(playerid, cmdtext[])
  189. {
  190.         return 0;
  191. }
  192.  
  193. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  194. {
  195.         return 1;
  196. }
  197.  
  198. public OnPlayerExitVehicle(playerid, vehicleid)
  199. {
  200.         return 1;
  201. }
  202.  
  203. public OnPlayerStateChange(playerid, newstate, oldstate)
  204. {
  205.         return 1;
  206. }
  207.  
  208. public OnPlayerEnterCheckpoint(playerid)
  209. {
  210.         return 1;
  211. }
  212.  
  213. public OnPlayerLeaveCheckpoint(playerid)
  214. {
  215.         return 1;
  216. }
  217.  
  218. public OnPlayerEnterRaceCheckpoint(playerid)
  219. {
  220.         return 1;
  221. }
  222.  
  223. public OnPlayerLeaveRaceCheckpoint(playerid)
  224. {
  225.         return 1;
  226. }
  227.  
  228. public OnRconCommand(cmd[])
  229. {
  230.         return 1;
  231. }
  232.  
  233. public OnPlayerRequestSpawn(playerid)
  234. {
  235.         return 1;
  236. }
  237.  
  238. public OnObjectMoved(objectid)
  239. {
  240.         return 1;
  241. }
  242.  
  243. public OnPlayerObjectMoved(playerid, objectid)
  244. {
  245.         return 1;
  246. }
  247.  
  248. public OnPlayerPickUpPickup(playerid, pickupid)
  249. {
  250.         return 1;
  251. }
  252.  
  253. public OnVehicleMod(playerid, vehicleid, componentid)
  254. {
  255.         return 1;
  256. }
  257.  
  258. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  259. {
  260.         return 1;
  261. }
  262.  
  263. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  264. {
  265.         return 1;
  266. }
  267.  
  268. public OnPlayerSelectedMenuRow(playerid, row)
  269. {
  270.         return 1;
  271. }
  272.  
  273. public OnPlayerExitedMenu(playerid)
  274. {
  275.         return 1;
  276. }
  277.  
  278. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  279. {
  280.         return 1;
  281. }
  282.  
  283. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  284. {
  285.         if(newkeys & KEY_SECONDARY_ATTACK) {
  286.             for(new i = 0; i < MAX_STRELJANA; i++) {
  287.                 if(StreljanaInfo[i][EnterX] != 0) {
  288.                                 if(IsPlayerInRangeOfPoint(playerid,3.0,StreljanaInfo[i][EnterX],StreljanaInfo[i][EnterY],StreljanaInfo[i][EnterZ])) {
  289.                                     SetPVarInt(playerid, PVAR_ZA_AC, 1);
  290.                                     Streljana[playerid] = i;
  291.                                     SetPlayerVirtualWorld(playerid,i+150);
  292.                                     SetPlayerInterior(playerid,1);
  293.                                     SetPlayerPos(playerid,286.1490,-40.6444,1001.5156);
  294.                                 }
  295.                         }
  296.                 }
  297.                 if(Streljana[playerid] > -1) {
  298.                     if(IsPlayerInRangeOfPoint(playerid, 3.0, 286.1490,-40.6444,1001.5156)) {
  299.                         SetPlayerPos(playerid, StreljanaInfo[Streljana[playerid]][EnterX],StreljanaInfo[Streljana[playerid]][EnterY],StreljanaInfo[Streljana[playerid]][EnterZ]);
  300.                         SetPlayerInterior(playerid,0);
  301.                         SetPlayerVirtualWorld(playerid,0);
  302.                         Streljana[playerid] = -1;
  303.                         SetPVarInt(playerid, PVAR_ZA_AC, 0);
  304.                     }
  305.                 }
  306.         }
  307.         return 1;
  308. }
  309.  
  310. public OnRconLoginAttempt(ip[], password[], success)
  311. {
  312.         return 1;
  313. }
  314.  
  315. public OnPlayerUpdate(playerid)
  316. {
  317.         return 1;
  318. }
  319.  
  320. public OnPlayerStreamIn(playerid, forplayerid)
  321. {
  322.         return 1;
  323. }
  324.  
  325. public OnPlayerStreamOut(playerid, forplayerid)
  326. {
  327.         return 1;
  328. }
  329.  
  330. public OnVehicleStreamIn(vehicleid, forplayerid)
  331. {
  332.         return 1;
  333. }
  334.  
  335. public OnVehicleStreamOut(vehicleid, forplayerid)
  336. {
  337.         return 1;
  338. }
  339.  
  340. forward TreniranjeTimer(playerid);
  341. public TreniranjeTimer(playerid) {
  342.         SetPlayerPos(playerid, 285.9984,-30.5242,1001.5156);
  343.         new kolicina = floatround(Kolicina[playerid]/METAKA_PO_SB);
  344.         new str[128];
  345.         if(Trenira[playerid] == ORUZJE_PISTOL) { SBInfo[playerid][sbPistol] += kolicina; format(str,sizeof(str)," > Zavrsili ste treniranje! Dobili ste %d skill bodova! Trenutna kolicina bodova: %d",kolicina,SBInfo[playerid][sbPistol]); }
  346.         else if(Trenira[playerid] == ORUZJE_DEAGLE) { SBInfo[playerid][sbDeagle] += kolicina; format(str,sizeof(str)," > Zavrsili ste treniranje! Dobili ste %d skill bodova! Trenutna kolicina bodova: %d",kolicina,SBInfo[playerid][sbDeagle]); }
  347.         else if(Trenira[playerid] == ORUZJE_MICROSMG) { SBInfo[playerid][sbMicroSMG] += kolicina; format(str,sizeof(str)," > Zavrsili ste treniranje! Dobili ste %d skill bodova! Trenutna kolicina bodova: %d",kolicina,SBInfo[playerid][sbMicroSMG]); }
  348.         else if(Trenira[playerid] == ORUZJE_MP5) { SBInfo[playerid][sbMP5] += kolicina; format(str,sizeof(str)," > Zavrsili ste treniranje! Dobili ste %d skill bodova! Trenutna kolicina bodova: %d",kolicina,SBInfo[playerid][sbMP5]); }
  349.         else if(Trenira[playerid] == ORUZJE_AK47) { SBInfo[playerid][sbAK47] += kolicina; format(str,sizeof(str)," > Zavrsili ste treniranje! Dobili ste %d skill bodova! Trenutna kolicina bodova: %d",kolicina,SBInfo[playerid][sbAK47]); }
  350.         else if(Trenira[playerid] == ORUZJE_M4) { SBInfo[playerid][sbM4] += kolicina; format(str,sizeof(str)," > Zavrsili ste treniranje! Dobili ste %d skill bodova! Trenutna kolicina bodova: %d",kolicina,SBInfo[playerid][sbM4]); }
  351.         SendClientMessage(playerid,0x00ff99ff,str);
  352.         SacuvajIgraca(playerid);
  353.         Kolicina[playerid] = 0;
  354.         Trenira[playerid] = 0;
  355.         ResetPlayerWeapons(playerid);
  356.         return 1;
  357. }
  358.  
  359. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) {
  360.         if(Trenira[playerid] == weaponid) {
  361.             Kolicina[playerid]++; Brojac[playerid]++;
  362.             if(Trenira[playerid] == ORUZJE_PISTOL) {
  363.                 if(Brojac[playerid] > SANZER_PISTOL) {
  364.                         GivePlayerWeapon(playerid,weaponid,SANZER_PISTOL);
  365.                         Brojac[playerid] = 0;
  366.                         }
  367.                 } else if(Trenira[playerid] == ORUZJE_SILENCED) {
  368.                 if(Brojac[playerid] > SANZER_SILENCED) {
  369.                         GivePlayerWeapon(playerid,weaponid,SANZER_SILENCED);
  370.                         Brojac[playerid] = 0;
  371.                         }
  372.                 } else if(Trenira[playerid] == ORUZJE_DEAGLE) {
  373.                 if(Brojac[playerid] > SANZER_DEAGLE) {
  374.                         GivePlayerWeapon(playerid,weaponid,SANZER_DEAGLE);
  375.                         Brojac[playerid] = 0;
  376.                         }
  377.                 }  else if(Trenira[playerid] == ORUZJE_SHOTGUN) {
  378.                 if(Brojac[playerid] > SANZER_SHOTGUN) {
  379.                         GivePlayerWeapon(playerid,weaponid,SANZER_SHOTGUN);
  380.                         Brojac[playerid] = 0;
  381.                         }
  382.                 } else if(Trenira[playerid] == ORUZJE_SAWNOFF) {
  383.                 if(Brojac[playerid] > SANZER_SAWNOFF) {
  384.                         GivePlayerWeapon(playerid,weaponid,SANZER_SAWNOFF);
  385.                         Brojac[playerid] = 0;
  386.                         }
  387.                 } else if(Trenira[playerid] == ORUZJE_SPAS12) {
  388.                 if(Brojac[playerid] > SANZER_SPAS12) {
  389.                         GivePlayerWeapon(playerid,weaponid,SANZER_SPAS12);
  390.                         Brojac[playerid] = 0;
  391.                         }
  392.                 } else if(Trenira[playerid] == ORUZJE_MICROSMG) {
  393.                 if(Brojac[playerid] > SANZER_MICROSMG) {
  394.                         GivePlayerWeapon(playerid,weaponid,SANZER_MICROSMG);
  395.                         Brojac[playerid] = 0;
  396.                         }
  397.                 } else if(Trenira[playerid] == ORUZJE_MP5) {
  398.                 if(Brojac[playerid] > SANZER_MP5) {
  399.                         GivePlayerWeapon(playerid,weaponid,SANZER_MP5);
  400.                         Brojac[playerid] = 0;
  401.                         }
  402.                 } else if(Trenira[playerid] == ORUZJE_AK47) {
  403.                 if(Brojac[playerid] > SANZER_AK47) {
  404.                         GivePlayerWeapon(playerid,weaponid,SANZER_AK47);
  405.                         Brojac[playerid] = 0;
  406.                         }
  407.                 } else if(Trenira[playerid] == ORUZJE_M4) {
  408.                 if(Brojac[playerid] > SANZER_M4) {
  409.                         GivePlayerWeapon(playerid,weaponid,SANZER_M4);
  410.                         Brojac[playerid] = 0;
  411.                         }
  412.                 } else if(Trenira[playerid] == ORUZJE_RIFLE) {
  413.                 if(Brojac[playerid] > SANZER_RIFLE) {
  414.                         GivePlayerWeapon(playerid,weaponid,SANZER_RIFLE);
  415.                         Brojac[playerid] = 0;
  416.                         }
  417.                 }
  418.             return 0;
  419.         }
  420.         return 1;
  421. }
  422.  
  423. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  424. {
  425.         if(dialogid == D_STRELJANA_POMERI) {
  426.             if(response) {
  427.                 new id = strval(inputtext);
  428.                 if(id < 0 || id > MAX_STRELJANA) return SendClientMessage(playerid, -1, " > Streljana ne postoji!");
  429.                     if(StreljanaInfo[id][EnterX] == 0) return SendClientMessage(playerid, -1, " > Streljana ne postoji!");
  430.                     new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z);
  431.                     StreljanaInfo[id][EnterX] = x;
  432.                     StreljanaInfo[id][EnterY] = y;
  433.                     StreljanaInfo[id][EnterZ] = z;
  434.                     SacuvajStreljanu(id);
  435.                     UpdateStreljanaPickupLabel(id);
  436.                     new str[128]; format(str,128," > Pomerili ste streljanu [id: %d].", id);
  437.                         SendClientMessage(playerid,0x00ff99ff,str);
  438.                 }
  439.                 return 1;
  440.         }
  441.         if(dialogid == D_STRELJANA_OBRISI) {
  442.             if(response) {
  443.                 new id = strval(inputtext);
  444.                 if(id < 0 || id > MAX_STRELJANA) return SendClientMessage(playerid, -1, " > Streljana ne postoji!");
  445.                     if(StreljanaInfo[id][EnterX] == 0) return SendClientMessage(playerid, -1, " > Streljana ne postoji!");
  446.                     StreljanaInfo[id][EnterX] = 0;
  447.                     StreljanaInfo[id][EnterY] = 0;
  448.                     StreljanaInfo[id][EnterZ] = 0;
  449.                     new file[32]; format(file,sizeof(file),streljanepath,id);
  450.                         if(fexist(file)) fremove(file);
  451.                     ObrisiStreljanaPickupLabel(id);
  452.                     new str[128]; format(str,128," > Obrisali ste streljanu [id: %d].", id);
  453.                         SendClientMessage(playerid,0x00ff99ff,str);
  454.                 }
  455.                 return 1;
  456.         }
  457.         if(dialogid == D_TRENIRANJE) {
  458.             if(response) {
  459.                 new oruzje;
  460.                     if(listitem == 0) if(SBInfo[playerid][sbPistol] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else oruzje = ORUZJE_PISTOL;
  461.                     else if(listitem == 1) if(SBInfo[playerid][sbSilenced] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else  oruzje = ORUZJE_SILENCED;
  462.                     else if(listitem == 2) if(SBInfo[playerid][sbDeagle] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else  oruzje = ORUZJE_DEAGLE; //deagle
  463.                     else if(listitem == 3) if(SBInfo[playerid][sbShotgun] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else  oruzje = ORUZJE_SHOTGUN;
  464.                     else if(listitem == 4) if(SBInfo[playerid][sbSawn] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else  oruzje = ORUZJE_SAWNOFF;
  465.                     else if(listitem == 5) if(SBInfo[playerid][sbSpas] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else  oruzje = ORUZJE_SPAS12;
  466.                     else if(listitem == 6) if(SBInfo[playerid][sbMicroSMG] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else  oruzje = ORUZJE_MICROSMG; //uzi
  467.                     else if(listitem == 7) if(SBInfo[playerid][sbMP5] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else  oruzje = ORUZJE_MP5; //mp5
  468.                     else if(listitem == 8) if(SBInfo[playerid][sbAK47] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else  oruzje = ORUZJE_AK47; //ak
  469.                         else if(listitem == 9) if(SBInfo[playerid][sbM4] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else  oruzje = ORUZJE_M4; //m4
  470.                         else if(listitem == 10) if(SBInfo[playerid][sbSniperRifle] >= 999) return SendClientMessage(playerid,-1," > Maksimalno ste istrenirali ovo oruzje"); else  oruzje = ORUZJE_RIFLE;
  471.                         SetPlayerPos(playerid,288.9389,-26.5014,1001.5156);
  472.                         new str[128]; format(str,128," *Pokrenuli ste treniranje! Imate %d minuta! Skill vam se puni na osnovu ispaljenih metaka!",MINUTI_TRENIRANJA);
  473.                         SendClientMessage(playerid, 0x00ff99ff, str);
  474.                         Trenira[playerid] = oruzje;
  475.                         ResetPlayerWeapons(playerid);
  476.                         GivePlayerWeapon(playerid,oruzje,999);
  477.                         SetPlayerArmedWeapon(playerid,oruzje);
  478.                         treniranjetimer[playerid] = SetTimerEx("TreniranjeTimer", KOLICINA_MINUTA*60000, false, "d", playerid);
  479.                         Trenirao[playerid] = KOLICINA_MINUTA;
  480.                 }
  481.                 return 1;
  482.         }
  483.         return 1;
  484. }
  485.  
  486. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  487. {
  488.         return 1;
  489. }
  490.  
  491. CMD:treniraj(playerid,params[]) {
  492.         if(Trenirao[playerid] > 0) {
  493.             new str[128]; format(str,128," > Mozes trenirati ponovo tek za %d minuta!",Trenirao[playerid]);
  494.             SendClientMessage(playerid,-1,str);
  495.             return 1;
  496.         }
  497.         if(IsPlayerInRangeOfPoint(playerid,3.0,294.8518,-38.5149,1001.5156)) {
  498.                 ShowPlayerDialog(playerid, D_TRENIRANJE, DIALOG_STYLE_LIST, "Izaberi oruzje", "Colt 45\nSilenced Pistol\nDesert Eagle\nShotgun\nSawnoff\nSpas12\nUzi\nMP5\nAK47\nM4\nRifle", "U redu", "Odustani");
  499.         }
  500.         return 1;
  501. }
  502.  
  503. CMD:streljana(playerid,params[]) {
  504.         if(IsPlayerAdmin(playerid)) {
  505.             new item[12];
  506.             if(sscanf(params,"s[12]",item)) return SendClientMessage(playerid,-1, " > Koristi: /streljana [kreiraj, pomeri, obrisi]");
  507.             if(!strcmp("kreiraj",item,true)) {
  508.                     new Float:x, Float:y, Float:z;
  509.                     GetPlayerPos(playerid,x,y,z);
  510.                     new bool:p = false; new file[32];
  511.                     for(new i = 0; i < MAX_STRELJANA; i++) {
  512.                         if(!p) {
  513.                                 format(file,sizeof(file),streljanepath,i);
  514.                                 if(!fexist(file)) {
  515.                                                 p = true;
  516.                                                 StreljanaInfo[i][EnterX] = x;
  517.                                                 StreljanaInfo[i][EnterY] = y;
  518.                                                 StreljanaInfo[i][EnterZ] = z;
  519.                                                 SacuvajStreljanu(i);
  520.                                                 KreirajStreljanaPickupLabel(i);
  521.                                                 new str[128]; format(str,128," > Kreirali ste streljanu [id: %d].", i);
  522.                                                 SendClientMessage(playerid,0x00ff99ff,str);
  523.                                 }
  524.                                 }
  525.                         }
  526.                         if(!p) return SendClientMessage(playerid,0xff0000aa," > Maksimalan broj streljana dostignut!");
  527.                 } else if(!strcmp("pomeri",item,true)) {
  528.                     ShowPlayerDialog(playerid, D_STRELJANA_POMERI, DIALOG_STYLE_INPUT, " > Streljana > Pomeri:", "Unesi ID streljane koju zelis pomeriti:","U redu", "Otkazi");
  529.                 } else if(!strcmp("obrisi",item,true)) {
  530.                     ShowPlayerDialog(playerid, D_STRELJANA_OBRISI, DIALOG_STYLE_INPUT, " > Streljana > Obrisi:", "Unesi ID streljane koju zelis da obrises:", "U redu", "Odustani");
  531.                 }
  532.         } else SendClientMessage(playerid,0xff0000ff," *Niste ovlasceni!");
  533.         return 1;
  534. }
  535.  
  536. stock SacuvajIgraca(playerid) {
  537.         new file[80]; format(file,sizeof(file),playerpath,pime(playerid));
  538.         if(!fexist(file)) dini_Create(file);
  539.         dini_IntSet(file,"Minuti",Trenirao[playerid]);
  540.         dini_IntSet(file,"Pistol",SBInfo[playerid][sbPistol]);
  541.         dini_IntSet(file,"Silenced",SBInfo[playerid][sbSilenced]);
  542.         dini_IntSet(file,"Deagle",SBInfo[playerid][sbDeagle]);
  543.         dini_IntSet(file,"Shotgun",SBInfo[playerid][sbShotgun]);
  544.         dini_IntSet(file,"Sawnoff",SBInfo[playerid][sbSawn]);
  545.         dini_IntSet(file,"Spas12",SBInfo[playerid][sbSpas]);
  546.         dini_IntSet(file,"MicroSMG",SBInfo[playerid][sbMicroSMG]);
  547.         dini_IntSet(file,"MP5",SBInfo[playerid][sbMP5]);
  548.         dini_IntSet(file,"AK47",SBInfo[playerid][sbAK47]);
  549.         dini_IntSet(file,"M4",SBInfo[playerid][sbM4]);
  550.         dini_IntSet(file,"SniperRifle",SBInfo[playerid][sbSniperRifle]);
  551.         return 1;
  552. }
  553.  
  554. stock UcitajIgraca(playerid) {
  555.     new file[80]; format(file,sizeof(file),playerpath,pime(playerid));
  556.     if(fexist(file)) {
  557.         Trenirao[playerid] = dini_Int(file,"Minuti");
  558.                 SBInfo[playerid][sbPistol] = dini_Int(file,"Pistol");
  559.                 SBInfo[playerid][sbSilenced] = dini_Int(file,"Silenced");
  560.                 SBInfo[playerid][sbDeagle] = dini_Int(file,"Deagle");
  561.                 SBInfo[playerid][sbShotgun] = dini_Int(file,"Shotgun");
  562.                 SBInfo[playerid][sbSawn] = dini_Int(file,"Sawnoff");
  563.                 SBInfo[playerid][sbSpas] = dini_Int(file,"Spas12");
  564.                 SBInfo[playerid][sbMicroSMG] = dini_Int(file,"MicroSMG");
  565.                 SBInfo[playerid][sbMP5] = dini_Int(file,"MP5");
  566.                 SBInfo[playerid][sbAK47] = dini_Int(file,"AK47");
  567.                 SBInfo[playerid][sbM4] = dini_Int(file,"M4");
  568.                 SBInfo[playerid][sbSniperRifle] = dini_Int(file,"SniperRifle");
  569.                 if(SBInfo[playerid][sbPistol] > 999) SBInfo[playerid][sbPistol] = 999;
  570.                 if(SBInfo[playerid][sbSilenced] > 999) SBInfo[playerid][sbSilenced] = 999;
  571.                 if(SBInfo[playerid][sbDeagle] > 999) SBInfo[playerid][sbDeagle] = 999;
  572.                 if(SBInfo[playerid][sbShotgun] > 999) SBInfo[playerid][sbShotgun] = 999;
  573.                 if(SBInfo[playerid][sbSawn] > 999) SBInfo[playerid][sbSawn] = 999;
  574.                 if(SBInfo[playerid][sbSpas] > 999) SBInfo[playerid][sbSpas] = 999;
  575.                 if(SBInfo[playerid][sbMicroSMG] > 999) SBInfo[playerid][sbMicroSMG] = 999;
  576.                 if(SBInfo[playerid][sbMP5] > 999) SBInfo[playerid][sbMP5] = 999;
  577.                 if(SBInfo[playerid][sbAK47] > 999) SBInfo[playerid][sbAK47] = 999;
  578.                 if(SBInfo[playerid][sbM4] > 999) SBInfo[playerid][sbM4] = 999;
  579.                 if(SBInfo[playerid][sbSniperRifle] > 999) SBInfo[playerid][sbSniperRifle] = 999;
  580.         }
  581.         return 1;
  582. }
  583.  
  584. stock pime(playerid) {
  585.         new name[MAX_PLAYER_NAME];
  586.         GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  587.         return name;
  588. }
  589.  
  590. stock SacuvajStreljanu(id) {
  591.         new file[32]; format(file,sizeof(file),streljanepath,id);
  592.         if(!fexist(file)) dini_Create(file);
  593.         dini_FloatSet(file,"X",StreljanaInfo[id][EnterX]);
  594.         dini_FloatSet(file,"Y",StreljanaInfo[id][EnterY]);
  595.         dini_FloatSet(file,"Z",StreljanaInfo[id][EnterZ]);
  596.         return 1;
  597. }
  598.  
  599. stock UcitajStreljanu(id) {
  600.     new file[32]; format(file,sizeof(file),streljanepath,id);
  601.     if(fexist(file)) {
  602.                 StreljanaInfo[id][EnterX] = dini_Float(file,"X");
  603.                 StreljanaInfo[id][EnterY] = dini_Float(file,"Y");
  604.                 StreljanaInfo[id][EnterZ] = dini_Float(file,"Z");
  605.                 KreirajStreljanaPickupLabel(id);
  606.     }
  607.     return 1;
  608. }
  609.  
  610. stock KreirajStreljanaPickupLabel(id) {
  611.         StreljanaInfo[id][Pickup] = CreatePickup(19134,1,StreljanaInfo[id][EnterX],StreljanaInfo[id][EnterY],StreljanaInfo[id][EnterZ],0);
  612.         new str[128]; format(str,128,"Streljana %d\nDa udjes pritisni\n'ENTER'",id);
  613.         StreljanaInfo[id][Label] = Create3DTextLabel(str,0xff9900ff,StreljanaInfo[id][EnterX],StreljanaInfo[id][EnterY],StreljanaInfo[id][EnterZ],15,0,1);
  614.         StreljanaInfo[id][MapIcon] = CreateDynamicMapIcon(StreljanaInfo[id][EnterX],StreljanaInfo[id][EnterY],StreljanaInfo[id][EnterZ],18,0,-1,-1,-1,200.0,MAPICON_LOCAL);
  615.         return 1;
  616. }
  617.  
  618. stock UpdateStreljanaPickupLabel(id) {
  619.         DestroyPickup(StreljanaInfo[id][Pickup]);
  620.         Delete3DTextLabel(StreljanaInfo[id][Label]);
  621.         DestroyDynamicMapIcon(StreljanaInfo[id][MapIcon]);
  622.         StreljanaInfo[id][Pickup] = CreatePickup(19134,1,StreljanaInfo[id][EnterX],StreljanaInfo[id][EnterY],StreljanaInfo[id][EnterZ],0);
  623.         new str[128]; format(str,128,"Streljana %d\nDa udjes pritisni\n'ENTER'",id);
  624.         StreljanaInfo[id][Label] = Create3DTextLabel(str,0xff9900ff,StreljanaInfo[id][EnterX],StreljanaInfo[id][EnterY],StreljanaInfo[id][EnterZ],15,0,1);
  625.         StreljanaInfo[id][MapIcon] = CreateDynamicMapIcon(StreljanaInfo[id][EnterX],StreljanaInfo[id][EnterY],StreljanaInfo[id][EnterZ],18,0,-1,-1,-1,200.0,MAPICON_LOCAL);
  626.         return 1;
  627. }
  628.  
  629. stock ObrisiStreljanaPickupLabel(id) {
  630.         if(StreljanaInfo[id][EnterX] != 0) {
  631.             DestroyPickup(StreljanaInfo[id][Pickup]);
  632.                 Delete3DTextLabel(StreljanaInfo[id][Label]);
  633.                 DestroyDynamicMapIcon(StreljanaInfo[id][MapIcon]);
  634.         }
  635.         return 1;
  636. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top