Pobro

War

Jan 5th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. if(strcmp(cmd, "/war", true) == 0)
  2. {
  3. if(IsPlayerConnected(playerid) && gPlayerLogged[playerid] == 1)
  4. {
  5. if(PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pLeader] == 3 || PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pLeader] == 5)
  6. {
  7. tmp = strtok(cmdtext, idx);
  8. if(!strlen(tmp)) return SCM(playerid, COLOR_DGOLD, "KORISTENJE: /war [ID/DioImena]");
  9. id = ReturnUser(tmp);
  10. if(id == playerid) return SCM(playerid, COLOR_LIGHTRED, "ERROR: Nemozete samom sebi ponuditi war - pokušajte sa liderom druge organizacije.");
  11. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_LIGHTRED, "ERROR: Odabrana osoba nije ulogirana u svoj korisnicki racun - pokusajte poslije.");
  12. if(Warteam[playerid] >= 1) return SCM(playerid, COLOR_LIGHTRED, "ERROR: Trenutno ste na waru - ne mozete koristiti ovu komandu.");
  13. if(Warteam[id] >= 1) return SCM(playerid, COLOR_LIGHTRED, "ERROR: Odabrani lider je vec u ratu - kada zavrsi pokušajte ponovno");
  14. if(PlayerInfo[playerid][pLeader] == PlayerInfo[id][pMember]) return SCM(playerid, COLOR_LIGHTRED, "ERROR: Nemozete ponuditi war lideru iste organizacije u kojoj ste vi.");
  15. if(Spraying[playerid] == 0)
  16. {
  17. if(PlayerInfo[id][pLeader] == 2 || PlayerInfo[id][pLeader] == 3 || PlayerInfo[id][pLeader] == 4 || PlayerInfo[id][pLeader] == 5)
  18. {
  19. format(string, 256, "INFO: Ponudili ste lideru %s war - ukoliko ga prihvati zapocinje war u trajanju od 20 minuta.", Ime(id));
  20. SCM(playerid, COLOR_GOLD, string);
  21. format(string, 256, "INFO: Vas lider %s je ponudio war lideru %s - ukoliko ga prihvati zapocinje war u trajanju od 20 minuta.", Ime(playerid), Ime(id));
  22. SendRadioMessage(PlayerInfo[playerid][pLeader], COLOR_DGOLD, string);
  23. format(string, 256, "INFO: Lider %s vam je ponudio war - upisite '/accept war' da prihvatite war u trajanju od 20 minuta.", Ime(playerid));
  24. SCM(id, COLOR_GOLD, string);
  25. format(string, 256, "INFO: Lider %s je ponudio war vašem lideru %s - ukoliko ga prihvati zapocinje war u trajanju od 20 minuta.", Ime(playerid), Ime(id));
  26. SendRadioMessage(PlayerInfo[id][pLeader], COLOR_GOLD, string);
  27. Warer[id] = 1;
  28. WarOffer[id] = playerid;
  29. WarAccept[id] = playerid;
  30. WarAccept[id] = 1;
  31. SprayAccept[id] = 1;
  32. SetTimerEx("SprayAccepter", 30000, false, "%i", id);
  33. SetTimerEx("SprayTime", 30000, false, "%i", playerid);
  34. Spraying[playerid] = 1;
  35. }
  36. else { SCM(playerid, COLOR_LIGHTRED, "ERROR: Ne mozete ponuditi war nekome tko nije lider bande/mafije."); }
  37. }
  38. else
  39. {
  40. SCM(playerid, COLOR_LIGHTRED, "ERROR: Morate pricekati minimalno 30 sekundi prije nove ponude za rat (/war).");
  41. }
  42. }
  43. else
  44. {
  45. SCM(playerid, COLOR_LIGHTRED, "ERROR: Niste autorizirani za koristenje ove komande - samo lideri banda/mafija.");
  46. }
  47. }
  48. return 1;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment