Guest User

Untitled

a guest
Jan 30th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. PORT CMD
  2.  
  3. YCMD:port(playerid, params[], help)
  4. {
  5. #pragma unused help
  6. if(UlogovanProvera[playerid] == 0) return ERROR(playerid, "Morati biti ulogovani da bi koristili komande!");
  7. if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGM] >= 1)
  8. {
  9. if(AdminDuty[playerid] == 0) return ERROR(playerid, "Morate biti na duznosti da bi koristili komande!");
  10. if(PlayerInfo[playerid][pAdmin] < 6)
  11. {
  12. if(Posao_Oprema[playerid] == 1) return ERROR(playerid, "Ne mozes koristi ovu komandu dok radis posao ili imas equip posla.");
  13. if(PlayerInfo[playerid][pZatvor] != 0) return ERROR(playerid, "Ne mozes koristi ovu komandu dok si u jailu.");
  14. }
  15. new str_frm[40], str[1024];
  16. for(new i = 0; i < MAX_PORT; i++)
  17. {
  18. if(PortInfo[i][portCreated] == 1)
  19. {
  20. format(str_frm, 40, "#\tLocation\n[%d] \t%s\n", i+1, PortInfo[i][portName]);
  21. strcat(str, str_frm, sizeof(str));
  22. }
  23. }
  24. SPD(playerid, D_SELECT_PORT, DST, ""server_boja"Port System", str, "Izaberi", "Izlaz");
  25. }
  26. else return ERROR(playerid, "Morati biti ulogovani da bi koristili komande!");
  27. return 1;
  28. }
  29.  
  30. CREATE PORT
  31. case D_CREATE_PORT:
  32. {
  33. if(!response) return 1;
  34. if(response)
  35. {
  36. new id = -1, Float:Pos[3], nameport[50];
  37. for(new a = 0; a < MAX_PORT; a++)
  38. {
  39. if(PortInfo[a][portCreated] != 1)
  40. {
  41. id = a;
  42. break;
  43. } else continue;
  44. }
  45. if(id == -1) return ERROR(playerid, "Nema vise mesta za kreiranje portova.");
  46. if(sscanf(inputtext, "s[50]", nameport)) return SPD(playerid, D_CREATE_PORT, DSI, ""server_boja"Create Port", "Unesite ime za port lokaciju.", "Unesi", "Izlaz");
  47. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  48. PortInfo[id][portID] = id;
  49. PortInfo[id][portCreated] = 1;
  50. PortInfo[id][portPos][0] = Pos[0];
  51. PortInfo[id][portPos][1] = Pos[1];
  52. PortInfo[id][portPos][2] = Pos[2];
  53. strmid(PortInfo[id][portName], nameport, 0, strlen(nameport), 50);
  54. SacuvajPort();
  55. INFO(playerid, "Uspesno si kreirao novu lokaciju za port.");
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment