SHARE
TWEET

Untitled

a guest Jan 20th, 2020 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CMD:l(playerid, params[]) return cmd_leader(playerid, params);
  2. CMD:leader(playerid,params[]) // Komanda za lidera
  3. {
  4.     new opcija[64], text[128], string[256], iPlayerID, szPlayerName[MAX_PLAYER_NAME], szMessage[128], iRankNum;
  5.     if(ulogiran[playerid] == false) return 1; // Provjera za ulogiranog igraca.
  6.     if(PlayerInfo[playerid][pLider] == 0) return LIDERERROR // Provjera dali je taj igrac lider.
  7.     if(sscanf(params, "s[128]{u}{u}{u}{i}{s[128]}{s[128]}{u}", opcija)) return SCM(playerid, COLOR_UPORABA, "KORISTENJE: (/l)eader [/(un)invite/msg/rank/safe/checkwar]"); //Lider opcije
  8.     if(strcmp(opcija, "invite", true) == 0)
  9.     {
  10.         GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  11.         if(sscanf(params, "{s[20]}u", iPlayerID)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  12.         return SCM(playerid, COLOR_UPORABA, "KORISTENJE: (/l)eader invite [ID/DioImena]");
  13.         else if(iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
  14.         return SendClientMessage(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije prijavljena na svoj korisnicki racun - provjerite unesene parametre."); PlayerPlaySound(playerid,1055,0.0,0.0,0.0);
  15.         if(PlayerInfo[iPlayerID][pMember] >= 1) return SendClientMessage(playerid, COLOR_ROZA, "ERROR: Odabrana osoba je vec u nekoj organizaciji - provjerite unesene parametre."); PlayerPlaySound(playerid,1055,0.0,0.0,0.0);
  16.         if(PlayerInfo[playerid][pLider] == 1) { PozvanOrga[iPlayerID] = 1; }
  17.         else if(PlayerInfo[playerid][pLider] == 2) { PozvanOrga[iPlayerID] = 2; }
  18.         else if(PlayerInfo[playerid][pLider] == 3) { PozvanOrga[iPlayerID] = 3; }
  19.         else if(PlayerInfo[playerid][pLider] == 4) { PozvanOrga[iPlayerID] = 4; }
  20.         else if(PlayerInfo[playerid][pLider] == 5) { PozvanOrga[iPlayerID] = 5; }
  21.         else if(PlayerInfo[playerid][pLider] == 6) { PozvanOrga[iPlayerID] = 6; }
  22.         else if(PlayerInfo[playerid][pLider] == 7) { PozvanOrga[iPlayerID] = 7; }
  23.         else if(PlayerInfo[playerid][pLider] == 8) { PozvanOrga[iPlayerID] = 8; }
  24.         else if(PlayerInfo[playerid][pLider] == 9) { PozvanOrga[iPlayerID] = 9; }
  25.         else if(PlayerInfo[playerid][pLider] == 10) { PozvanOrga[iPlayerID] = 10; }
  26.         else if(PlayerInfo[playerid][pLider] == 11) { PozvanOrga[iPlayerID] = 11; }
  27.         else if(PlayerInfo[playerid][pLider] == 12) { PozvanOrga[iPlayerID] = 12; }
  28.         else if(PlayerInfo[playerid][pLider] == 13) { PozvanOrga[iPlayerID] = 13; }
  29.         format(string, sizeof(string), "* Pozvali ste igraca %s da se predruzi u vasu organizaciju.", GetName(iPlayerID));
  30.         SendClientMessage(playerid, COLOR_PONUDA, string);
  31.         format(string, sizeof(string), "* Lider %s vas je pozvao u organizaciju %s - da prihvatite invite upisite '/accept invite'.", szPlayerName, ImeOrg(PlayerInfo[playerid][pLider]));
  32.         SendClientMessage(iPlayerID, COLOR_PONUDA, string);
  33.         invite_timer[iPlayerID] = SetTimerEx("InviteIstice", 10000, true, "i", iPlayerID);
  34.     }
  35.     if(strcmp(opcija, "uninvite", true) == 0)
  36.     {
  37.         new targetname[85], filestring[80];
  38.         if(!ulogiran[playerid]) return 1;
  39.         if(sscanf(params, "s[20]", targetname)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  40.         return SCM(playerid, COLOR_UPORABA, "KORISTENJE: (/l)eader uninvite [Ime_Prezime]");
  41.         if(!IsRPname(targetname)) return NEPOSTOJI
  42.         format(filestring, sizeof(filestring), "/Korisnici/%s.ini", targetname);
  43.         if(!fexist(filestring)) return NEPOSTOJI
  44.         if(IsPlayerConnected(GetPlayerID(targetname)) && ulogiran[GetPlayerID(targetname)] == false) return SCM(playerid,COLOR_ROZA, "ERROR: Odabrani igrac nije online ili nije ulogiran u svoj korisnicki racun."), PlayerPlaySound(playerid,1055,0.0,0.0,0.0);
  45.         if(IsPlayerConnected(GetPlayerID(targetname)))
  46.         {
  47.             if(PlayerInfo[GetPlayerID(targetname)][pRank] < 7)
  48.             {
  49.                 if(PlayerInfo[GetPlayerID(targetname)][pOrgUgovor] < 90)
  50.                 {
  51.                     if(PlayerInfo[GetPlayerID(targetname)][pSpol] == 0) { PlayerInfo[GetPlayerID(targetname)][pSkin] = 299; }
  52.                     if(PlayerInfo[GetPlayerID(targetname)][pSpol] == 1) { PlayerInfo[GetPlayerID(targetname)][pSkin] =  192;}
  53.                     PlayerInfo[GetPlayerID(targetname)][pMember] = 0;
  54.                     PlayerInfo[GetPlayerID(targetname)][pRank] = 0;
  55.                     PlayerInfo[GetPlayerID(targetname)][pOrgUgovor] = 0;
  56.                     PlayerInfo[GetPlayerID(targetname)][pDostave] = 0;
  57.                     PlayerInfo[GetPlayerID(targetname)][pHitTime] = 0;
  58.                     PlayerInfo[GetPlayerID(targetname)][pOdbacioMetu] = 0;
  59.                     PlayerInfo[GetPlayerID(targetname)][pUzeoHitmanSkin] = 0;
  60.                     PlayerInfo[GetPlayerID(targetname)][pArea] = 1;
  61.                     PlayerInfo[GetPlayerID(targetname)][pAreaSati] = 1;
  62.                     PlayerInfo[GetPlayerID(targetname)][pAreaMinute] = 59;
  63.                     PlayerInfo[GetPlayerID(targetname)][pAreaSekunde] = 59;
  64.                     PlayerInfo[GetPlayerID(targetname)][pAread]++;
  65.                     SetPlayerPos(GetPlayerID(targetname), 207.0154,1920.6406,17.6406);
  66.                     SetPlayerInterior(GetPlayerID(targetname), 0);
  67.                     SetPlayerVirtualWorld(GetPlayerID(targetname), 99);
  68.                     SetPlayerFacingAngle(GetPlayerID(targetname), 180);
  69.                     SetCameraBehindPlayer(GetPlayerID(targetname));
  70.                     HitInfo[GetPlayerID(targetname)][hitHit] = 0;
  71.                     hitmanid[GetPlayerID(targetname)] = 0;
  72.                     SetPlayerSkin(GetPlayerID(targetname), PlayerInfo[GetPlayerID(targetname)][pSkin]);
  73.                     ResetPlayerWeapons (GetPlayerID(targetname));
  74.                     //WantedProvjera[GetPlayerID(targetname)] = 1;
  75.                     //GladProvjera[GetPlayerID(targetname)] = 1;
  76.                     SavePlayer(GetPlayerID(targetname));
  77.                 }
  78.             }
  79.             if(PlayerInfo[GetPlayerID(targetname)][pSpol] == 0) { PlayerInfo[GetPlayerID(targetname)][pSkin] = 299; }
  80.             if(PlayerInfo[GetPlayerID(targetname)][pSpol] == 1) { PlayerInfo[GetPlayerID(targetname)][pSkin] =  192;}
  81.             PlayerInfo[GetPlayerID(targetname)][pMember] = 0;
  82.             PlayerInfo[GetPlayerID(targetname)][pRank] = 0;
  83.             PlayerInfo[GetPlayerID(targetname)][pOrgUgovor] = 0;
  84.             PlayerInfo[GetPlayerID(targetname)][pDostave] = 0;
  85.             PlayerInfo[GetPlayerID(targetname)][pHitTime] = 0;
  86.             PlayerInfo[GetPlayerID(targetname)][pOdbacioMetu] = 0;
  87.             PlayerInfo[GetPlayerID(targetname)][pUzeoHitmanSkin] = 0;
  88.             HitInfo[GetPlayerID(targetname)][hitHit] = 0;
  89.             hitmanid[GetPlayerID(targetname)] = 0;
  90.             SetPlayerSkin(GetPlayerID(targetname), PlayerInfo[GetPlayerID(targetname)][pSkin]);
  91.             ResetPlayerWeapons (GetPlayerID(targetname));
  92.             //WantedProvjera[GetPlayerID(targetname)] = 1;
  93.             //GladProvjera[GetPlayerID(targetname)] = 1;
  94.             if(PlayerInfo[GetPlayerID(targetname)][pArea] < 1)
  95.             {
  96.                 PlayerInfo[GetPlayerID(targetname)][pSpawn] = 0;
  97.             }
  98.             SavePlayer(GetPlayerID(targetname));
  99.             format(szMessage, sizeof(szMessage), "INFO: Lider %s vas je izbacio iz svoje organizacije - sada ste obican civil.", GetName(playerid));
  100.             SendClientMessage(GetPlayerID(targetname), COLOR_INFO, szMessage);
  101.             format(szMessage, sizeof(string), "INFO: Izbacili ste %s iz svoje organizacije - sada je obican civil.", GetName(GetPlayerID(targetname)));
  102.             SendClientMessage(playerid, COLOR_INFO, szMessage);
  103.  
  104.         }
  105.         else if(!IsPlayerConnected(GetPlayerID(targetname)))
  106.         {
  107.             if(PlayerInfo[GetPlayerID(targetname)][pRank] < 7)
  108.             {
  109.                 if(PlayerInfo[GetPlayerID(targetname)][pOrgUgovor] < 90)
  110.                 {
  111.                     INI_ParseFile(filestring, "Spol_%s", .bExtra = true, .extra = GetPlayerID(targetname));
  112.                     new skinspol;
  113.                     if(PlayerInfo[GetPlayerID(targetname)][pSpol] == 0) { skinspol = 299; }
  114.                     if(PlayerInfo[GetPlayerID(targetname)][pSpol] == 1) { skinspol = 192; }
  115.                     new INI:File = INI_Open(filestring);
  116.                     INI_SetTag(File, "data");
  117.                     INI_WriteInt(File, "Skin", skinspol);
  118.                     INI_WriteInt(File, "Member", 0);
  119.                     INI_WriteInt(File, "Rank", 0);
  120.                     INI_WriteInt(File, "OrgUgovor", 0);
  121.                     INI_WriteInt(File, "Dostave", 0);
  122.                     INI_WriteInt(File, "Spawn", 0);
  123.                     INI_WriteInt(File, "HitTime", 0);
  124.                     INI_WriteInt(File, "OdbacioMetu", 0);
  125.                     INI_WriteInt(File, "UzeoHitmanSkin", 0);
  126.                     INI_WriteInt(File, "Area", 1);
  127.                     INI_WriteInt(File, "AreaSati", 1);
  128.                     INI_WriteInt(File, "AreaMinute", 59);
  129.                     INI_WriteInt(File, "AreaSekunde", 59);
  130.                     INI_Close(File);
  131.                 }
  132.             }
  133.             format(string, sizeof(string), "INFO: Izbacili ste igraca %s (offline) iz svoje organizacije - sada je obican civil.", targetname);
  134.             SCM(playerid,COLOR_INFO,string);
  135.             INI_ParseFile(filestring, "Spol_%s", .bExtra = true, .extra = playerid);
  136.             new skinspol;
  137.             if(PlayerInfo[GetPlayerID(targetname)][pSpol] == 0) { skinspol = 299; }
  138.             if(PlayerInfo[GetPlayerID(targetname)][pSpol] == 1) { skinspol = 192; }
  139.             new INI:File = INI_Open(filestring);
  140.             INI_SetTag(File, "data");
  141.             INI_WriteInt(File, "Skin", skinspol);
  142.             INI_WriteInt(File, "Member", 0);
  143.             INI_WriteInt(File, "Rank", 0);
  144.             INI_WriteInt(File, "OrgUgovor", 0);
  145.             INI_WriteInt(File, "Dostave", 0);
  146.             INI_WriteInt(File, "Spawn", 0);
  147.             INI_WriteInt(File, "HitTime", 0);
  148.             INI_WriteInt(File, "OdbacioMetu", 0);
  149.             INI_WriteInt(File, "UzeoHitmanSkin", 0);
  150.             INI_Close(File);
  151.         }
  152.     }
  153.     if(strcmp(opcija, "msg", true) == 0)
  154.     {    
  155.         if(sscanf(params, "{s[128]}s[128]", text)) return SCM(playerid, COLOR_UPORABA, "KORISTENJE: (/l)eader msg [poruka]");
  156.         format(string, sizeof(string), "×× %s(%s): %s ××", GetName(playerid), ImeOrg(PlayerInfo[playerid][pLider]), text);
  157.         LiderPoruka(COLOR_LIDERCHAT,string);
  158.     }
  159.     if(strcmp(opcija, "rank", true) == 0)
  160.     {
  161.         if (sscanf(params, "{s[20]}ui", iPlayerID, iRankNum)) // Ako igrac nije upisao sve potrebne parametre, ispisuje mu tu poruku
  162.         return SCM(playerid, COLOR_UPORABA, "KORISTENJE: /(/l)eader rank [ID/DioImena] [rank]");
  163.         else if (iPlayerID == INVALID_PLAYER_ID) // Ako je ID igraca koji je igrac upisao nije online, ispisuje mu tu poruku
  164.         return SendClientMessage(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije prijavljena na svoj korisnicki racun - provjerite unesene parametre.");
  165.         else if (iRankNum < 1 || iRankNum > 7) // Ako je broj ranka manji od 1 ili veci od 6, ispisuje mu tu poruku
  166.         return SendClientMessage(playerid, COLOR_ROZA, "ERROR: Ne mozete dati rank manji od 1 niti veci rank od 7.");
  167.         else if (PlayerInfo[iPlayerID][pMember] != PlayerInfo[playerid][pLider]) // Provjerava da li su igrac i ID igraca koji je upisao u istoj organizaciji
  168.         return SendClientMessage(playerid, COLOR_ROZA, "ERROR: Ne mozete dati rank igracu koji nije u vasoj organizaciji - provjerite upisane parametre.");
  169.         if (PlayerInfo[iPlayerID][pLider] > 0) return SendClientMessage(playerid, COLOR_ROZA, "ERROR: Ne mozete dati rank drugom lideru vase organizacije - samo obicnim clanovima.");
  170.         PlayerInfo[iPlayerID][pRank] = iRankNum; // Postavlja igracevu varijablu na broj ranka, tako da bi kasnije mogli znati koji je igrac rank
  171.         SetPlayerOrgSkin(iPlayerID, ((PlayerInfo[iPlayerID][pLider] > 0) ? (PlayerInfo[iPlayerID][pLider]) : (PlayerInfo[iPlayerID][pMember])), iRankNum);
  172.         GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
  173.         format(szMessage, sizeof(szMessage), "INFO: Lider vase organizacije %s vam je povecao rank na %d.", szPlayerName, iRankNum);
  174.         SendClientMessage(iPlayerID, COLOR_INFO, szMessage);
  175.         GetPlayerName(iPlayerID, szPlayerName, MAX_PLAYER_NAME);
  176.         format(szMessage, sizeof(szMessage), "INFO: Uspjesno ste povecali igracu %s rank na %d.", szPlayerName, iRankNum);
  177.         SendClientMessage(playerid, COLOR_INFO, szMessage);
  178.         TogglePlayerControllable(iPlayerID, 1);
  179.  
  180.     }
  181.     if(strcmp(opcija, "safe", true) == 0)
  182.     {
  183.         if(PlayerInfo[playerid][pLider] == 2 || PlayerInfo[playerid][pLider] == 3 || PlayerInfo[playerid][pLider] == 4 || PlayerInfo[playerid][pLider] == 5 || PlayerInfo[playerid][pLider] == 7)
  184.         {
  185.             if(PlayerInfo[playerid][pLider] == 2)
  186.             {
  187.                 format(string, sizeof(string), "{FFD700}[INFO]: Stanje vaseg sefa je: %d/30000 materijala.", OrganizacijeInfo[YMSef]);
  188.                 SendClientMessage(playerid, -1, string);
  189.             }
  190.             else if(PlayerInfo[playerid][pLider] == 3)
  191.             {
  192.                 format(string, sizeof(string), "{FFD700}[INFO]: Stanje vaseg sefa je: %d/30000 materijala.", OrganizacijeInfo[LCNSef]);
  193.                 SendClientMessage(playerid, -1, string);
  194.             }
  195.             else if(PlayerInfo[playerid][pLider] == 4)
  196.             {
  197.                 format(string, sizeof(string), "{FFD700}[INFO]: Stanje vaseg sefa je: %d/30000 materijala.", OrganizacijeInfo[GSFSef]);
  198.                 SendClientMessage(playerid, -1, string);
  199.             }
  200.             else if(PlayerInfo[playerid][pLider] == 5)
  201.             {
  202.                 format(string, sizeof(string), "{FFD700}[INFO]: Stanje vaseg sefa je: %d/30000 materijala.", OrganizacijeInfo[BGFSef]);
  203.                 SendClientMessage(playerid, -1, string);
  204.             }
  205.             /*else if(PlayerInfo[playerid][pLider] == 7)
  206.             {
  207.                 format(string, sizeof(string), "{FFD700}[INFO]: Stanje vaseg sefa je: %d/30000 materijala.", OrganizacijeInfo[LASef]);
  208.                 SendClientMessage(playerid, -1, string);
  209.             }*/
  210.         }
  211.         else { SCM(playerid, COLOR_ROZA, "ERROR: Samo lider banda / mafia mogu koristiti ovu komandu"); }
  212.     }
  213.     if(strcmp(opcija, "check", true) == 0)
  214.     {
  215.         if (sscanf(params, "{s[20]}u", iPlayerID)) return SCM(playerid, COLOR_UPORABA, "KORISTENJE: /(/l)eader check [ID/DioImena]");
  216.         if(iPlayerID == INVALID_PLAYER_ID) return OFFLINEERROR
  217.         if(PlayerInfo[playerid][pLider] == 1 && PlayerInfo[iPlayerID][pMember] != 1) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  218.         if(PlayerInfo[playerid][pLider] == 2 && PlayerInfo[iPlayerID][pMember] != 2) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  219.         if(PlayerInfo[playerid][pLider] == 3 && PlayerInfo[iPlayerID][pMember] != 3) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  220.         if(PlayerInfo[playerid][pLider] == 4 && PlayerInfo[iPlayerID][pMember] != 4) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  221.         if(PlayerInfo[playerid][pLider] == 5 && PlayerInfo[iPlayerID][pMember] != 5) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  222.         if(PlayerInfo[playerid][pLider] == 6 && PlayerInfo[iPlayerID][pMember] != 6) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  223.         if(PlayerInfo[playerid][pLider] == 7 && PlayerInfo[iPlayerID][pMember] != 7) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  224.         if(PlayerInfo[playerid][pLider] == 8 && PlayerInfo[iPlayerID][pMember] != 8) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  225.         if(PlayerInfo[playerid][pLider] == 9 && PlayerInfo[iPlayerID][pMember] != 9) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  226.         if(PlayerInfo[playerid][pLider] == 10 && PlayerInfo[iPlayerID][pMember] != 10) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  227.         if(PlayerInfo[playerid][pLider] == 11 && PlayerInfo[iPlayerID][pMember] != 11) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  228.         if(PlayerInfo[playerid][pLider] == 12 && PlayerInfo[iPlayerID][pMember] != 12) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  229.         if(PlayerInfo[playerid][pLider] == 13 && PlayerInfo[iPlayerID][pMember] != 13) return SCM(playerid, COLOR_ROZA, "ERROR: Odabrana osoba nije u vasoj organizaciji - provjerite unesene parametre.");
  230.         if(!IsPlayerConnected(iPlayerID)) return OFFLINEERROR
  231.         format(string,sizeof(string),"* %s org. stats",GetName(iPlayerID));
  232.         SCM(playerid,COLOR_UPORABA,string);
  233.         format(string,sizeof(string),"  Rank: %d",PlayerInfo[iPlayerID][pRank]);
  234.         SCM(playerid,-1,string);
  235.         format(string,sizeof(string),"  Org. ugovor: %d",PlayerInfo[iPlayerID][pOrgUgovor]);
  236.         SCM(playerid,-1,string);
  237.         format(string,sizeof(string),"  Dostave: %d",PlayerInfo[iPlayerID][pDostave]);
  238.         SCM(playerid,-1,string);
  239.     }
  240.     return 1;
  241. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top