Guest User

HELP

a guest
Aug 24th, 2012
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 50.05 KB | None | 0 0
  1. #include <a_samp>
  2. #include <streamer>
  3. #include <zcmd>
  4. #include <foreach>
  5. #include <sscanf2>
  6. #include <YSI\y_ini>
  7.  
  8. /* Server Colors */
  9. #define COLOR_PURPLE    0xC2A2DAAA
  10. #define COLOR_GRAD2     0xBFC0C2FF
  11. #define COLOR_GRAD1     0xB4B5B7FF
  12. #define COLOR_GRAD2     0xBFC0C2FF
  13. #define COLOR_GREY      0xAFAFAFAA
  14. #define COLOR_GRAD3     0xCBCCCEFF
  15. #define COLOR_LIGHTBLUE 0x006FDD96
  16. #define COLOR_GRAD4     0xD8D8D8FF
  17. #define COLOR_FADE      0xC8C8C8C8
  18. #define COLOR_FADE2     0xC8C8C8C8
  19. #define COLOR_FADE3     0xAAAAAAAA
  20. #define COLOR_FADE4     0x8C8C8C8C
  21. #define COLOR_YELLOW    0xDABB3E00
  22. #define COLOR_FADE5     0x6E6E6E6E
  23. #define COLOR_GRAD5     0xE3E3E3FF
  24. #define COLOR_FADE1     0xE6E6E6E6
  25. #define COLOR_GRAD6     0xF0F0F0FF
  26. #define grey 0xCECECEFF
  27. #define green 0x33AA33AA
  28. #define red 0xFF0000FF
  29. #define yellow 0xFFFF00AA
  30. #define white 0xFFFFFFAA
  31. #define COL_WHITE "{FFFFFF}"
  32. #define COL_RED "{F81414}"
  33. #define COL_GREEN "{00FF22}"
  34. #define COL_LIGHTBLUE "{00CED1}"
  35. #define blue 0x0000BBAA
  36. #define orange 0xFF9900AA
  37. #define TEAM_HIT_COLOR  0xFFFFFF00
  38. #define C_WHITE                     0xFFFFFFAA
  39. #define CRED                                "{FF0000}"
  40. #define COL_YELLOW         "{F3FF02}"
  41. #define COLOR_RED 0xAA3333AA
  42.  
  43. /* Server Defines */
  44. #define PATH "Racuni/%s.ini"
  45. #define SECONDS(%1) ((%1)*(1000))
  46. #define ALTCOMMAND:%1->%2;           \
  47. COMMAND:%1(playerid, params[])   \
  48. return cmd_%2(playerid, params);
  49. #define function%0(%1) forward%0(%1); public%0(%1)
  50. #define MAX_ORGS                    2   // Ovo je maksimalni broj organizacija na serveru, kad dodate novu organizaciju, povecajte ga za 1
  51.  
  52. /* SERVER SIDE CASH */
  53. #define GivePlayerCash(%0,%1) SetPVarInt(%0,"Money",GetPlayerCash(%0)+%1),GivePlayerMoney(%0,%1)
  54. #define ResetPlayerCash(%0) SetPVarInt(%0,"Money",0), ResetPlayerMoney(%0)
  55. #define GetPlayerCash(%0) GetPVarInt(%0,"Money")
  56.  
  57. /* DIALOGS */
  58. #define DIALOG_REGISTER   1
  59. #define DIALOG_LOGIN      2
  60. #define DIALOG_AGE        3
  61. #define DIALOG_SEX        4
  62.  
  63.  
  64. /* ORGVOZILA */
  65.  
  66. new
  67.     gPoliceCar[12]; // 12 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.
  68.  
  69. /* ORG_INVITE */
  70.  
  71. #define DIALOG_ORG_INVITE           5   // Ovo morate dodati kod ostalih macroa (#define) ili na vrh skripte poslije #include
  72.  
  73.  
  74. /* ENUMS */
  75. enum pInfo
  76. {
  77.     pPass,
  78.     pCash,
  79.     pAdmin,
  80.     pGameQuer,
  81.     pSex,
  82.     pAge,
  83.     Float:pPos_x,
  84.     Float:pPos_y,
  85.     Float:pPos_z,
  86.     pTeam,
  87.     pAccent,
  88.     pLeader,    // Varijabla koja pamti cega je igrac lider
  89.     pMember,    // Varijabla koja pamti u kojoj je igrac organizaciji
  90.     pRank,      // Varijabla koja pamti koji je igrac rank u organizaciji
  91.     pSkin,      // Varijabla koja pamti koji skin je igrac imao prije ulaska u organizaciju
  92.     pOrgSkin    // Varijabla koja pamti koji skin igrac ima dok je u organizaciji
  93. }
  94. new PlayerInfo[MAX_PLAYERS][pInfo];
  95. /* <--------------------------------------------> */
  96.  
  97. main()
  98. {
  99.     print(" ");
  100.     print(" ");
  101.     print("QuerZex Roleplay Loaded");
  102.     print(" ");
  103.     print(" Script: MarQueZ");
  104. }
  105.  
  106. new
  107.     noooc = 0,
  108.     Logged[ MAX_PLAYERS ],
  109.     gOoc[ MAX_PLAYERS ]
  110. ;
  111.  
  112. public OnPlayerConnect(playerid)
  113. {
  114.     gOoc[ playerid ] = 0; Logged[ playerid ] = 0;
  115.     // Reset stats!
  116.     PlayerInfo[ playerid ][ pCash ] = 0;
  117.     PlayerInfo[ playerid ][ pAdmin ] = 0;
  118.     PlayerInfo[ playerid ][ pGameQuer ] = 0;
  119.     PlayerInfo[ playerid ][ pSex ] = 0;
  120.     PlayerInfo[ playerid ][ pAge ] = 0;
  121.     PlayerInfo[ playerid ][ pPos_x ] = 0.0;
  122.     PlayerInfo[ playerid ][ pPos_y ] = 0.0;
  123.     PlayerInfo[ playerid ][ pPos_z ] = 0.0;
  124.     PlayerInfo[ playerid ][ pSkin ] = 0;
  125.     PlayerInfo[ playerid ][ pTeam ] = 0;
  126.     PlayerInfo[ playerid ][ pAccent ] = 0;
  127.     PlayerInfo[ playerid ][ pLeader ] = 0;
  128.     PlayerInfo[ playerid ][ pMember ] = 0;
  129.     PlayerInfo[ playerid ][ pRank ] = 0;
  130.     PlayerInfo[ playerid ][ pOrgSkin ] = 0;
  131.  
  132.     if(fexist(UserPath(playerid)))
  133.     {
  134.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  135.         new loginstring[280];
  136.         new loginname[150];
  137.         GetPlayerName(playerid,loginname,sizeof(loginname));
  138.         format(loginstring,sizeof(loginstring),"Odlicno %s.\nRegistrovali ste se na San Andreas Role Play server\nPrijavite se:",loginname);
  139.         ShowPlayerDialog(playerid,19,DIALOG_STYLE_INPUT,"QuerZex RolePlay - Prijava",loginstring,"Prijava","Izlaz");
  140.     }
  141.     else
  142.     {
  143.         new regstring[280];
  144.         new regname[150];
  145.         GetPlayerName(playerid,regname,sizeof(regname));
  146.         format(regstring,sizeof(regstring),"Dobrodosli, %s\nVi nemate korisnicki Account/Racun.\nUnesite lozinku za register:",regname);
  147.         ShowPlayerDialog(playerid,18,DIALOG_STYLE_INPUT,"QuerZex RolePlay - Registracija",regstring,"Prijavi se","Izlaz");
  148.     }
  149.     return 1;
  150. }
  151.  
  152. public OnGameModeInit()
  153. {
  154.     /* <-------------------------------------------> */
  155.     ShowPlayerMarkers(0);
  156.     ShowNameTags(1);
  157.     DisableInteriorEnterExits();
  158.     EnableStuntBonusForAll(0);
  159.     SetNameTagDrawDistance(10.0);
  160.     // =========== TIMERS ===========
  161.     SetTimer("MoneyUpdate",1000,1);
  162.     SetTimer("SaveAccounts", SECONDS(13), 1);
  163.     /* <-------------------------------------------> */
  164.     gPoliceCar[0] = AddStaticVehicleEx(596, 1602.5612, -1684.0551, 5.6117, 90.1118, 1, 1, 60000); // LSPD CAR 1
  165.     gPoliceCar[1] = AddStaticVehicleEx(596, 1601.6705, -1688.0541, 5.6121, 90.8448, 1, 1, 60000); // LSPD CAR 2
  166.     gPoliceCar[2] = AddStaticVehicleEx(596, 1602.4637, -1692.0313, 5.6110, 88.8953, 1, 1, 60000); // LSPD CAR 3
  167.     gPoliceCar[3] = AddStaticVehicleEx(596, 1601.9114, -1696.1097, 5.6123, 89.3469, 1, 1, 60000); // LSPD CAR 4
  168.     gPoliceCar[4] = AddStaticVehicleEx(596, 1601.0546, -1700.0367, 5.6102, 89.6678, 1, 1, 60000); // LSPD CAR 5
  169.     gPoliceCar[5] = AddStaticVehicleEx(596, 1601.0619, -1704.1592, 5.6111, 88.1358, 1, 1, 60000); // LSPD CAR 6
  170.     gPoliceCar[6] = AddStaticVehicleEx(596, 1602.6029, -1704.2450, 5.6131, 89.3122, 1, 1, 60000); // LSPD CAR 7
  171.     gPoliceCar[7] = AddStaticVehicleEx(599, 1578.5756, -1711.5348, 6.0791, 0.1873, 1, 1, 60000); // LSPD RANCHER 8
  172.     gPoliceCar[8] = AddStaticVehicleEx(599, 1574.3901, -1711.5637, 6.0810, 359.8975, 1, 1, 60000); // LSPD RANCHER 9
  173.     gPoliceCar[9] = AddStaticVehicleEx(599, 1570.2910, -1711.2526, 6.0789, 0.4381, 1, 1, 60000); // LSPD RANCHER 10
  174.     gPoliceCar[10] = AddStaticVehicleEx(599, 1558.7439, -1711.3959, 6.0765, 359.5774, 1, 1, 60000); // LSPD RANCHER 11
  175.     gPoliceCar[11] = AddStaticVehicleEx(523, 1567.1206, -1713.1724, 5.4631, 355.7968, 1, 1, 60000); // LSPD BIKE 12
  176.     /* <-------------------------------------------> */
  177.     //Telling the Server the Game Mode
  178.     SetGameModeText("QZ:RP V0.0.1");
  179.     /* <-------------------------------------------> */
  180.     AddStaticVehicleEx(522, 1119.0754, -1626.3329, 20.0777, 176.0761, 1, 1, 60000); // Motor kod spawna
  181.     return 1;
  182. }
  183.  
  184. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  185. {
  186.     if(dialogid == DIALOG_AGE)
  187.     {
  188.         if(!response)
  189.         {
  190.             Kick(playerid);
  191.         }
  192.         else
  193.         {
  194.             if(strlen(inputtext))
  195.             {
  196.                 new age = strval(inputtext);
  197.                 if(age > 40 || age < 14)
  198.                 {
  199.                     new dobstring[280];
  200.                     new dobname[150];
  201.                     GetPlayerName(playerid,dobname,sizeof(dobname));
  202.                     format(dobstring,sizeof(dobstring),"Odlicno %s.\nRegistrovali ste se na San Andreas Role Play server\nPrijavite se:",dobstring);
  203.                     ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Registracija - Peti Korak","{FFFFFF}Koliko imate godina ?\n{FF0000}(( {FFFFFF}14 {FF0000}- {FFFFFF}40 {FF0000})){FFFFFF}\nOvo su samo In Character Informacije ( IC ).","Odgovori","Izlaz");
  204.                 }
  205.                 else
  206.                 {
  207.                     PlayerInfo[playerid][pAge] = age;
  208.                     new
  209.                         string[ 64 ]
  210.                     ;
  211.                     format(string, sizeof(string), "{FFFFFF}INFO: Znaci, imate {3BB9FF}%d {FFFFFF}godina.",age);
  212.                     SendClientMessage(playerid, -1, string);
  213.                     GivePlayerCash(playerid, 600);
  214.                     SaveAccountStats(playerid);
  215.                     SpawnPlayer(playerid);
  216.                 }
  217.             }
  218.             else
  219.             {
  220.                 return 0;
  221.             }
  222.         }
  223.     }
  224.     if(dialogid == DIALOG_SEX)
  225.     {
  226.         if(response)
  227.         {
  228.             PlayerInfo[playerid][pSex] = 1;
  229.             SendClientMessage(playerid, -1, "{FFFFFF}INFO: Znaci, {3BB9FF}Muskog {FFFFFF}ste spola.");
  230.             SetPlayerSkin(playerid, 60);
  231.             PlayerInfo[playerid][pSkin] = 60;
  232.             ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- {FFFFFF}Dob -","{FFFFFF}Koliko imate godina ?\n{FF0000}(( {FFFFFF}14 {FF0000}- {FFFFFF}65 {FF0000})){FFFFFF}","Odgovori","Izlaz");
  233.         }
  234.         else
  235.         {
  236.             PlayerInfo[playerid][pSex] = 2;
  237.             SendClientMessage(playerid, -1, "{FFFFFF}INFO: Znaci, {3BB9FF}Zenskog {FFFFFF}ste spola.");
  238.             SetPlayerSkin(playerid, 233);
  239.             PlayerInfo[playerid][pSkin] = 233;
  240.             ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "- {FFFFFF}Dob -","{FFFFFF}Koliko imate godina ?\n{FF0000}(( {FFFFFF}14 {FF0000}- {FFFFFF}65 {FF0000})){FFFFFF}","Odgovori","Izlaz");
  241.         }
  242.     }
  243.     switch( dialogid )
  244.     {
  245.         case DIALOG_REGISTER:
  246.         {
  247.             if (!response) return Kick(playerid);
  248.             if(response)
  249.             {
  250.                 if(!strlen(inputtext))
  251.                 return
  252.                 ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "QuerZex RolePlay","Unijeli ste krivu lozinku, pokusajte ponovo.\nUpisite lozinku kojom cete se koristiti za prijavljivanje u svoj K. Racun:","Registriraj","Izlaz");
  253.                 new INI:File = INI_Open(UserPath(playerid));
  254.                 INI_SetTag(File,"data");
  255.                 INI_WriteInt(File,"Password",udb_hash(inputtext));
  256.                 INI_WriteInt(File,"Cash",0);
  257.                 INI_WriteInt(File,"Admin",0);
  258.                 INI_WriteInt(File,"GameQuer",0);
  259.                 INI_WriteInt(File,"Sex",0);
  260.                 INI_WriteInt(File,"Age",0);
  261.                 INI_WriteFloat(File,"Pos_x",0);
  262.                 INI_WriteFloat(File,"Pos_y",0);
  263.                 INI_WriteFloat(File,"Pos_z",0);
  264.                 INI_WriteInt(File,"Skin",0);
  265.                 INI_WriteInt(File,"Team",0);
  266.                 INI_WriteInt(File,"Accent",0);
  267.                 INI_WriteInt(File,"Leader",0);
  268.                 INI_WriteInt(File,"Member",0);
  269.                 INI_WriteInt(File,"Rank",0);
  270.                 INI_WriteInt(File,"OrgSkin",0);
  271.                 INI_Close(File);
  272.  
  273.                 ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "- {FFFFFF}Spol -","Kojeg ste spola ?","Muskog","Zenskog");
  274.             }
  275.         }
  276.         case DIALOG_LOGIN:
  277.         {
  278.             if ( !response ) return Kick ( playerid );
  279.             if( response )
  280.             {
  281.                 if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  282.                 {
  283.                     INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  284.                     new
  285.                         tmp2[ 256 ],
  286.                         playername2[ MAX_PLAYER_NAME ]
  287.                     ;
  288.                     GetPlayerName(playerid, playername2, sizeof(playername2));
  289.                     format(tmp2, sizeof(tmp2), "~w~Dobrodosli ~n~~g~%s", playername2);
  290.                     GameTextForPlayer(playerid, tmp2, 5000, 1);
  291.                     SetTimerEx("UnsetFirstSpawn", 5000, false, "i", playerid);
  292.                     GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
  293.                     SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
  294.                     SpawnPlayer(playerid);
  295.                 }
  296.                 else
  297.                 {
  298.                     ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"QuerZex RolePlay","Unijeli ste krivu lozinku, pokusajte ponovo.\nUpisite svoju lozinku da biste se ulogirali u svoj K. Racun:","Prijava","Izlaz");
  299.                 }
  300.                 return 1;
  301.             }
  302.         }
  303.         case DIALOG_ORG_INVITE: // Ovdje ce se izvrsiti daljnji kod nakon sto je igrac pritisnuo 'Prihvacam' ili 'Ne prihvacam'
  304.         {
  305.              if (response) // Ako je igrac pritisnuo 'Prihvacam'
  306.              {
  307.                 switch(PlayerInfo[playerid][pMember])
  308.                 {
  309.                     case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  310.                     {
  311.                         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
  312.                         SendClientMessage(playerid, C_WHITE, "INFO: Prihvatili ste poziv za ulazak u "CRED"Los Santos Police Department");
  313.                     }
  314.                 }
  315.              }
  316.              else // Ako je igrac pritisnuo 'Ne prihvacam'
  317.              {
  318.                 // Resetiramo igraceve varijable na 0 jer nije prihvatio ulazak u organizaciju
  319.                 PlayerInfo[playerid][pMember] = 0;
  320.                 PlayerInfo[playerid][pRank] = 0;
  321.                 SendClientMessage(playerid, C_WHITE, "INFO: Odbili ste poziv za ulazak u organizaciju");
  322.              }
  323.         }
  324.     }
  325.     return 1;
  326. }
  327.  
  328. public OnPlayerSpawn(playerid)
  329. {
  330.     if(IsPlayerConnected(playerid))
  331.     {
  332.         SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  333.         SetPlayerToTeamColor(playerid);
  334.         Logged[playerid] = 1;
  335.     }
  336.     if(PlayerInfo[playerid][pPos_x] == 0 && PlayerInfo[playerid][pPos_y] == 0)
  337.     {
  338.         SetPlayerPos(playerid, 1119.4132,-1619.1407,20.5162);
  339.         Logged[playerid] = 1;
  340.         SpawnPlayer(playerid);
  341.     }
  342.     else
  343.     {
  344.         SetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
  345.         Logged[playerid] = 1;
  346.         SpawnPlayer(playerid);
  347.     }
  348.     if (PlayerInfo[playerid][pMember] > 0)
  349.     {
  350.         switch(PlayerInfo[playerid][pMember])
  351.         {
  352.             case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  353.             {
  354.                 SetPlayerPos(playerid, 1525.4482,-1677.9772,5.8906); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
  355.                 SetPlayerFacingAngle(playerid, 266.9746); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem
  356.                 SetPlayerSkin(playerid, PlayerInfo[playerid][pOrgSkin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
  357.             }
  358.             // 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
  359.             /*case 2: // Druga organizacije, nazovimo je FBI
  360.             {
  361.                 SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
  362.                 SetPlayerFacingAngle(playerid, 270.1425); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem
  363.  
  364.                 SetPlayerSkin(playerid, PlayerInfo[playerid][pOrgSkin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
  365.             }*/
  366.         }
  367.     }
  368.     else if (PlayerInfo[playerid][pLeader] > 0)
  369.     {
  370.         switch(PlayerInfo[playerid][pLeader])
  371.         {
  372.             case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  373.             {
  374.                 SetPlayerPos(playerid, 1525.4482,-1677.9772,5.8906); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
  375.                 SetPlayerFacingAngle(playerid, 266.9746); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem
  376.                 SetPlayerSkin(playerid, PlayerInfo[playerid][pOrgSkin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
  377.             }
  378.             // 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
  379.             /*case 2: // Druga organizacije, nazovimo je FBI
  380.             {
  381.                 SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); // Postavlja igracevu poziciju na te koordinate, vi te koordinate mozete zamijeniti svojima
  382.                 SetPlayerFacingAngle(playerid, 270.1425); // Postavlja kamo da igrac gleda, vi to mozete zamijeniti sa svojim kutem
  383.  
  384.                 SetPlayerSkin(playerid, PlayerInfo[playerid][pOrgSkin]); // Postavlja igracev skin na onaj koji mora imat dok je u organizaciji
  385.             }*/
  386.         }
  387.     }
  388.     return 1;
  389. }
  390.  
  391. forward OnPlayerCommandPerformed(playerid, cmdtext[], success);
  392. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  393. {
  394.     if(!success)
  395.     SendClientMessage(playerid, COLOR_RED, "GRESKA: {F3FF02}Upisali ste komandu koja ne postoji, za pomoc upisite /pomoc za pregled komandi, mozete poslati pitanje adminu s komandom /pitaj ili ga pozovite do sebe s komandom /novi.");
  396.     return 1;
  397. }
  398.  
  399. public OnPlayerStateChange(playerid, newstate, oldstate)
  400. {
  401.     if (newstate == PLAYER_STATE_DRIVER) // Ako je usao u vozilo kao vozac
  402.     {
  403.         new
  404.             iVehicleID = GetPlayerVehicleID(playerid);
  405.  
  406.         // 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
  407.         if (IsAPoliceCar(iVehicleID) && (PlayerInfo[playerid][pMember] != 1 || PlayerInfo[playerid][pLeader] != 1))
  408.         {
  409.             SendClientMessage(playerid, C_WHITE, "GRESKA: Nisi clan Los Santos Police Departmenta.");
  410.  
  411.             RemovePlayerFromVehicle(playerid);
  412.         }
  413.     }
  414.     return 1;
  415. }
  416.  
  417. public OnPlayerText(playerid, text[])
  418. {
  419.     new
  420.         realchat = 1,
  421.         string[ 128 ]
  422.     ;
  423.     if(IsPlayerConnected(playerid))
  424.     {
  425.         if(realchat)
  426.         {
  427.             if(PlayerInfo[playerid][pAccent] == 0)
  428.             {
  429.                 format(string, sizeof(string), "%s kaze: %s", RPName(playerid), text);
  430.                 ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  431.             }
  432.             else
  433.             {
  434.                 new
  435.                     accent[20]
  436.                 ;
  437.                 switch(PlayerInfo[playerid][pAccent])
  438.                 {
  439.                     case 1: accent = "Ruskim";
  440.                     case 2: accent = "Talijanskim";
  441.                     case 3: accent = "Njemackim";
  442.                     case 4: accent = "Japanskim";
  443.                     case 5: accent = "Francuskim";
  444.                     case 6: accent = "Spanjolskim";
  445.                     case 7: accent = "Kineskim";
  446.                     case 8: accent = "Britanskim";
  447.                 }
  448.                 format(string, sizeof(string), "%s kaze: [%s Naglaskom] %s", RPName(playerid), accent, text);
  449.                 ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  450.             }
  451.             return 0;
  452.         }
  453.     }
  454.     return 1;
  455. }
  456.  
  457. public OnPlayerDisconnect(playerid, reason)
  458. {
  459.     SaveAccountStats(playerid);
  460.     return 1;
  461. }
  462.  
  463. function SetPlayerToTeamColor(playerid)
  464. {
  465.     if(IsPlayerConnected(playerid))
  466.     {
  467.         SetPlayerColor(playerid,TEAM_HIT_COLOR);
  468.     }
  469. }
  470.  
  471. function OOCOff(color,const string[])
  472. {
  473.     foreach (Player,i)
  474.     {
  475.         if(!gOoc{i})
  476.         {
  477.             SendClientMessage(i, color, string);
  478.         }
  479.     }
  480. }
  481.  
  482. function SaveAccountStats(playerid)
  483. {
  484.     if(Logged[playerid] == 1)
  485.     {
  486.     new
  487.         INI:File = INI_Open(UserPath(playerid))
  488.     ;
  489.     INI_SetTag(File,"data");
  490.    
  491.     PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
  492.     PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
  493.     new
  494.         Float:x,
  495.         Float:y,
  496.         Float:z
  497.     ;
  498.     GetPlayerPos(playerid,x,y,z);
  499.     PlayerInfo[playerid][pPos_x] = x;
  500.     PlayerInfo[playerid][pPos_y] = y;
  501.     PlayerInfo[playerid][pPos_z] = z;
  502.    
  503.     INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
  504.     INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  505.     INI_WriteInt(File,"GameQuer",PlayerInfo[playerid][pGameQuer]);
  506.     INI_WriteInt(File,"Sex",PlayerInfo[playerid][pSex]);
  507.     INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
  508.     INI_WriteFloat(File,"Pos_x",PlayerInfo[playerid][pPos_x]);
  509.     INI_WriteFloat(File,"Pos_y",PlayerInfo[playerid][pPos_y]);
  510.     INI_WriteFloat(File,"Pos_z",PlayerInfo[playerid][pPos_z]);
  511.     INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
  512.     INI_WriteInt(File,"Team",PlayerInfo[playerid][pTeam]);
  513.     INI_WriteInt(File,"Accent",PlayerInfo[playerid][pAccent]);
  514.     INI_WriteInt(File,"Leader",PlayerInfo[playerid][pLeader]);
  515.     INI_WriteInt(File,"Member",PlayerInfo[playerid][pMember]);
  516.     INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
  517.     INI_WriteInt(File,"OrgSkin",PlayerInfo[playerid][pOrgSkin]);
  518.    
  519.     INI_Close(File);
  520.     }
  521.     return 1;
  522. }
  523.  
  524. function SaveAccounts()
  525. {
  526.     for(new i = 0; i < MAX_PLAYERS; i++)
  527.     {
  528.         if(IsPlayerConnected(i))
  529.         {
  530.             SaveAccountStats(i);
  531.         }
  532.     }
  533. }
  534.  
  535. function GameModeExitFunc()
  536. {
  537.     GameModeExit();
  538.     return 1;
  539. }
  540.  
  541. function LoadUser_data(playerid,name[],value[])
  542. {
  543.     INI_Int("Password",PlayerInfo[playerid][pPass]);
  544.     INI_Int("Cash",PlayerInfo[playerid][pCash]);
  545.     INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  546.     INI_Int("GameQuer",PlayerInfo[playerid][pGameQuer]);
  547.     INI_Int("Sex",PlayerInfo[playerid][pSex]);
  548.     INI_Int("Age",PlayerInfo[playerid][pAge]);
  549.     INI_Float("Pos_x",PlayerInfo[playerid][pPos_x]);
  550.     INI_Float("Pos_y",PlayerInfo[playerid][pPos_y]);
  551.     INI_Float("Pos_z",PlayerInfo[playerid][pPos_z]);
  552.     INI_Int("Skin",PlayerInfo[playerid][pSkin]);
  553.     INI_Int("Team",PlayerInfo[playerid][pTeam]);
  554.     INI_Int("Accent",PlayerInfo[playerid][pAccent]);
  555.     INI_Int("Leader",PlayerInfo[playerid][pLeader]);
  556.     INI_Int("Member",PlayerInfo[playerid][pMember]);
  557.     INI_Int("Rank",PlayerInfo[playerid][pRank]);
  558.     INI_Int("OrgSkin",PlayerInfo[playerid][pOrgSkin]);
  559.     return 1;
  560. }
  561.  
  562. function MoneyUpdate(playerid)
  563. {
  564.     if(GetPlayerCash(playerid) < GetPlayerMoney(playerid))
  565.     {
  566.         foreach(Player, i)
  567.         {
  568.             new const old_money = GetPlayerCash(playerid);
  569.             ResetPlayerCash(playerid), GivePlayerCash(playerid, old_money);
  570.         }
  571.     }
  572.     return 1;
  573. }
  574.  
  575. function ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  576. {
  577.     if(IsPlayerConnected(playerid))
  578.     {
  579.         new Float:posx, Float:posy, Float:posz;
  580.         new BigEar[MAX_PLAYERS];
  581.         new Float:oldposx, Float:oldposy, Float:oldposz;
  582.         new Float:tempposx, Float:tempposy, Float:tempposz;
  583.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  584.         for(new i = 0; i < MAX_PLAYERS; i++)
  585.         {
  586.             if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  587.             {
  588.                 if(!BigEar[i])
  589.                 {
  590.                     GetPlayerPos(i, posx, posy, posz);
  591.                     tempposx = (oldposx -posx);
  592.                     tempposy = (oldposy -posy);
  593.                     tempposz = (oldposz -posz);
  594.                     if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  595.                     {
  596.                         SendClientMessage(i, col1, string);
  597.                     }
  598.                     else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  599.                     {
  600.                         SendClientMessage(i, col2, string);
  601.                     }
  602.                     else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  603.                     {
  604.                         SendClientMessage(i, col3, string);
  605.                     }
  606.                     else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  607.                     {
  608.                         SendClientMessage(i, col4, string);
  609.                     }
  610.                     else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  611.                     {
  612.                         SendClientMessage(i, col5, string);
  613.                     }
  614.                 }
  615.                 else
  616.                 {
  617.                     SendClientMessage(i, col1, string);
  618.                 }
  619.             }
  620.         }
  621.     }
  622.     return 1;
  623. }
  624.  
  625. // ============ STOCKS ============
  626. stock SendAdminMessage( color, string[] )
  627. {
  628.     foreach (Player,i)
  629.     {
  630.         if( PlayerInfo[ i] [ pAdmin ] > 1 )
  631.         {
  632.             SendClientMessage( i, color, string );
  633.         }
  634.     }
  635. }
  636.  
  637. stock UserPath(playerid)
  638. {
  639.     new string[128],playername[MAX_PLAYER_NAME];
  640.     GetPlayerName(playerid,playername,sizeof(playername));
  641.     format(string,sizeof(string),PATH,playername);
  642.     return string;
  643. }
  644.  
  645. /* Credits to Dracoblue */
  646. stock udb_hash(buf[]) {
  647.     new length=strlen(buf);
  648.     new s1 = 1;
  649.     new s2 = 0;
  650.     new n;
  651.     for (n=0; n<length; n++)
  652.     {
  653.        s1 = (s1 + buf[n]) % 65521;
  654.        s2 = (s2 + s1)     % 65521;
  655.     }
  656.     return (s2 << 16) + s1;
  657. }
  658.  
  659. stock RPName(playerid)
  660. {
  661.     new string[24];
  662.     GetPlayerName(playerid,string,24);
  663.     new str[24];
  664.     strmid(str,string,0,strlen(string),24);
  665.     for(new i = 0; i < MAX_PLAYER_NAME; i++)
  666.     {
  667.         if (str[i] == '_') str[i] = ' ';
  668.     }
  669.     return str;
  670. }
  671.  
  672. stock GetOrgNameByID(iOrgID) // By Joey_
  673. {
  674.     new
  675.         szOrgName[29];
  676.  
  677.     switch(iOrgID)
  678.     {
  679.         case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  680.             szOrgName = "Los Santos Police Department";
  681.         default: // Ako ne postoji ID takve organizacije
  682.             szOrgName = "Nepoznata organizacija";
  683.     }
  684.     return szOrgName;
  685. }
  686.  
  687. stock GetPlayerRank(iPlayerID) // By Joey_
  688. {
  689.     new
  690.         szRankName[16], // Broj 16 morate promijeniti ako imate rank ime vece od 15 znakova
  691.         iPlayerOrg = (PlayerInfo[iPlayerID][pMember] > 0) ? (PlayerInfo[iPlayerID][pMember]) : (PlayerInfo[iPlayerID][pLeader]);
  692.  
  693.     switch(iPlayerOrg)
  694.     {
  695.         case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  696.         {
  697.             switch(PlayerInfo[iPlayerID][pRank]) // Rankovi za prvu organizaciju
  698.             {
  699.                 case 1: // 1. Rank
  700.                     szRankName = "Vježbenik";
  701.                 case 2: // 2. Rank
  702.                     szRankName = "Kadet";
  703.                 case 3: // 3. Rank
  704.                     szRankName = "Policajac";
  705.                 case 4: // 4. Rank
  706.                     szRankName = "Viši Policajac";
  707.                 case 5: // 5. Rank
  708.                     szRankName = "Narednik";
  709.                 case 6: // 6. Rank
  710.                     szRankName = "Poručnik";
  711.                 default:
  712.                     szRankName = "Nepoznato";
  713.             }
  714.         }
  715.         // 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
  716.         /*case 1: // Druga organizacija, nazovimo je FBI
  717.         {
  718.             switch(PlayerInfo[iPlayerID][pRank]) // Rankovi za drugu organizaciju
  719.             {
  720.                 case 1: // 1. Rank
  721.                     szRankName = "Vojnik";
  722.                 case 2: // 2. Rank
  723.                     szRankName = "Vojnik";
  724.                 case 3: // 3. Rank
  725.                     szRankName = "Zapovjednik";
  726.                 case 4: // 4. Rank
  727.                     szRankName = "Zapovjednik";
  728.                 case 5: // 5. Rank
  729.                     szRankName = "Zapovjednik";
  730.                 case 6: // 6. Rank
  731.                     szRankName = "General";
  732.                 default:
  733.                     szRankName = "Nepoznato";
  734.             }
  735.         }*/
  736.     }
  737.     return szRankName;
  738. }
  739.  
  740. stock IsAPoliceCar(iVehicleID) // By Joey_
  741. {
  742.     for(new iIdx = 0; iIdx < sizeof(gPoliceCar); iIdx++)
  743.     {
  744.         if (gPoliceCar[iIdx] == iVehicleID)
  745.             return 1;
  746.     }
  747.     return 0;
  748. }
  749. // =================================
  750.  
  751. /* LOGS */
  752.  
  753. function OOCLog(string[])
  754. {
  755.     new
  756.         entry[ 128 ],
  757.         year,
  758.         month,
  759.         day,
  760.         hour,
  761.         minute,
  762.         second
  763.     ;
  764.     getdate(year, month, day);
  765.     gettime(hour, minute, second);
  766.  
  767.     format(entry, sizeof(entry), "%s | (%d-%d-%d) (%d:%d:%d)\n",string, day, month, year, hour, minute, second);
  768.     new File:hFile;
  769.     hFile = fopen("Basic/logs/OOCLog.log", io_append);
  770.     fwrite(hFile, entry);
  771.     fclose(hFile);
  772. }
  773.  
  774. /* COMMANDS */
  775.  
  776. ALTCOMMAND:poda->podatci;
  777. CMD:podatci(playerid, params[])
  778. {
  779.     if(IsPlayerConnected(playerid))
  780.     {
  781.         new
  782.             string[ 128 ],
  783.             Age = PlayerInfo[ playerid ][ pAge ],
  784.             Money = GetPlayerCash( playerid )
  785.         ;
  786.  
  787.         new Sex[20];
  788.         if(PlayerInfo[ playerid ][ pSex ] == 1) { Sex = "Musko"; }
  789.         else if(PlayerInfo[ playerid ][ pSex ] == 2) { Sex = "Zensko"; }
  790.  
  791.         SendClientMessage(playerid, COLOR_LIGHTBLUE, "------------------------------------------------------------------------");
  792.         format(string, sizeof(string), "Ime i Prezime: %s | Novac: %d | Dob: %d | Spol: %s", RPName(playerid), Money, Age, Sex);
  793.         SendClientMessage(playerid, COLOR_GRAD2, string);
  794.     }
  795.     return 1;
  796. }
  797.  
  798. CMD:pomoc(playerid, params[])
  799. {
  800.     SendClientMessage(playerid,red,"/stats,/b,/me,/(o)oc,/w,/s,/t,/url,/naglasak");
  801.     return 1;
  802. }
  803. ALTCOMMAND:ap->adminpomoc;
  804. CMD:adminpomoc(playerid, params[])
  805. {
  806.     if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1,"{F81414}Niste Admin !");
  807.     SendClientMessage(playerid, -1, "____________________________________________________________________");
  808.     if(PlayerInfo[playerid][pAdmin] >= 1)
  809.     {
  810.         SendClientMessage(playerid, COLOR_FADE, "Server Mod: {F3FF02}Komande u izradi !");
  811.     }
  812.     if(PlayerInfo[playerid][pAdmin] >= 2)
  813.     {
  814.         SendClientMessage(playerid, COLOR_FADE, "Mod: {F3FF02}Komande u izradi !");
  815.     }
  816.     if(PlayerInfo[playerid][pAdmin] >= 3)
  817.     {
  818.         SendClientMessage(playerid, COLOR_FADE, "Global Mod: {F3FF02}Komande u izradi !");
  819.     }
  820.     if(PlayerInfo[playerid][pAdmin] >= 4)
  821.     {
  822.         SendClientMessage(playerid, COLOR_FADE, "Admin: {F3FF02}Komande u izradi !");
  823.     }
  824.     if(PlayerInfo[playerid][pAdmin] >= 5)
  825.     {
  826.         SendClientMessage(playerid, COLOR_FADE, "Lead Admin: {F3FF02}Komande u izradi !");
  827.     }
  828.     if(PlayerInfo[playerid][pAdmin] >= 6)
  829.     {
  830.         SendClientMessage(playerid, COLOR_FADE, "Head Admin: {F3FF02}/postavilidera (/PL) -");
  831.     }
  832.     if(PlayerInfo[playerid][pAdmin] >= 7)
  833.     {
  834.         SendClientMessage(playerid, COLOR_FADE, "Owner: {F3FF02}/dajnovac -");
  835.     }
  836.     SendClientMessage(playerid, -1, "____________________________________________________________________");
  837.     return 1;
  838. }
  839. ALTCOMMAND:gqp->gamequerpomoc;
  840. CMD:gamequerpomoc(playerid, params[])
  841. {
  842.     if(PlayerInfo[playerid][pGameQuer] == 0) return SendClientMessage(playerid, -1,"Niste GameQuer !");
  843.     SendClientMessage(playerid, -1, "____________________________________________________________________");
  844.     if(PlayerInfo[playerid][pGameQuer] >= 1)
  845.     {
  846.         SendClientMessage(playerid, COLOR_FADE, "Pomocnik: {F3FF02}Komande u izradi !");
  847.     }
  848.     if(PlayerInfo[playerid][pGameQuer] >= 2)
  849.     {
  850.         SendClientMessage(playerid, COLOR_FADE, "Pomocni Quer: {F3FF02}Komande u izradi !");
  851.     }
  852.     if(PlayerInfo[playerid][pGameQuer] >= 3)
  853.     {
  854.         SendClientMessage(playerid, COLOR_FADE, "GameQuer: {F3FF02}Komande u izradi !");
  855.     }
  856.     if(PlayerInfo[playerid][pGameQuer] >= 4)
  857.     {
  858.         SendClientMessage(playerid, COLOR_FADE, "Glavni Quer: {F3FF02}/postavigamequer (/PGQ) - /dajnovac");
  859.     }
  860.     SendClientMessage(playerid, -1, "____________________________________________________________________");
  861.     return 1;
  862. }
  863.  
  864. ALTCOMMAND:o->ooc;
  865. CMD:ooc(playerid, params[])
  866. {
  867.     new
  868.         string[ 186 ]
  869.     ;
  870.     if((noooc) && PlayerInfo[playerid][pAdmin] < 1 || PlayerInfo[playerid][pGameQuer] < 1) return SendClientMessage(playerid, COLOR_GRAD2, "OOC Chat ugasen od strane Admina/GameQuer-a !");
  871.     if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: {FFFFFF}(/o)oc [ooc chat]");
  872.  
  873.     format(string, sizeof(string), "(( OOC: %s: %s ))", RPName(playerid), params);
  874.     OOCOff(0xCCFFFF00, string);
  875.     OOCLog(string);
  876.     printf("%s", string);
  877.     return 1;
  878. }
  879.  
  880. CMD:b(playerid, params[])
  881. {
  882.     new
  883.         string[ 128 ]
  884.     ;
  885.     if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: {FFFFFF} /b [ooc chat]");
  886.     format(string, sizeof(string), "(( OOC: %s[%i]: %s ))", RPName( playerid ), playerid, params);
  887.     printf("%s", string);
  888.     ProxDetector(30.0, playerid, string, COLOR_FADE,COLOR_FADE,COLOR_FADE,COLOR_FADE,COLOR_FADE);
  889.     return 1;
  890. }
  891.  
  892. CMD:do(playerid, params[])
  893. {
  894.     new
  895.         result[ 128 ],
  896.         string[ 128 ]
  897.     ;
  898.     if(sscanf(params, "s[128]", result)) return SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: {FFFFFF}/do [radnja]");
  899.     format(string, sizeof(string), "* %s (( %s ))", result, RPName(playerid));
  900.     ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  901.     printf("%s", string);
  902.     return 1;
  903. }
  904.  
  905. CMD:me(playerid, params[])
  906. {
  907.     new
  908.         result[ 128 ],
  909.         string[ 128 ]
  910.     ;
  911.     if(sscanf(params, "s[128]", result)) return SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: {FFFFFF}/do [radnja]");
  912.     format(string, sizeof(string), "* %s %s", RPName(playerid), result);
  913.     ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  914.     printf("%s", string);
  915.     return 1;
  916. }
  917.  
  918. CMD:url(playerid,params[])
  919. {
  920.     SendClientMessage(playerid,red,"Forum u izradi !");
  921.     return 1;
  922. }
  923. CMD:t(playerid,params[])
  924. {
  925.     new Float:X, Float:Y, Float:Z;
  926.     new Nam[MAX_PLAYERS],message[128],str[128];
  927.     if(sscanf(params,"s",message)) return SendClientMessage(playerid,grey,"KORISTI: /t [text]");
  928.     GetPlayerPos(playerid,X,Y,Z);
  929.     GetPlayerName(playerid,Nam,sizeof(Nam));
  930.     format(str,sizeof(str),"%s kaze: %s",Nam, message);
  931.     for(new i=0; i<MAX_PLAYERS; i++)
  932.     {
  933.         if(IsPlayerInRangeOfPoint(i,10, X,Y,Z))
  934.         {
  935.             SendClientMessage(i,0x00E6E6FF,str);
  936.         }
  937.     }
  938.     return 1;
  939. }
  940. CMD:s(playerid,params[])
  941. {
  942.         new Float:X, Float:Y, Float:Z;
  943.         new Nam[MAX_PLAYERS],message[128],str[128];
  944.         if(sscanf(params,"s",message)) return SendClientMessage(playerid,grey,"KORISTI: /s [text]");
  945.         GetPlayerName(playerid,Nam,sizeof(Nam));
  946.         GetPlayerPos(playerid,X,Y,Z);
  947.         format(str,sizeof(str),"%s vice: %s",Nam, message);
  948.         for(new i=0; i<MAX_PLAYERS; i++)
  949.         {
  950.                 if(IsPlayerInRangeOfPoint(i,20, X,Y,Z))
  951.                 {
  952.                     SendClientMessage(i,red,str);
  953.                 }
  954.         }
  955.         return 1;
  956. }
  957. CMD:w(playerid,params[])
  958. {
  959.         new Float:X, Float:Y, Float:Z;
  960.         new Nam[MAX_PLAYERS],message[128],str[128];
  961.         if(sscanf(params,"s",message)) return SendClientMessage(playerid,grey,"KORISTI: /w [text]");
  962.         GetPlayerName(playerid,Nam,sizeof(Nam));
  963.         GetPlayerPos(playerid,X,Y,Z);
  964.         format(str,sizeof(str),"%s nesto sapuce: %s",Nam, message);
  965.         for(new i=0; i<MAX_PLAYERS; i++)
  966.         {
  967.                 if(IsPlayerInRangeOfPoint(i, 5.0, X,Y,Z))
  968.                 {
  969.                     SendClientMessage(i,0xFF925EFF,str);
  970.                 }
  971.         }
  972.         return 1;
  973. }
  974.  
  975. CMD:naglasak(playerid, params[])
  976. {
  977.     if(isnull(params)) return SendClientMessage(playerid, COLOR_GRAD1, "KORISTI: {FFFFFF}/naglasak [Ruski | Talijanski | Njemacki | Japanski | Francuski | Spanjolski | Kineski | Britanski | Normalni]");
  978.     if(!strcmp(params,"ruski",true))
  979.     {
  980.         PlayerInfo[playerid][pAccent] = 1;
  981.         SendClientMessage(playerid, COLOR_GRAD1, "Vas naglasak je sada Ruski !");
  982.     }
  983.     else if(!strcmp(params,"talijanski",true))
  984.     {
  985.         PlayerInfo[playerid][pAccent] = 2;
  986.         SendClientMessage(playerid, COLOR_GRAD1, "Vas naglasak je sada Talijanski !");
  987.     }
  988.     else if(!strcmp(params,"njemacki",true))
  989.     {
  990.         PlayerInfo[playerid][pAccent] = 3;
  991.         SendClientMessage(playerid, COLOR_GRAD1, "Vas naglasak je sada Njemacki !");
  992.     }
  993.     else if(!strcmp(params,"japanski",true))
  994.     {
  995.         PlayerInfo[playerid][pAccent] = 4;
  996.         SendClientMessage(playerid, COLOR_GRAD1, "Vas naglasak je sada Japanski !");
  997.     }
  998.     else if(!strcmp(params,"francuski",true))
  999.     {
  1000.         PlayerInfo[playerid][pAccent] = 5;
  1001.         SendClientMessage(playerid, COLOR_GRAD1, "Vas naglasak je sada Francuski !");
  1002.     }
  1003.     else if(!strcmp(params,"spanjolski",true))
  1004.     {
  1005.         PlayerInfo[playerid][pAccent] = 6;
  1006.         SendClientMessage(playerid, COLOR_GRAD1, "Vas naglasak je sada Spanjolski !");
  1007.     }
  1008.     else if(!strcmp(params,"kineski",true))
  1009.     {
  1010.         PlayerInfo[playerid][pAccent] = 7;
  1011.         SendClientMessage(playerid, COLOR_GRAD1, "Vas naglasak je sada Kineski !");
  1012.     }
  1013.     else if(!strcmp(params,"britanski", true))
  1014.     {
  1015.         PlayerInfo[playerid][pAccent] = 8;
  1016.         SendClientMessage(playerid, COLOR_GRAD1, "Vas naglasak je sada Britanski !");
  1017.     }
  1018.     else if(!strcmp(params,"normalni",true))
  1019.     {
  1020.         PlayerInfo[playerid][pAccent] = 0;
  1021.         SendClientMessage(playerid, COLOR_GRAD1, "Maknuli ste naglasak !");
  1022.     }
  1023.     else return SendClientMessage(playerid, COLOR_GREY, "Nepoznati naglasak !");
  1024.     return 1;
  1025. }
  1026.  
  1027. CMD:pa(playerid, params[])
  1028. return cmd_postaviadmina(playerid, params);
  1029. CMD:postaviadmina(playerid, params[])
  1030. {
  1031.         new alvl,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],str[128],ID;
  1032.         if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, COLOR_GRAD1, " Niste Admin ili nemate dovoljan Admin Level ! ");
  1033.         if(sscanf(params,"ui",ID,alvl)) return SendClientMessage(playerid,0xFF9900AA, "KORISTI: {F3FF02}/postaviadmina (/PA) [playerid] [admin level 1-7]");//If you do not use the format /makeadmin properly it will show you how
  1034.         if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,0xFF0000FF, "{F3FF02}Ta osoba nije prikljucena serveru.");//if its an unknown ID, it will show that person is not connected
  1035.         if(alvl > 7 || alvl < 1) return SendClientMessage(playerid,0xFF0000FF," Ne mozete dati manji level od 1, a veci od 7 !");
  1036.         if(alvl >= 1 || alvl <= 7)//if you select admin lvl 1 then they will be a seceret admin
  1037.         {
  1038.             if(PlayerInfo[ID][pAdmin] == alvl) return SendClientMessage(playerid,0xFF0000FF,"GRESKA: Ta osoba je trenutno taj {F3FF02}Admin Level !");
  1039.             GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//defines the playerid name
  1040.             GetPlayerName(ID,pname,MAX_PLAYER_NAME);//defines the other player name
  1041.             format(str, sizeof(str),"Pomocni Vlasnik %s Vam je dao Admin Level %d ! {F3FF02}Cestitamo !",Nam, alvl);//string
  1042.             SendClientMessage(ID,0xFF9900AA,str);//Sends the other person a message
  1043.             format(str, sizeof(str),"{F3FF02}%s je dobio Admin Level %d !",pname, alvl);//string
  1044.             SendClientMessage(playerid,0xFF9900AA,str);//Sends you a message
  1045.             format(str, sizeof(str), "Admin %s je dao %s Admin Level %d !", Nam, pname, alvl);
  1046.             PlayerInfo[ID][pAdmin] = alvl;
  1047.         }
  1048.         return 1;
  1049. }
  1050.  
  1051. CMD:dajnovac(playerid, params[])
  1052. {
  1053.     new targetid,type,string[128];
  1054.     if(sscanf(params, "ui", targetid, type)) return SendClientMessage(playerid, COLOR_GRAD2, "KORISTI: {FFFFFF}/Dajnovac [playerid] [kolicina]");
  1055.     if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GREY, "* Ta osoba nije prikljucena serveru.");
  1056.     if(type < 0 || type > 10000000) return SendClientMessage(playerid, COLOR_GREY, "* Ne mozete dati manje od 0 i vise od 10000000.");
  1057.     if(PlayerInfo[playerid][pAdmin] < 7 || PlayerInfo[playerid][pGameQuer] < 4) return SendClientMessage(playerid, COLOR_GRAD1, "Niste Admin ili niste dovoljan Admin Level !");
  1058.  
  1059.     GivePlayerCash(targetid, type);
  1060.     format(string, sizeof(string),"Admin/GameQuer %s je dao %s %d Dolara.", RPName( playerid ), RPName( targetid ), type);
  1061.     SendAdminMessage(COLOR_YELLOW,string);
  1062.     return 1;
  1063. }
  1064.  
  1065. CMD:pgq(playerid, params[])
  1066. return cmd_postavigamequer(playerid, params);
  1067. CMD:postavigamequer(playerid, params[])
  1068. {
  1069.         new gqlvl,Nam[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],str[128],ID;
  1070.         if(PlayerInfo[playerid][pAdmin] < 7 || PlayerInfo[playerid][pGameQuer] < 4) return SendClientMessage(playerid, COLOR_GRAD1, " Niste Glavni Admin ili niste Glavni GameQuer ! ");
  1071.         if(sscanf(params,"ui",ID,gqlvl)) return SendClientMessage(playerid,0xFF9900AA, "{F3FF02}KORISTI: /postavigamequer (/PGQ) [playerid] [GameQuer Level 1-4]");//If you do not use the format /makeadmin properly it will show you how
  1072.         if(ID == INVALID_PLAYER_ID) return SendClientMessage(playerid,0xFF0000FF, "Ta osoba nije prikljucena serveru.");//if its an unknown ID, it will show that person is not connected
  1073.         if(gqlvl > 4 || gqlvl < 1) return SendClientMessage(playerid,0xFF0000FF," Ne mozete dati manji level od 1, a veci od 7 !");
  1074.         if(gqlvl >= 1 || gqlvl <= 4)//if you select admin lvl 1 then they will be a seceret admin
  1075.         {
  1076.             if(PlayerInfo[ID][pGameQuer] == gqlvl) return SendClientMessage(playerid,0xFF0000FF,"GRESKA: Ta osoba je vec trenutno taj {F3FF02}GameQuer Level. !");
  1077.             GetPlayerName(playerid,Nam, MAX_PLAYER_NAME);//defines the playerid name
  1078.             GetPlayerName(ID,pname,MAX_PLAYER_NAME);//defines the other player name
  1079.             format(str, sizeof(str),"Glavni Admin ili Glavni GameQuer %s Vam je dao GameQuer Level %d ! {F3FF02}Cestitamo !",Nam, gqlvl);//string
  1080.             SendClientMessage(ID,0xFF9900AA,str);//Sends the other person a message
  1081.             format(str, sizeof(str),"{F3FF02}%s je dobio GameQuer Level %d !",pname, gqlvl);//string
  1082.             SendClientMessage(playerid,0xFF9900AA,str);//Sends you a message
  1083.             format(str, sizeof(str), "Glavni Admin ili Glavni GameQuer %s je dao %s GameQuer Level %d !", Nam, pname, gqlvl);
  1084.             PlayerInfo[ID][pGameQuer] = gqlvl;
  1085.         }
  1086.         return 1;
  1087. }
  1088. //--------------------KOMANDE ZA ORGANIZACIJE----------------------------------------------------------------------
  1089. ALTCOMMAND:pl->postavilidera;
  1090. CMD:postavilidera(playerid, params[])
  1091. {
  1092.     if (IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] < 6) // Provjerava da li je igrac RCON admin, vi to mozete promijeniti u svoju provjeru
  1093.     {
  1094.         new
  1095.             iPlayerID,
  1096.             iOrgID,
  1097.             szPlayerName[MAX_PLAYER_NAME],
  1098.             szMessage[105];
  1099.  
  1100.         if (sscanf(params, "ud", iPlayerID, iOrgID)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  1101.             return SendClientMessage(playerid, C_WHITE, "KORISTI: /makeleader [igracev ID/dio imena] [ID organizacije]");
  1102.         else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
  1103.             return SendClientMessage(playerid, C_WHITE, "GRESKA: Pogresan ID igraca.");
  1104.         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
  1105.             return SendClientMessage(playerid, C_WHITE, "GRESKA: ID organizacije ne smije biti manji od 1 ili veci od "#MAX_ORGS);
  1106.  
  1107.         PlayerInfo[iPlayerID][pLeader] = iOrgID; // Postavlja igracevu varijablu za lidera na ID organizacije, jer moramo negdje zapamtit koje organizacije je igrac lider
  1108.         PlayerInfo[iPlayerID][pRank] = 6; // Postavlja igracevu varijablu za rank na 6, to vi mozete promijeniti ako ne zelite da vam je najveci rank 6
  1109.  
  1110.         switch(iOrgID)
  1111.         {
  1112.             case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  1113.             {
  1114.                 PlayerInfo[iPlayerID][pSkin] = GetPlayerSkin(iPlayerID); // Sprema igracev skin tako da ako ikad bude izbacen iz organizacije, dobija svoj stari skin natrag
  1115.                 PlayerInfo[iPlayerID][pOrgSkin] = 283; // Broj 283 je ID skina lidera organizacije, to mozete promijeniti u koji kod skin ID vi zelite
  1116.  
  1117.                 SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pOrgSkin]); // Postavlja igracu skin za lidera organizacije
  1118.             }
  1119.             // 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
  1120.             /*case 2: // Druga organizacije, nazovimo je FBI
  1121.             {
  1122.                 PlayerInfo[iPlayerID][pSkin] = GetPlayerSkin(iPlayerID); // Sprema igracev skin tako da ako ikad bude izbacen iz organizacije, dobija svoj stari skin natrag
  1123.                 PlayerInfo[iPlayerID][pOrgSkin] = 283; // Broj 283 je ID skina lidera organizacije, to mozete promijeniti u koji kod skin ID vi zelite
  1124.  
  1125.                 SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pOrgSkin]); // Postavlja igracu skin za lidera organizacije
  1126.             }*/
  1127.         }
  1128.  
  1129.         GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  1130.  
  1131.         format(szMessage, sizeof(szMessage), "INFO: Admin %s vas je postavio za lidera organizacije %s", szPlayerName, GetOrgNameByID(iOrgID));
  1132.         SendClientMessage(iPlayerID, C_WHITE, szMessage);
  1133.  
  1134.         GetPlayerName(iPlayerID, szPlayerName, MAX_PLAYER_NAME);
  1135.  
  1136.         format(szMessage, sizeof(szMessage), "INFO: Postavio si igraca %s za lidera organizacije %s", szPlayerName, GetOrgNameByID(iOrgID));
  1137.         SendClientMessage(playerid, C_WHITE, szMessage);
  1138.     }
  1139.     else
  1140.         SendClientMessage(playerid, C_WHITE, "{F3FF02}GRESKA: Moras biti RCON admin da koristis ovu komandu.");
  1141.     return 1;
  1142. }
  1143.  
  1144. CMD:invite(playerid, params[])
  1145. {
  1146.     if (PlayerInfo[playerid][pLeader] > 0) // Provjerava da li je igrac lider icega
  1147.     {
  1148.         new
  1149.             iPlayerID,
  1150.             szPlayerName[MAX_PLAYER_NAME],
  1151.             szInviteMsg[241];
  1152.  
  1153.         if (sscanf(params, "u", iPlayerID)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  1154.             return SendClientMessage(playerid, C_WHITE, "KORISTI: /invite [igracev ID/dio imena]");
  1155.         else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
  1156.             return SendClientMessage(playerid, C_WHITE, "GRESKA: Pogresan ID igraca.");
  1157.  
  1158.         GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  1159.  
  1160.         switch(PlayerInfo[playerid][pLeader])
  1161.         {
  1162.             case 1: // Prva organizacija, nazovimo je Los Santos Police Department
  1163.             {
  1164.                 PlayerInfo[iPlayerID][pMember] = PlayerInfo[playerid][pLeader]; // Ovdje postavljamo igracu kojeg zelimo pozvati u organizaciju varijablu na ID organizacije (tako da kasnije znamo u kojoj je organizaciji)
  1165.                 PlayerInfo[iPlayerID][pRank] = 1; // Postavlja igracu kojeg zelimo pozvati u organizaciju rank na 1
  1166.  
  1167.                 // Ovdje formatiramo poruku koju cemo poslati igracu koji je pozvan u organizaciju
  1168.                 // Preko te poruke ce pozvani igrac prihvatiti ili ne prihvatiti ulazak u organizaciju
  1169.                 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);
  1170.             }
  1171.             // 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
  1172.             /*case 2: // Druga organizacije, nazovimo je FBI
  1173.             {
  1174.                 PlayerInfo[iPlayerID][pMember] = PlayerInfo[playerid][pLeader]; // Ovdje postavljamo igracu kojeg zelimo pozvati u organizaciju varijablu na ID organizacije (tako da kasnije znamo u kojoj je organizaciji)
  1175.                 PlayerInfo[iPlayerID][pRank] = 1; // Postavlja igracu kojeg zelimo pozvati u organizaciju rank na 1
  1176.  
  1177.                 // Ovdje formatiramo poruku koju cemo poslati igracu koji je pozvan u organizaciju
  1178.                 // Preko te poruke ce pozvani igrac prihvatiti ili ne prihvatiti ulazak u organizaciju
  1179.                 // Kad dodajete novu organizaciju, morate promijeniti neke nazive u tekstu kako ne bi svaki tekst bio isti (govorim o imenu organizacije)
  1180.                 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);
  1181.             }*/
  1182.         }
  1183.  
  1184.         ShowPlayerDialog(iPlayerID, DIALOG_ORG_INVITE, DIALOG_STYLE_MSGBOX, "POZVANI STE U ORGANIZACIJU", szInviteMsg, "Prihvacam", "Odbijam");
  1185.     }
  1186.     else
  1187.         SendClientMessage(playerid, C_WHITE, "GRESKA: Moras biti lider da koristis ovu komandu.");
  1188.     return 1;
  1189. }
  1190.  
  1191. CMD:rank(playerid, params[])
  1192. {
  1193.     if (PlayerInfo[playerid][pLeader] > 0) // Provjerava da li je igrac lider icega
  1194.     {
  1195.         new
  1196.             iPlayerID,
  1197.             iRankNum,
  1198.             szPlayerName[MAX_PLAYER_NAME],
  1199.             szMessage[71];
  1200.  
  1201.         if (sscanf(params, "ud", iPlayerID, iRankNum)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  1202.             return SendClientMessage(playerid, C_WHITE, "KORISTI: /rankup [igracev ID/dio imena] [rank]");
  1203.         else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
  1204.             return SendClientMessage(playerid, C_WHITE, "GRESKA: Pogresan ID igraca.");
  1205.         else if (iRankNum < 1 || iRankNum > 6) // Ako je broj ranka manji od 1 ili veci od 6, ispisuje mu tu poruku
  1206.             return SendClientMessage(playerid, C_WHITE, "GRESKA: ID organizacije ne smije biti manji od 1 ili veci od 6.");
  1207.         else if (PlayerInfo[iPlayerID][pMember] != PlayerInfo[playerid][pLeader]) // Provjerava da li su igrac i ID igraca koji je upisao u istoj organizaciji
  1208.             return SendClientMessage(playerid, C_WHITE, "GRESKA: Taj igrac nije u vasoj organizaciji.");
  1209.  
  1210.         PlayerInfo[iPlayerID][pRank] = iRankNum; // Postavlja igracevu varijablu na broj ranka, tako da bi kasnije mogli znati koji je igrac rank
  1211.  
  1212.         GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  1213.  
  1214.         format(szMessage, sizeof(szMessage), "INFO: Lider %s ti je postavio rank na "CRED"%d", szPlayerName, iRankNum);
  1215.         SendClientMessage(iPlayerID, C_WHITE, szMessage);
  1216.  
  1217.         GetPlayerName(iPlayerID, szPlayerName, MAX_PLAYER_NAME);
  1218.  
  1219.         format(szMessage, sizeof(szMessage), "INFO: Postavio si clanu %s rank na "CRED"%d", szPlayerName, iRankNum);
  1220.         SendClientMessage(playerid, C_WHITE, szMessage);
  1221.     }
  1222.     else
  1223.         SendClientMessage(playerid, C_WHITE, "GRESKA: Moras biti lider da koristis ovu komandu.");
  1224.     return 1;
  1225. }
  1226.  
  1227. CMD:izbaci(playerid, params[])
  1228. {
  1229.     if (PlayerInfo[playerid][pLeader] > 0) // Provjerava da li je igrac lider icega
  1230.     {
  1231.         new
  1232.             iPlayerID,
  1233.             szPlayerName[MAX_PLAYER_NAME],
  1234.             szMessage[68];
  1235.  
  1236.         if (sscanf(params, "u", iPlayerID)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  1237.             return SendClientMessage(playerid, C_WHITE, "KORISTI: /izbaci [igracev ID/dio imena]");
  1238.         else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
  1239.             return SendClientMessage(playerid, C_WHITE, "GRESKA: Pogresan ID igraca.");
  1240.         else if (PlayerInfo[iPlayerID][pMember] != PlayerInfo[playerid][pLeader]) // Provjerava da li su igrac i ID igraca koji je upisao u istoj organizaciji
  1241.             return SendClientMessage(playerid, C_WHITE, "GRESKA: Taj igrac nije u vasoj organizaciji.");
  1242.  
  1243.         PlayerInfo[iPlayerID][pLeader] = 0; // Resetira igracevu varijablu jer vise nije u organizaciji
  1244.         PlayerInfo[iPlayerID][pMember] = 0; // Resetira igracevu varijablu jer vise nije u organizaciji
  1245.         PlayerInfo[iPlayerID][pRank] = 0; // Resetira igracevu varijablu jer vise nije u organizaciji
  1246.         PlayerInfo[iPlayerID][pOrgSkin] = 0; // Resetira igracevu varijablu jer vise nije u organizaciji
  1247.  
  1248.         SetPlayerSkin(iPlayerID, PlayerInfo[iPlayerID][pSkin]); // Vraca igracev skin koji je imao prije ulaska u organizaciju
  1249.  
  1250.         GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  1251.  
  1252.         format(szMessage, sizeof(szMessage), "INFO: Lider %s te je izbacio iz organizacije.", szPlayerName);
  1253.         SendClientMessage(iPlayerID, C_WHITE, szMessage);
  1254.  
  1255.         GetPlayerName(iPlayerID, szPlayerName, MAX_PLAYER_NAME);
  1256.  
  1257.         format(szMessage, sizeof(szMessage), "INFO: Izbacio si clana %s iz organizacije.", szPlayerName);
  1258.         SendClientMessage(playerid, C_WHITE, szMessage);
  1259.     }
  1260.     else
  1261.         SendClientMessage(playerid, C_WHITE, "GRESKA: Moras biti lider da koristis ovu komandu.");
  1262.     return 1;
  1263. }
  1264.  
  1265. CMD:radio(playerid, params[])
  1266. return cmd_r(playerid, params);
  1267. CMD:r(playerid, params[])
  1268. {
  1269.     if (PlayerInfo[playerid][pMember] > 1 || PlayerInfo[playerid][pLeader] > 1)
  1270.     {
  1271.         new
  1272.             szChatMsg[128],
  1273.             szPlayerName[MAX_PLAYER_NAME],
  1274.             szMessage[128];
  1275.  
  1276.         if (sscanf(params, "s[128]", szChatMsg)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  1277.             return SendClientMessage(playerid, C_WHITE, "KORISTI: (/r)adio [tekst]");
  1278.  
  1279.         GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  1280.  
  1281.         foreach(new iPlayerID : Player)
  1282.         {
  1283.             // Prolazi kroz sve online igrace i provjerava da li su u istoj organizaciji kao i posiljatelj poruke
  1284.             if (PlayerInfo[iPlayerID][pMember] == PlayerInfo[playerid][pMember] || PlayerInfo[iPlayerID][pLeader] == PlayerInfo[playerid][pLeader])
  1285.             {
  1286.                 format(szMessage, sizeof(szMessage), "%s %s kaze: %s, Prijem", GetPlayerRank(playerid), szPlayerName, szChatMsg);
  1287.                 SendClientMessage(iPlayerID, C_WHITE, szMessage);
  1288.             }
  1289.         }
  1290.     }
  1291.     else
  1292.     SendClientMessage(playerid, C_WHITE, "GRESKA: Moras biti clan neke organizacije da koristis ovu komandu.");
  1293.     return 1;
  1294. }
Advertisement
Add Comment
Please, Sign In to add comment