Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PORT CMD
- YCMD:port(playerid, params[], help)
- {
- #pragma unused help
- if(UlogovanProvera[playerid] == 0) return ERROR(playerid, "Morati biti ulogovani da bi koristili komande!");
- if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pGM] >= 1)
- {
- if(AdminDuty[playerid] == 0) return ERROR(playerid, "Morate biti na duznosti da bi koristili komande!");
- if(PlayerInfo[playerid][pAdmin] < 6)
- {
- if(Posao_Oprema[playerid] == 1) return ERROR(playerid, "Ne mozes koristi ovu komandu dok radis posao ili imas equip posla.");
- if(PlayerInfo[playerid][pZatvor] != 0) return ERROR(playerid, "Ne mozes koristi ovu komandu dok si u jailu.");
- }
- new str_frm[40], str[1024];
- for(new i = 0; i < MAX_PORT; i++)
- {
- if(PortInfo[i][portCreated] == 1)
- {
- format(str_frm, 40, "#\tLocation\n[%d] \t%s\n", i+1, PortInfo[i][portName]);
- strcat(str, str_frm, sizeof(str));
- }
- }
- SPD(playerid, D_SELECT_PORT, DST, ""server_boja"Port System", str, "Izaberi", "Izlaz");
- }
- else return ERROR(playerid, "Morati biti ulogovani da bi koristili komande!");
- return 1;
- }
- CREATE PORT
- case D_CREATE_PORT:
- {
- if(!response) return 1;
- if(response)
- {
- new id = -1, Float:Pos[3], nameport[50];
- for(new a = 0; a < MAX_PORT; a++)
- {
- if(PortInfo[a][portCreated] != 1)
- {
- id = a;
- break;
- } else continue;
- }
- if(id == -1) return ERROR(playerid, "Nema vise mesta za kreiranje portova.");
- if(sscanf(inputtext, "s[50]", nameport)) return SPD(playerid, D_CREATE_PORT, DSI, ""server_boja"Create Port", "Unesite ime za port lokaciju.", "Unesi", "Izlaz");
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- PortInfo[id][portID] = id;
- PortInfo[id][portCreated] = 1;
- PortInfo[id][portPos][0] = Pos[0];
- PortInfo[id][portPos][1] = Pos[1];
- PortInfo[id][portPos][2] = Pos[2];
- strmid(PortInfo[id][portName], nameport, 0, strlen(nameport), 50);
- SacuvajPort();
- INFO(playerid, "Uspesno si kreirao novu lokaciju za port.");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment