Guest User

Untitled

a guest
Mar 22nd, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 50.01 KB | None | 0 0
  1. /*
  2. |WRT|WaRaT v1.0.0. by Snimpe
  3. RP GAME MODE
  4. *********
  5. *Komande*
  6. *********
  7. RCON
  8. ----
  9. /smash-dok je u vozilo ono skroz smrvi, unisti i razlupa vozilo
  10. /makeleader-postavi lidera
  11. /hesoyam-250000$, 100HP, 100Armour, auto nov
  12. /veh-stvara vozila
  13. /makeadmin-treba napraviti
  14.  
  15.  
  16. */
  17.  
  18. //==============================================================================
  19. //==============================================================================
  20. //==============================================================================
  21. #include <a_samp>
  22. #include <YSI\y_ini>
  23. #include <sscanf2>
  24. #include <ZCMD>
  25. #include <foreach>
  26.  
  27. #define SCM SendClientMessage
  28.  
  29. #define DIALOG_REGISTER 1
  30. #define DIALOG_LOGIN 2
  31. #define DIALOG_SUCCESS_1 3
  32. #define DIALOG_SUCCESS_2 4
  33. #define DIALOG_ORG_INVITE 5
  34.  
  35. #define PATH "/Users/%s.ini"
  36.  
  37. #define COLOR_ORANGE "{FF6600}"
  38. #define COL_WHITE "{FFFFFF}"
  39. #define COL_RED "{F81414}"
  40. #define COL_GREEN "{00FF22}"
  41. #define COL_LIGHTBLUE "{00CED1}"
  42. #define COLOR_BLUE 0x2711F2
  43. #define COLOR_GREY 0xAFAFAFAA
  44. #define C_WHITE 0xFFFFFFAA
  45.  
  46. #define MAX_ORGS 1
  47. //==============================================================================
  48. new KillMinutniTimer;
  49. new OOC = 0;
  50. new gPoliceCar[1]; // 2 je broj koliko ima policijskih vozila, ako zelite dodavat jos vozila LSPD organizaciji (ili nekoj novoj organizaciji), taj broj mora biti jednak broju vozila te org.
  51.  
  52. //==============================================================================
  53. enum pInfo
  54. {
  55. pPass,
  56. pCash,
  57. pLevel,
  58. pRespekti,
  59. pPayPoeni,
  60. pAdmin,
  61. pKills,
  62. pDeaths,
  63. pLider,
  64. pClan,
  65. pRank,
  66. pSkin,
  67. pOrg_Skin
  68.  
  69. }
  70. new PlayerInfo[MAX_PLAYERS][pInfo];
  71. //==============================================================================
  72. forward LoadUser_data(playerid,name[],value[]);
  73. public LoadUser_data(playerid,name[],value[])
  74. {
  75. INI_Int("Password",PlayerInfo[playerid][pPass]);
  76. INI_Int("Cash",PlayerInfo[playerid][pCash]);
  77. INI_Int("Level",PlayerInfo[playerid][pOrg_Skin]);
  78. INI_Int("Respekti",PlayerInfo[playerid][pOrg_Skin]);
  79. INI_Int("PayDayPoeni",PlayerInfo[playerid][pOrg_Skin]);
  80. INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  81. INI_Int("Kills",PlayerInfo[playerid][pKills]);
  82. INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  83. INI_Int("Lider",PlayerInfo[playerid][pLider]);
  84. INI_Int("Clan",PlayerInfo[playerid][pClan]);
  85. INI_Int("Rank",PlayerInfo[playerid][pRank]);
  86. INI_Int("Skin",PlayerInfo[playerid][pSkin]);
  87. INI_Int("Org Skin",PlayerInfo[playerid][pOrg_Skin]);
  88.  
  89. return 1;
  90. }
  91. //==============================================================================
  92. stock UserPath(playerid)
  93. {
  94. new string[128],playername[MAX_PLAYER_NAME];
  95. GetPlayerName(playerid,playername,sizeof(playername));
  96. format(string,sizeof(string),PATH,playername);
  97. return string;
  98. }
  99.  
  100. /*COL_REDits to Dracoblue*/
  101. stock udb_hash(buf[]) {
  102. new length=strlen(buf);
  103. new s1 = 1;
  104. new s2 = 0;
  105. new n;
  106. for (n=0; n<length; n++)
  107. {
  108. s1 = (s1 + buf[n]) % 65521;
  109. s2 = (s2 + s1) % 65521;
  110. }
  111. return (s2 << 16) + s1;
  112. }
  113. //==============================================================================
  114. //==============================================================================
  115. main()
  116. {
  117. print("\n************************************");
  118. print(" |WRT| v1.0.0");
  119. print("\n************************************");
  120. }
  121. //==============================================================================
  122. //==============================================================================
  123. //==============================================================================
  124. public OnGameModeInit()
  125. {
  126. SetGameModeText("|WRT| v1.0.0");
  127. KillMinutniTimer = SetTimer("MinutniTimer", 1000, 1);//jedna minuta
  128. gPoliceCar[0] = AddStaticVehicleEx(597, 1594.9362, -1679.0898, 5.8210, 0.0000, -1, -1, 100); // Stvara vozilo LSPD-a i pamti njegov ID u varijabli gPoliceCar[0]
  129. return 1;
  130. }
  131. //==============================================================================
  132. //==============================================================================
  133. //==============================================================================
  134. public OnGameModeExit()
  135. {
  136. KillTimer(KillMinutniTimer);//uništava timer
  137. return 1;
  138. }
  139. //==============================================================================
  140. //==============================================================================
  141. //==============================================================================
  142. public OnPlayerRequestClass(playerid, classid)
  143. {
  144. SetSpawnInfo(playerid, 0, 0,1544.5767,-1373.3291,329.7563,179.8415,46,1,0,0,0,0); //
  145. SpawnPlayer(playerid);
  146. return 1;
  147. }
  148. //==============================================================================
  149. //==============================================================================
  150. //==============================================================================
  151. public OnPlayerConnect(playerid)
  152. {
  153. if(fexist(UserPath(playerid)))
  154. {
  155. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  156. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password below to login.","Login","Quit");
  157. }
  158. else
  159. {
  160. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Type your password below to register a new account.","Register","Quit");
  161. }
  162. return 1;
  163. }
  164. //==============================================================================
  165. //==============================================================================
  166. //==============================================================================
  167. public OnPlayerDisconnect(playerid, reason)
  168. {
  169. new INI:File = INI_Open(UserPath(playerid));
  170. INI_SetTag(File,"data");
  171. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  172. INI_WriteInt(File,"Level",PlayerInfo[playerid][pOrg_Skin]);
  173. INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  174. INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  175. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  176. INI_WriteInt(File,"Lider",PlayerInfo[playerid][pLider]);
  177. INI_Close(File);
  178. return 1;
  179. }
  180. //==============================================================================
  181. //==============================================================================
  182. //==============================================================================
  183. public OnPlayerSpawn(playerid)
  184. {
  185. GivePlayerWeapon(playerid, 46, 1);
  186. if (PlayerInfo[playerid][pClan] > 0)
  187. {
  188. switch(PlayerInfo[playerid][pClan])
  189. {
  190. case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  191. {
  192. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
  193. SetPlayerFacingAngle(playerid, 270.1425); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem
  194.  
  195. SetPlayerSkin(playerid, PlayerInfo[playerid][pOrg_Skin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
  196. }
  197. // Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju za spawn, sto je potrebno svaki put kada zelite dodati novu organizaciju
  198. /*case 2: // Druga organizacije, nazovimo je FBI
  199. {
  200. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
  201. SetPlayerFacingAngle(playerid, 270.1425); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem
  202.  
  203. SetPlayerSkin(playerid, PlayerInfo[playerid][pOrg_Skin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
  204. }*/
  205. }
  206. }
  207. else
  208. {
  209. SetPlayerPos(playerid, 1544.5767, -1373.3291, 329.7563);
  210. SetPlayerFacingAngle(playerid, 179.8415);
  211. }
  212. return 1;
  213. }
  214. //==============================================================================
  215. //==============================================================================
  216. //==============================================================================
  217.  
  218. public OnPlayerDeath(playerid, killerid, reason)
  219. {
  220. PlayerInfo[killerid][pKills]++;
  221. PlayerInfo[playerid][pDeaths]++;
  222. return 1;
  223. }
  224. //==============================================================================
  225. //==============================================================================
  226. //==============================================================================
  227.  
  228. public OnVehicleSpawn(vehicleid)
  229. {
  230. return 1;
  231. }
  232. //==============================================================================
  233. //==============================================================================
  234. //==============================================================================
  235. public OnVehicleDeath(vehicleid, killerid)
  236. {
  237. return 1;
  238. }
  239. //==============================================================================
  240. //==============================================================================
  241. //==============================================================================
  242. public OnPlayerText(playerid, text[])
  243. {
  244.  
  245. new LoseRijeci[][] =
  246. {
  247. {"kurac"},
  248. {"qrac"},
  249. {"racku"},
  250. {"racq"},
  251. {"jebem"},
  252. {"picka"}
  253. }
  254. ;
  255. for(new i; i != sizeof(LoseRijeci); ++i)
  256. {
  257. AntiPsovka(text, LoseRijeci[i]);
  258. }
  259. return 1;
  260. }
  261. //==============================================================================
  262. //==============================================================================
  263. //==============================================================================
  264. public OnPlayerCommandText(playerid, cmdtext[])
  265. {
  266. return SendClientMessage(playerid, 0xAA3333AA, "ERROR: " "Komanda koju ste uneli ne postoji!");
  267. }
  268. //==============================================================================
  269. //==============================================================================
  270. //==============================================================================
  271. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  272. {
  273. return 1;
  274. }
  275. //==============================================================================
  276. //==============================================================================
  277. //==============================================================================
  278. public OnPlayerExitVehicle(playerid, vehicleid)
  279. {
  280. return 1;
  281. }
  282. //==============================================================================
  283. //==============================================================================
  284. //==============================================================================
  285. public OnPlayerStateChange(playerid, newstate, oldstate)
  286. {
  287. if (newstate == PLAYER_STATE_DRIVER) // Ako je usao u vozilo kao vozac
  288. {
  289. new
  290. iVehicleID = GetPlayerVehicleID(playerid);
  291.  
  292. // Provjerava da li je igrac usao u vozilo org. LSPD i provjerava da li je clan te org., ako nije izbacit ce ga iz vozila
  293. if (IsAPoliceCar(iVehicleID) && (PlayerInfo[playerid][pClan] != 1 || PlayerInfo[playerid][pLider] != 1))
  294. {
  295. SendClientMessage(playerid, C_WHITE, "ERROR: Nisi clan Los Santos Police Departmenta.");
  296.  
  297. RemovePlayerFromVehicle(playerid);
  298. }
  299. }
  300. return 1;
  301. }
  302. //==============================================================================
  303. stock IsAPoliceCar(iVehicleID) // By Joey_
  304. {
  305. for(new iIdx = 0; iIdx < sizeof(gPoliceCar); iIdx++)
  306. {
  307. if (gPoliceCar[iIdx] == iVehicleID)
  308. return 1;
  309. }
  310. return 0;
  311. }
  312. //==============================================================================
  313. stock PayDayPlata(playerid)
  314. {
  315. new SljedeciLvl, string[128];
  316. PlayerInfo[playerid][pRespekti] ++;//dodaje igracu jedan respekt
  317.  
  318. if(PlayerInfo[playerid][pPayPoeni] >= 30)//ako igrac ima više od 30 pay poena vraca mu ih na 0
  319. {
  320. PlayerInfo[playerid][pPayPoeni] = 0;//stavlja igracu pay poene na 0
  321. }
  322.  
  323. SljedeciLvl = 3 * PlayerInfo[playerid][pLevel] + 1;
  324. if(PlayerInfo[playerid][pRespekti] >= SljedeciLvl)//ako igrac ima više respekta od zadanog iznad
  325. {
  326. PlayerInfo[playerid][pLevel] ++;//dodaje igracu level+
  327. PlayerInfo[playerid][pRespekti] = 0;//vraca igracu respekte na 0
  328. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);//postavlja igracu level
  329. format(string,sizeof(string),"Cestitamo, presli ste na level %i!", PlayerInfo[playerid][pLevel]);
  330. SendClientMessage(playerid, -1, string);//šalje igracu poruku
  331. }
  332.  
  333. new osnova = 0, iznosplace = 0; osnova = 55 + random(99); iznosplace = osnova*PlayerInfo[playerid][pLevel];//ovo je za pare, to valjda znate necu objašnjavati
  334. format(string,sizeof(string),"Iznos vase plate je: %i", iznosplace);
  335. SendClientMessage(playerid, -1, string);//šalje igracu poruku
  336. return 1;
  337. }
  338. //==============================================================================
  339. forward MinutniTimer();
  340. public MinutniTimer()
  341. {
  342. for(new playerid = 0;playerid < GetMaxPlayers();playerid++)
  343. {
  344. PlayerInfo[playerid][pPayPoeni] ++; //277
  345. if(PlayerInfo[playerid][pPayPoeni] >= 30)
  346. {
  347. PayDayPlata(playerid);
  348. }
  349. }
  350. return 1;
  351. }
  352. //==============================================================================
  353. //==============================================================================
  354. //==============================================================================
  355. public OnPlayerEnterCheckpoint(playerid)
  356. {
  357. return 1;
  358. }
  359. //==============================================================================
  360. //==============================================================================
  361. //==============================================================================
  362. public OnPlayerLeaveCheckpoint(playerid)
  363. {
  364. return 1;
  365. }
  366. //==============================================================================
  367. //==============================================================================
  368. //==============================================================================
  369. public OnPlayerEnterRaceCheckpoint(playerid)
  370. {
  371. return 1;
  372. }
  373. //==============================================================================
  374. //==============================================================================
  375. //==============================================================================
  376. public OnPlayerLeaveRaceCheckpoint(playerid)
  377. {
  378. return 1;
  379. }
  380. //==============================================================================
  381. //==============================================================================
  382. //==============================================================================
  383. public OnRconCommand(cmd[])
  384. {
  385. return 1;
  386. }
  387. //==============================================================================
  388. //==============================================================================
  389. //==============================================================================
  390. public OnPlayerRequestSpawn(playerid)
  391. {
  392. return 1;
  393. }
  394. //==============================================================================
  395. //==============================================================================
  396. //==============================================================================
  397. public OnObjectMoved(objectid)
  398. {
  399. return 1;
  400. }
  401. //==============================================================================
  402. //==============================================================================
  403. //==============================================================================
  404. public OnPlayerObjectMoved(playerid, objectid)
  405. {
  406. return 1;
  407. }
  408. //==============================================================================
  409. //==============================================================================
  410. //==============================================================================
  411. public OnPlayerPickUpPickup(playerid, pickupid)
  412. {
  413. return 1;
  414. }
  415. //==============================================================================
  416. //==============================================================================
  417. //==============================================================================
  418. public OnVehicleMod(playerid, vehicleid, componentid)
  419. {
  420. return 1;
  421. }
  422. //==============================================================================
  423. //==============================================================================
  424. //==============================================================================
  425. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  426. {
  427. return 1;
  428. }
  429. //==============================================================================
  430. //==============================================================================
  431. //==============================================================================
  432. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  433. {
  434. return 1;
  435. }
  436. //==============================================================================
  437. //==============================================================================
  438. //==============================================================================
  439. public OnPlayerSelectedMenuRow(playerid, row)
  440. {
  441. return 1;
  442. }
  443. //==============================================================================
  444. //==============================================================================
  445. //==============================================================================
  446. public OnPlayerExitedMenu(playerid)
  447. {
  448. return 1;
  449. }
  450. //==============================================================================
  451. //==============================================================================
  452. //==============================================================================
  453. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  454. {
  455. return 1;
  456. }
  457. //==============================================================================
  458. //==============================================================================
  459. //==============================================================================
  460. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  461. {
  462. return 1;
  463. }
  464. //==============================================================================
  465. //==============================================================================
  466. //==============================================================================
  467. public OnRconLoginAttempt(ip[], password[], success)
  468. {
  469. return 1;
  470. }
  471. //==============================================================================
  472. //==============================================================================
  473. //==============================================================================
  474. public OnPlayerUpdate(playerid)
  475. {
  476. return 1;
  477. }
  478. //==============================================================================
  479. //==============================================================================
  480. //==============================================================================
  481. public OnPlayerStreamIn(playerid, forplayerid)
  482. {
  483. return 1;
  484. }
  485. //==============================================================================
  486. //==============================================================================
  487. //==============================================================================
  488. public OnPlayerStreamOut(playerid, forplayerid)
  489. {
  490. return 1;
  491. }
  492. //==============================================================================
  493. //==============================================================================
  494. //==============================================================================
  495. public OnVehicleStreamIn(vehicleid, forplayerid)
  496. {
  497. return 1;
  498. }
  499. //==============================================================================
  500. //==============================================================================
  501. //==============================================================================
  502. public OnVehicleStreamOut(vehicleid, forplayerid)
  503. {
  504. return 1;
  505. }
  506. //==============================================================================
  507. //==============================================================================
  508. //==============================================================================
  509. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  510. {
  511. switch( dialogid )
  512. {
  513. case DIALOG_REGISTER:
  514. {
  515. if (!response) return Kick(playerid);
  516. if(response)
  517. {
  518. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
  519. new INI:File = INI_Open(UserPath(playerid));
  520. INI_SetTag(File,"data");
  521. INI_WriteInt(File,"Password",udb_hash(inputtext));
  522. INI_WriteInt(File,"Cash",0);
  523. INI_WriteInt(File,"Level",0);
  524. INI_WriteInt(File,"Respekti",0);
  525. INI_WriteInt(File,"PayDayPoeni",0);
  526. INI_WriteInt(File,"Admin",0);
  527. INI_WriteInt(File,"Kills",0);
  528. INI_WriteInt(File,"Deaths",0);
  529. INI_Close(File);
  530.  
  531. SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 46, 1, 0, 0, 0, 0);
  532. SpawnPlayer(playerid);
  533. ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
  534. }
  535. }
  536. case DIALOG_LOGIN:
  537. {
  538. if ( !response ) return Kick ( playerid );
  539. if( response )
  540. {
  541. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  542. {
  543. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  544. GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  545. ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"You have successfully logged in!","Ok","");
  546. }
  547. else
  548. {
  549. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
  550. }
  551. return 1;
  552. }
  553. }
  554. case DIALOG_ORG_INVITE: // Ovdje ce se izvrsiti daljnji kod nakon sto je igrac pritisnuo 'Prihvacam' ili 'Ne prihvacam'
  555. {
  556. if (response) // Ako je igrac pritisnuo 'Prihvacam'
  557. {
  558. switch(PlayerInfo[playerid][pClan])
  559. {
  560. case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  561. {
  562. SetPlayerSkin(playerid, 280); // Broj 280 je ID skina za rank 1 u organizaciji LSPD, vi to mozete promijeniti na bilo koji ID skina koji vama odgovara
  563.  
  564. SendClientMessage(playerid, C_WHITE, "INFO: Prihvatili ste poziv za ulazak u "COL_RED"Los Santos Police Department");
  565. }
  566. }
  567. }
  568. else // Ako je igrac pritisnuo 'Ne prihvacam'
  569. {
  570. // Resetiramo igraceve varijable na 0 jer nije prihvatio ulazak u organizaciju
  571. PlayerInfo[playerid][pClan] = 0;
  572. PlayerInfo[playerid][pRank] = 0;
  573.  
  574. SendClientMessage(playerid, C_WHITE, "INFO: Odbili ste poziv za ulazak u organizaciju");
  575. }
  576. }
  577. }
  578. //=========================================================
  579.  
  580. //=========================================================
  581. return 1;
  582. }
  583. //==============================================================================
  584. //==============================================================================
  585. //==============================================================================
  586. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  587. {
  588. return 1;
  589. }
  590. //==============================================================================
  591. //==============================================================================
  592. //==============================================================================
  593.  
  594. //==============================================================================
  595. //==============================================================================
  596. //==============================================================================
  597. forward SendAdminMessage(color, string[]);
  598. public SendAdminMessage(color, string[])
  599. {
  600. for(new i = 0; i < MAX_PLAYERS; i++)
  601. {
  602. if(IsPlayerConnected(i))
  603. {
  604.  
  605. if(PlayerInfo[i][pAdmin] >= 1)
  606. {
  607. SCM(i, color, string);
  608. }
  609. }
  610. }
  611. }
  612. //==============================================================================
  613. //==============================================================================
  614. //==============================================================================
  615. forward Glad();
  616. public Glad()
  617. {
  618. for(new i=0;i<MAX_PLAYERS;i++)
  619. {
  620. new Float:HP;
  621. GetPlayerHealth(i, HP);
  622. SetPlayerHealth(i, HP-3);
  623. }
  624. return 1;
  625. }
  626. //==============================================================================
  627. //==============================================================================
  628. //==============================================================================
  629. stock AntiPsovka(string[], LoseRijeci[], zamjeni = '*')
  630. {
  631. new i;
  632. while((i = strfind(string, LoseRijeci, true)) != -1)
  633. {
  634. for(new x = (i + strlen(LoseRijeci)); i != x; ++i)
  635. {
  636. string[i] = zamjeni;
  637. }
  638. }
  639. return 1;
  640. }
  641. //==============================================================================
  642. //==============================================================================
  643. CMD:makeleader(playerid, params[])
  644. {
  645. if (IsPlayerAdmin(playerid)) // Provjerava da li je igrac RCON admin, vi to mozete promijeniti u svoju provjeru
  646. {
  647. new
  648. iPlayerID,
  649. iOrgID,
  650. szPlayerName[MAX_PLAYER_NAME],
  651. szMessage[105];
  652.  
  653. if (sscanf(params, "ud", iPlayerID, iOrgID)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  654. return SendClientMessage(playerid, C_WHITE, "KORISTI: /makeleader [igracev ID/dio imena] [ID organizacije]");
  655. else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
  656. return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
  657. else if (iOrgID < 1 || iOrgID > MAX_ORGS) // Ako je ID organizacije koju je igrac upisao manja od 1 ili veca maksimalnog broja organizacija, ispisuje mu tu poruku
  658. return SendClientMessage(playerid, C_WHITE, "ERROR: ID organizacije ne smije biti manji od 1 ili veci od "#MAX_ORGS);
  659.  
  660. PlayerInfo[iPlayerID][pLider] = iOrgID; // Postavlja igracevu varijablu za lidera na ID organizacije, jer moramo negdje zapamtit koje organizacije je igrac lider
  661. PlayerInfo[iPlayerID][pRank] = 6; // Postavlja igracevu varijablu za rank na 6, to vi mozete promijeniti ako ne zelite da vam je najveci rank 6
  662.  
  663. switch(iOrgID)
  664. {
  665. case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  666. {
  667. PlayerInfo[iPlayerID][pSkin] = GetPlayerSkin(iPlayerID); // Sprema igracev skin tako da ako ikad bude izbacen iz organizacije, dobija svoj stari skin natrag
  668. PlayerInfo[iPlayerID][pOrg_Skin] = 283; // Broj 283 je ID skina lidera organizacije, to mozete promijeniti u koji kod skin ID vi zelite
  669.  
  670. SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pOrg_Skin]); // Postavlja igracu skin za lidera organizacije
  671. }
  672. // Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju u /makeleader komandu, sto je potrebno svaki put kada zelite dodati novu organizaciju
  673. /*case 2: // Druga organizacije, nazovimo je FBI
  674. {
  675. PlayerInfo[iPlayerID][pSkin] = GetPlayerSkin(iPlayerID); // Sprema igracev skin tako da ako ikad bude izbacen iz organizacije, dobija svoj stari skin natrag
  676. PlayerInfo[iPlayerID][pOrg_Skin] = 283; // Broj 283 je ID skina lidera organizacije, to mozete promijeniti u koji kod skin ID vi zelite
  677.  
  678. SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pOrg_Skin]); // Postavlja igracu skin za lidera organizacije
  679. }*/
  680. }
  681.  
  682. GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  683.  
  684. format(szMessage, sizeof(szMessage), "INFO: Admin %s vas je postavio za lidera organizacije %s", szPlayerName, GetOrgNameByID(iOrgID));
  685. SendClientMessage(iPlayerID, C_WHITE, szMessage);
  686.  
  687. GetPlayerName(iPlayerID, szPlayerName, MAX_PLAYER_NAME);
  688.  
  689. format(szMessage, sizeof(szMessage), "INFO: Postavio si igraca %s za lidera organizacije %s", szPlayerName, GetOrgNameByID(iOrgID));
  690. SendClientMessage(playerid, C_WHITE, szMessage);
  691. }
  692. else
  693. SendClientMessage(playerid, C_WHITE, "ERROR: Moras biti RCON admin da koristis ovu komandu.");
  694. return 1;
  695. }
  696.  
  697. stock GetOrgNameByID(iOrgID) // By Joey_
  698. {
  699. new
  700. szOrgName[29];
  701.  
  702. switch(iOrgID)
  703. {
  704. case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  705. szOrgName = "Los Santos Police Department";
  706. default: // Ako ne postoji ID takve organizacije
  707. szOrgName = "Nepoznata organizacija";
  708. }
  709. return szOrgName;
  710. }
  711. //==============================================================================
  712. //==============================================================================
  713. CMD:invite(playerid, params[])
  714. {
  715. if (PlayerInfo[playerid][pLider] > 0) // Provjerava da li je igrac lider icega
  716. {
  717. new
  718. iPlayerID,
  719. szPlayerName[MAX_PLAYER_NAME],
  720. szInviteMsg[241];
  721.  
  722. if (sscanf(params, "u", iPlayerID)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  723. return SendClientMessage(playerid, C_WHITE, "KORISTI: /invite [igracev ID/dio imena]");
  724. else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
  725. return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
  726.  
  727. GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  728.  
  729. switch(PlayerInfo[playerid][pLider])
  730. {
  731. case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  732. {
  733. PlayerInfo[iPlayerID][pClan] = PlayerInfo[playerid][pLider]; // Ovdje postavljamo igracu kojeg zelimo pozvati u organizaciju varijablu na ID organizacije (tako da kasnije znamo u kojoj je organizaciji)
  734. PlayerInfo[iPlayerID][pRank] = 1; // Postavlja igracu kojeg zelimo pozvati u organizaciju rank na 1
  735.  
  736. // Ovdje formatiramo poruku koju cemo poslati igracu koji je pozvan u organizaciju
  737. // Preko te poruke ce pozvani igrac prihvatiti ili ne prihvatiti ulazak u organizaciju
  738. format(szInviteMsg, sizeof(szInviteMsg), "Lider %s vas je pozvao u organizaciju Los Santos Police Department.\n\nPritisnite tipku 'Prihvacam' ako zelite prihvatiti poziv za ulazak u tu organizaciju\nili pritisnite tipku 'Odbijam' ako ne zelite prihvatiti.", szPlayerName);
  739. }
  740. // Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju u /invite komandu, sto je potrebno svaki put kada zelite dodati novu organizaciju
  741. /*case 2: // Druga organizacije, nazovimo je FBI
  742. {
  743. PlayerInfo[iPlayerID][pClan] = PlayerInfo[playerid][pLider]; // Ovdje postavljamo igracu kojeg zelimo pozvati u organizaciju varijablu na ID organizacije (tako da kasnije znamo u kojoj je organizaciji)
  744. PlayerInfo[iPlayerID][pRank] = 1; // Postavlja igracu kojeg zelimo pozvati u organizaciju rank na 1
  745.  
  746. // Ovdje formatiramo poruku koju cemo poslati igracu koji je pozvan u organizaciju
  747. // Preko te poruke ce pozvani igrac prihvatiti ili ne prihvatiti ulazak u organizaciju
  748. // Kad dodajete novu organizaciju, morate promijeniti neke nazive u tekstu kako ne bi svaki tekst bio isti (govorim o imenu organizacije)
  749. format(szInviteMsg, sizeof(szInviteMsg), "Lider %s vas je pozvao u organizaciju FBI.\n\nPritisnite tipku 'Prihvacam' ako zelite prihvatiti poziv za ulazak u tu organizaciju\nili pritisnite tipku 'Odbijam' ako ne zelite prihvatiti.", szPlayerName);
  750. }*/
  751. }
  752.  
  753. ShowPlayerDialog(iPlayerID, DIALOG_ORG_INVITE, DIALOG_STYLE_MSGBOX, "POZVANI STE U ORGANIZACIJU", szInviteMsg, "Prihvacam", "Odbijam");
  754. }
  755. else
  756. SendClientMessage(playerid, C_WHITE, "ERROR: Moras biti lider da koristis ovu komandu.");
  757. return 1;
  758. }
  759.  
  760. //==============================================================================
  761. //==============================================================================
  762. CMD:rankup(playerid, params[])
  763. {
  764. if (PlayerInfo[playerid][pLider] > 0) // Provjerava da li je igrac lider icega
  765. {
  766. new
  767. iPlayerID,
  768. iRankNum,
  769. szPlayerName[MAX_PLAYER_NAME],
  770. szMessage[71];
  771.  
  772. if (sscanf(params, "ud", iPlayerID, iRankNum)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  773. return SendClientMessage(playerid, C_WHITE, "KORISTI: /rankup [igracev ID/dio imena] [rank]");
  774. else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
  775. return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
  776. else if (iRankNum < 1 || iRankNum > 6) // Ako je broj ranka manji od 1 ili veci od 6, ispisuje mu tu poruku
  777. return SendClientMessage(playerid, C_WHITE, "ERROR: ID organizacije ne smije biti manji od 1 ili veci od 6.");
  778. else if (PlayerInfo[iPlayerID][pClan] != PlayerInfo[playerid][pLider]) // Provjerava da li su igrac i ID igraca koji je upisao u istoj organizaciji
  779. return SendClientMessage(playerid, C_WHITE, "ERROR: Taj igrac nije u vasoj organizaciji.");
  780.  
  781. PlayerInfo[iPlayerID][pRank] = iRankNum; // Postavlja igracevu varijablu na broj ranka, tako da bi kasnije mogli znati koji je igrac rank
  782.  
  783. SetPlayerOrgSkin(iPlayerID, ((PlayerInfo[iPlayerID][pLider] > 0) ? (PlayerInfo[iPlayerID][pLider]) : (PlayerInfo[iPlayerID][pClan])), iRankNum);
  784.  
  785. GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  786.  
  787. format(szMessage, sizeof(szMessage), "INFO: Lider %s ti je postavio rank na "COL_RED"%d", szPlayerName, iRankNum);
  788. SendClientMessage(iPlayerID, C_WHITE, szMessage);
  789.  
  790. GetPlayerName(iPlayerID, szPlayerName, MAX_PLAYER_NAME);
  791.  
  792. format(szMessage, sizeof(szMessage), "INFO: Postavio si clanu %s rank na "COL_RED"%d", szPlayerName, iRankNum);
  793. SendClientMessage(playerid, C_WHITE, szMessage);
  794. }
  795. else
  796. SendClientMessage(playerid, C_WHITE, "ERROR: Moras biti lider da koristis ovu komandu.");
  797. return 1;
  798. }
  799.  
  800. stock SetPlayerOrgSkin(iPlayerID, iOrgID, iRank)
  801. {
  802. switch(iOrgID)
  803. {
  804. case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  805. {
  806. switch(iRank) // Rankovi za prvu organizaciju
  807. {
  808. case 1: // 1. Rank
  809. PlayerInfo[iPlayerID][pOrg_Skin] = 284; // 284 je ID skina za 1. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  810. case 2: // 2. Rank
  811. PlayerInfo[iPlayerID][pOrg_Skin] = 280; // 280 je ID skina za 2. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  812. case 3: // 3. Rank
  813. PlayerInfo[iPlayerID][pOrg_Skin] = 281; // 281 je ID skina za 3. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  814. case 4: // 4. Rank
  815. PlayerInfo[iPlayerID][pOrg_Skin] = 282; // 282 je ID skina za 4. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  816. case 5: // 5. Rank
  817. PlayerInfo[iPlayerID][pOrg_Skin] = 282; // 282 je ID skina za 5. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  818. case 6: // 6. Rank
  819. PlayerInfo[iPlayerID][pOrg_Skin] = 288; // 288 je ID skina za 6. rank u LSPD organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  820. default:
  821. PlayerInfo[iPlayerID][pOrg_Skin] = 284; // Ovaj ID skina neka vam bude uvijek jednak 1. ranku, on je tu samo ako je doslo do neke greske kod broja ranka
  822. }
  823. }
  824. // Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju, sto je potrebno svaki put kada zelite dodati novu organizaciju
  825. /*case 2: // Druga organizacija, nazovimo je FBI
  826. {
  827. switch(iRank) // Rankovi za drugu organizaciju
  828. {
  829. case 1: // 1. Rank
  830. PlayerInfo[iPlayerID][pOrg_Skin] = 166; // 166 je ID skina za 1. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  831. case 2: // 2. Rank
  832. PlayerInfo[iPlayerID][pOrg_Skin] = 166; // 166 je ID skina za 2. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  833. case 3: // 3. Rank
  834. PlayerInfo[iPlayerID][pOrg_Skin] = 165; // 165 je ID skina za 3. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  835. case 4: // 4. Rank
  836. PlayerInfo[iPlayerID][pOrg_Skin] = 165; // 165 je ID skina za 4. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  837. case 5: // 5. Rank
  838. PlayerInfo[iPlayerID][pOrg_Skin] = 286; // 286 je ID skina za 5. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  839. case 6: // 6. Rank
  840. PlayerInfo[iPlayerID][pOrg_Skin] = 286; // 286 je ID skina za 6. rank u FBI organizaciji i taj broj mjenjate u svoj ID skina koji zelite
  841. default:
  842. PlayerInfo[iPlayerID][pOrg_Skin] = 166; // Ovaj ID skina neka vam bude uvijek jednak 1. ranku, on je tu samo ako je doslo do neke greske kod broja ranka
  843. }
  844. }*/
  845. }
  846.  
  847. SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pOrg_Skin]);
  848. return 1;
  849. }
  850. //==============================================================================
  851. //==============================================================================
  852. CMD:izbaciizorg(playerid, params[])
  853. {
  854. if (PlayerInfo[playerid][pLider] > 0) // Provjerava da li je igrac lider icega
  855. {
  856. new
  857. iPlayerID,
  858. szPlayerName[MAX_PLAYER_NAME],
  859. szMessage[68];
  860.  
  861. if (sscanf(params, "u", iPlayerID)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  862. return SendClientMessage(playerid, C_WHITE, "KORISTI: /izbaciizorg [igracev ID/dio imena]");
  863. else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
  864. return SendClientMessage(playerid, C_WHITE, "ERROR: Pogresan ID igraca.");
  865. else if (PlayerInfo[iPlayerID][pClan] != PlayerInfo[playerid][pLider]) // Provjerava da li su igrac i ID igraca koji je upisao u istoj organizaciji
  866. return SendClientMessage(playerid, C_WHITE, "ERROR: Taj igrac nije u vasoj organizaciji.");
  867.  
  868. PlayerInfo[iPlayerID][pClan] = 0; // Resetira igracevu varijablu jer vise nije u organizaciji
  869. PlayerInfo[iPlayerID][pRank] = 0; // Resetira igracevu varijablu jer vise nije u organizaciji
  870. PlayerInfo[iPlayerID][pOrg_Skin] = 0; // Resetira igracevu varijablu jer vise nije u organizaciji
  871.  
  872. SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pSkin]); // Vraca igracev skin koji je imao prije ulaska u organizaciju
  873.  
  874. GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  875.  
  876. format(szMessage, sizeof(szMessage), "INFO: Lider %s te je izbacio iz organizacije.", szPlayerName);
  877. SendClientMessage(iPlayerID, C_WHITE, szMessage);
  878.  
  879. GetPlayerName(iPlayerID, szPlayerName, MAX_PLAYER_NAME);
  880.  
  881. format(szMessage, sizeof(szMessage), "INFO: Izbacio si clana %s iz organizacije.", szPlayerName);
  882. SendClientMessage(playerid, C_WHITE, szMessage);
  883. }
  884. else
  885. SendClientMessage(playerid, C_WHITE, "ERROR: Moras biti lider da koristis ovu komandu.");
  886. return 1;
  887. }
  888. //==============================================================================
  889. //==============================================================================
  890. CMD:r(playerid, params[])
  891. {
  892. if (PlayerInfo[playerid][pClan] > 0 || PlayerInfo[playerid][pLider] > 0)
  893. {
  894. new
  895. szChatMsg[128],
  896. szPlayerName[MAX_PLAYER_NAME],
  897. szMessage[128];
  898.  
  899. if (sscanf(params, "s[128]", szChatMsg)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  900. return SendClientMessage(playerid, C_WHITE, "KORISTI: (/r)adio [tekst]");
  901.  
  902. GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  903.  
  904. foreach(new iPlayerID : Player)
  905. {
  906. // Prolazi kroz sve online igrace i provjerava da li su u istoj organizaciji kao i posiljatelj poruke
  907. if (PlayerInfo[iPlayerID][pClan] == PlayerInfo[playerid][pClan] || PlayerInfo[iPlayerID][pLider] == PlayerInfo[playerid][pLider])
  908. {
  909. format(szMessage, sizeof(szMessage), "%s %s kaze: %s", GetPlayerRank(playerid), szPlayerName, szChatMsg);
  910. SendClientMessage(iPlayerID, C_WHITE, szMessage);
  911. }
  912. }
  913. }
  914. else
  915. SendClientMessage(playerid, C_WHITE, "ERROR: Moras biti clan neke organizacije da koristis ovu komandu.");
  916. return 1;
  917. }
  918.  
  919. CMD:radio(playerid, params[])
  920. return cmd_r(playerid, params);
  921.  
  922. stock GetPlayerRank(iPlayerID) // By Joey_
  923. {
  924. new
  925. szRankName[16], // Broj 16 morate promijeniti ako imate rank ime vece od 15 znakova
  926. iPlayerOrg = (PlayerInfo[iPlayerID][pClan] > 0) ? (PlayerInfo[iPlayerID][pClan]) : (PlayerInfo[iPlayerID][pLider]);
  927.  
  928. switch(iPlayerOrg)
  929. {
  930. case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  931. {
  932. switch(PlayerInfo[iPlayerID][pRank]) // Rankovi za prvu organizaciju
  933. {
  934. case 1: // 1. Rank
  935. szRankName = "Vježbenik";
  936. case 2: // 2. Rank
  937. szRankName = "Kadet";
  938. case 3: // 3. Rank
  939. szRankName = "Policajac";
  940. case 4: // 4. Rank
  941. szRankName = "Viši Policajac";
  942. case 5: // 5. Rank
  943. szRankName = "Narednik";
  944. case 6: // 6. Rank
  945. szRankName = "Porucnik";
  946. default:
  947. szRankName = "Nepoznato";
  948. }
  949. }
  950. // Ovaj kod ispod kao da ne postoji, ali vam prikazuje kako dodati jos jednu organizaciju, sto je potrebno svaki put kada zelite dodati novu organizaciju
  951. /*case 1: // Druga organizacija, nazovimo je FBI
  952. {
  953. switch(PlayerInfo[iPlayerID][pRank]) // Rankovi za drugu organizaciju
  954. {
  955. case 1: // 1. Rank
  956. szRankName = "Vojnik";
  957. case 2: // 2. Rank
  958. szRankName = "Vojnik";
  959. case 3: // 3. Rank
  960. szRankName = "Zapovjednik";
  961. case 4: // 4. Rank
  962. szRankName = "Zapovjednik";
  963. case 5: // 5. Rank
  964. szRankName = "Zapovjednik";
  965. case 6: // 6. Rank
  966. szRankName = "General";
  967. default:
  968. szRankName = "Nepoznato";
  969. }
  970. }*/
  971. }
  972. return szRankName;
  973. }
  974. //==============================================================================
  975. //==============================================================================
  976. COMMAND:eject(playerid,params[])
  977. {
  978. new
  979. id,
  980. string[128];
  981. if(sscanf(params, "u", id)) return SCM(playerid, COLOR_GREY, "Koristi: /eject [ID]");
  982. else if (id == INVALID_PLAYER_ID) SCM(playerid, COLOR_GREY, "ERROR: Igrac nije online.");
  983. else
  984. {
  985. if( id == playerid ) return SCM(playerid,COLOR_GREY,"ERROR: Nemozes sam sebe izbaciti iz vozila.");
  986. if(IsPlayerInAnyVehicle(playerid))
  987. {
  988. if(GetPlayerVehicleSeat(playerid) == 0)
  989. {
  990. if(!IsPlayerInAnyVehicle(id)) return SCM(playerid,COLOR_GREY,"ERROR: Taj igrac nije u vozilu.");
  991. if(GetPlayerVehicleSeat(id) != 0) {
  992. RemovePlayerFromVehicle(id);
  993. format(string,sizeof string,"INFO: %s vas je izbacio iz vozila.",GetName(playerid));
  994. SCM(id,0xFF6600,string);
  995. format(string,sizeof string,"INFO: Izbacio si %s van svog vozila.",GetName(id));
  996. SCM(playerid,0xFF6600,string); }
  997. else
  998. {
  999. SCM(playerid,COLOR_GREY,"ERROR: Nemozes izbaciti vozaca van vozila.");
  1000. }
  1001. }
  1002. else
  1003. {
  1004. SCM(playerid,COLOR_GREY,"ERROR: Samo vozac ovog vozila moze izbacivati igrace van vozila.");
  1005. }
  1006. }
  1007. else
  1008. {
  1009. SCM(playerid,COLOR_GREY,"ERROR: Niste u vozilu.");
  1010. }
  1011. }
  1012. return true;
  1013. }
  1014.  
  1015. stock GetName(id)
  1016. {
  1017. new
  1018. ime[MAX_PLAYER_NAME];
  1019. GetPlayerName(id,ime, MAX_PLAYER_NAME);
  1020. return ime;
  1021. }
  1022. //==============================================================================
  1023. //==============================================================================
  1024. COMMAND:hesoyam(playerid, params[])
  1025. {
  1026. if (IsPlayerAdmin(playerid))
  1027. {
  1028. new vehicleid = GetPlayerVehicleID(playerid);
  1029. GivePlayerMoney(playerid, 250000);
  1030. SetPlayerHealth(playerid, 100);
  1031. SetPlayerArmour(playerid, 100);
  1032. if(IsPlayerInAnyVehicle(playerid)) return RepairVehicle(vehicleid);
  1033. }
  1034. else
  1035. {
  1036. return SendClientMessage(playerid, COLOR_GREY, "ERROR: Niste Rcon");
  1037. }
  1038. return 0;
  1039. }
  1040. //==============================================================================
  1041. //==============================================================================
  1042. CMD:rppravila(playerid, params[])
  1043. {
  1044. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "RP Pravila:","RP(RolePlay)Simulacija stvarnog zivota\nSK(SpawnKill)Ubijanje na mestu Spawna\nMG(MetaGaming)Mesanje IC i OOC chata\nPG(PowerGaming)Nemoguca radnja\nBH(BunnyHopping)Skakanje i trcanje u isto vreme\nDM(DeathMaching)Ubijanje ljudi bez razloga\nNJ-kradja auta bez /me komandi\nBA(Bug Abusing)Iskoriscavanje propusta na serveru\nNadamo se da ste naucili ova pravila,jer ako ih ne postujete,mozete dobiti warn ili ban. !", "Shvatam","Izadji");
  1045. return 1;
  1046. }
  1047. //==============================================================================
  1048. //==============================================================================
  1049. CMD:smash(playerid,params[])
  1050. {
  1051. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Nisi Administrator");
  1052. new ID;
  1053. if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "/smash (ID)");
  1054. if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, -1,"Korisnik nije prisutan");
  1055. if(!IsPlayerInAnyVehicle(ID)) return SendClientMessage(playerid, -1,"Korisnik nije u vozliu");
  1056. SetVehicleVelocity(GetPlayerVehicleID(ID), 0.0, 0.0, 100);
  1057. SetTimerEx("Velecity", 500, false, "u", ID);
  1058. return 1;
  1059. }
  1060. forward Velecity(playerid);
  1061. public Velecity(playerid)
  1062. {
  1063. if(IsPlayerInAnyVehicle(playerid))
  1064. SetVehicleVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, -300);
  1065. return 1;
  1066. }
  1067. //==============================================================================
  1068. //==============================================================================
  1069. CMD:veh(playerid, params[])
  1070. {
  1071. new
  1072. vID,
  1073. Cl1,
  1074. Cl2,
  1075. Float:X,
  1076. Float:Y,
  1077. Float:Z,
  1078. Float:Ang;
  1079. if (IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "[ERROR]: Nisi Admin!");
  1080. if(sscanf(params, "ii", vID, Cl1, Cl2)) return SendClientMessage(playerid, 0xFF6600, "{0000FF}[SX:RP | KOMANDA]:{FF8040} /veh <vehicleid> <boja1> <boja2>");
  1081. GetPlayerPos(playerid, X, Y, Z);
  1082. GetPlayerFacingAngle(playerid, Ang);
  1083. CreateVehicle(vID, X + 5.0, Y, Z, Ang, Cl1, Cl2, 1200000);
  1084. return true;
  1085. }
  1086. //==============================================================================
  1087. //==============================================================================
  1088. CMD:o(playerid, params[])
  1089. {
  1090. new oMsg[128], pName[MAX_PLAYER_NAME];
  1091. if(OOC == 1)
  1092. {
  1093. new Text[128];
  1094. if(sscanf(params, "s", Text)) return SendClientMessage(playerid, 0xFF8040FF, "KORISTI: /o <text>");
  1095. GetPlayerName(playerid, pName, sizeof(pName));
  1096. format(oMsg, sizeof(oMsg), "(( %s: %s ))", pName, params);
  1097. SendClientMessageToAll(0xBFEFFFAA, oMsg);
  1098. }
  1099. else if(!IsPlayerAdmin(playerid))
  1100. {
  1101. new Text[128];
  1102. if(sscanf(params, "s", Text)) return SendClientMessage(playerid, 0xFF8040FF, "KORISTI: /o <text>");
  1103. GetPlayerName(playerid, pName, sizeof(pName));
  1104. format(oMsg, sizeof(oMsg), "(( Admin %s: %s ))", pName, params);
  1105. SendClientMessageToAll(0xFFFF00AA, oMsg);
  1106. }
  1107. else SendClientMessage(playerid, COLOR_BLUE, "[OOC]: OOC Chat je iskljucen.");
  1108. return 1;
  1109. }
  1110. //==============================================================================
  1111. //==============================================================================
  1112. COMMAND:slap(playerid, params[])
  1113. {
  1114. new str[128], targetid;
  1115. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xCECECEFF, "Nisi ovlasten da koristis ovu komandu!.");
  1116. if(sscanf(params,"u", targetid))return SendClientMessage(playerid, 0xCECECEFF, "Koristi: /slap [ID igraca/Dio imena]");
  1117. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xCECECEFF, "ID nije pronadjen.");
  1118. new Float: PosX, Float: PosY, Float: PosZ;
  1119. GetPlayerPos(targetid, PosX, PosY, PosZ);
  1120. SetPlayerPos(targetid, PosX, PosY, PosZ + 5.0);
  1121. SendClientMessage(playerid, 0xF81414,"osamarioi si %s");
  1122. SendClientMessage(playerid, 0xFFFFFFFF, str);
  1123. GameTextForPlayer(targetid, "~r~ OSAMAREN", 3000, 4);
  1124. return 1;
  1125. }
  1126. stock Accounts(playerid)
  1127. {
  1128. new PlayerAcc[128];
  1129. format(PlayerAcc,128,"Users/%s.ini",GetOOCName(playerid));
  1130. return PlayerAcc;
  1131. }
  1132. //==============================================================================
  1133. //==============================================================================
  1134.  
  1135. //==============================================================================
  1136. //==============================================================================
  1137.  
  1138. //==============================================================================
  1139. //==============================================================================
  1140.  
  1141. //==============================================================================
  1142. //==============================================================================
  1143.  
  1144. //==============================================================================
  1145. //==============================================================================
  1146.  
  1147. //==============================================================================
  1148. //==============================================================================
  1149.  
  1150. //==============================================================================
  1151. //==============================================================================
  1152.  
  1153. //==============================================================================
  1154. //==============================================================================
  1155.  
  1156. //==============================================================================
  1157. //==============================================================================
  1158.  
  1159. //==============================================================================
  1160. //==============================================================================
  1161.  
  1162. //==============================================================================
  1163. //==============================================================================
  1164.  
  1165. //==============================================================================
  1166. //==============================================================================
Advertisement
Add Comment
Please, Sign In to add comment