Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Command
- CMD:calls(playerid, params[]) {
- new fid = PlayerInfo[playerid][pMember];
- if(fid == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu faci parte dintr-o factiune!");
- if(fid != 14 && fid != 12 && fid != 13 && fid != 8 && fid != 7) return SCM(playerid, COLOR_LGREEN, "Eroare: Aceasta comanda nu este disponibila factiunii tale!");
- new
- szDialog[512], szDialog2[512], x,
- szZone[128], Float: Pos[3], Float:distance;
- strcat(szDialog2, "Player\tLocation\n");
- switch(fid) {
- case 12,14: {
- foreach(Player, i) {
- if(IsPlayerConnected(i) && TaxiService[i] == 1 && AcceptedTaxiService[i] == 0) {
- SelectedPlayers[playerid][x] = i;
- distance = GetDistanceBetweenPlayers(playerid,i);
- GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
- GetPlayer3DZone2(Pos[0], Pos[1], Pos[2], szZone, sizeof(szZone));
- format(szDialog, sizeof(szDialog), "%s (%d)\t%s - %0.1fm\n", GetName(i), i, szZone, distance);
- strcat(szDialog2, szDialog);
- x++;
- }
- }
- }
- case 13: {
- foreach(Player, i) {
- if(IsPlayerConnected(i) && MedicCall[i] == i) {
- SelectedPlayers[playerid][x] = i;
- distance = GetDistanceBetweenPlayers(playerid,i);
- GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
- GetPlayer3DZone2(Pos[0], Pos[1], Pos[2], szZone, sizeof(szZone));
- format(szDialog, sizeof(szDialog), "%s (%d)\t%s - %0.1fm\n", GetName(i), i, szZone, distance);
- strcat(szDialog2, szDialog);
- x++;
- }
- }
- }
- case 8: {
- foreach(Player, i) {
- if(IsPlayerConnected(i) && MechanicCall[i] == i) {
- SelectedPlayers[playerid][x] = i;
- distance = GetDistanceBetweenPlayers(playerid,i);
- GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
- GetPlayer3DZone2(Pos[0], Pos[1], Pos[2], szZone, sizeof(szZone));
- format(szDialog, sizeof(szDialog), "%s (%d)\t%s - %0.1fm\n", GetName(i), i, szZone, distance);
- strcat(szDialog2, szDialog);
- x++;
- }
- }
- }
- case 7: {
- foreach(Player, i) {
- if(IsPlayerConnected(i) && InstructorCall[i] == 1) {
- SelectedPlayers[playerid][x] = i;
- distance = GetDistanceBetweenPlayers(playerid,i);
- GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
- GetPlayer3DZone2(Pos[0], Pos[1], Pos[2], szZone, sizeof(szZone));
- format(szDialog, sizeof(szDialog), "%s (%d)\t%s - %0.1fm\n", GetName(i), i, szZone, distance);
- strcat(szDialog2, szDialog);
- x++;
- }
- }
- }
- }
- if(x == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nimeni nu a apelat momentan la serviciile factiunii tale!");
- new title[64];
- format(title, sizeof(title), "%s's calls: %d", FactionName(fid), x);
- ShowPlayerDialog(playerid, DIALOG_CALLS, DIALOG_STYLE_TABLIST_HEADERS, title, szDialog2, "Select", "Cancel");
- return 1;
- }
- // Dialog
- case DIALOG_CALLS: {
- if(!response) return 1;
- new id = SelectedPlayers[playerid][listitem];
- if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat!");
- switch(PlayerInfo[playerid][pMember]) {
- case 12,14: {
- if(TaxiService[id] == 1 && AcceptedTaxiService[id] == 0) {
- if(PlayerInfo[playerid][pMember] != 12 || PlayerInfo[playerid][pMember] != 14) return 1;
- if(TaxiService[id] == 0) return SCM(playerid, COLOR_GREY, "Acel player nu a apelat la acest serviciu!");
- if(AcceptedService[playerid] != -1) return SCM(playerid, COLOR_GREY, "Ai acceptat deja o comanda, pentru a renunta la cea curenta, foloseste '/cancel command'.");
- if(AcceptedTaxiService[id] == 1) return SCM(playerid, COLOR_GREY, "Comanda acelui player a fost acceptat de catre alt membru al factiunii.");
- if(!FactionVehicle(playerid)) return SCM(playerid, COLOR_GREY, "Nu esti intr-un vehicul ce apartine factiunii tale!");
- AcceptedTaxiService[id] = 1;
- AcceptedService[playerid] = id;
- targetfind[playerid] = id;
- UsedFind[playerid] = 1;
- format(string, sizeof(string), "**(( Taxi Dispatch: Taximetristul %s (%d) i-a acceptat comanda lui %s (%d). ))**", GetName(playerid), playerid, GetName(id), id);
- SendFactionMessage(12, 0x2C6CBFFf, string);
- format(string, sizeof(string), "**(( Uber Dispatch: Uber %s (%d) i-a acceptat comanda lui %s (%d). ))**", GetName(playerid), playerid, GetName(id), id);
- SendFactionMessage(14, 0x2C6CBFFf, string);
- format(string, sizeof(string), "* Taximetristul %s ti-a preluat comanda.", GetName(playerid));
- SCM(id, COLOR_YELLOW, string);
- CP[playerid] = 53;
- }
- else return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu a apelat la serviciile factiunii tale sau comanda lui a fost accepta de altcineva!");
- }
- case 13: {
- if(MedicCall[id] == id) {
- if(PlayerInfo[playerid][pMember] != 13) return SendClientMessage(playerid, COLOR_WHITE, "Nu esti medic!");
- if(MedicCallTime[playerid] > 0) return SendClientMessage(playerid, COLOR_WHITE, "You have already accepted a medic call.");
- if(IsAnAmbulance(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,COLOR_WHITE, "You're not in ambulance car.");
- if(MedicCall[id] != id) return SendClientMessage(playerid,COLOR_WHITE, "This player has not called ambulance.");
- format(string, sizeof(string), "**(( Paramedic Dispatch: Paramedic %s (%d) i-a acceptat comanda lui %s (%d). ))**",GetName(playerid), playerid, GetName(id), id);
- SendFactionMessage(13, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* Medicul %s ti-a acceptat comanda.",sendername);
- SendClientMessage(MedicCall[id], COLOR_YELLOW, string);
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(MedicCall[id], X, Y, Z);
- SetPlayerCheckpointEx(playerid, X, Y, Z, 5);
- MedicCallTime[playerid] = 1;
- MedicCall[id] = -1;
- CP[playerid] = 53;
- }
- else return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu a apelat la serviciile factiunii tale sau comanda lui a fost accepta de altcineva!");
- }
- case 8: {
- if(MechanicCall[id] == id) {
- if(CP[playerid] != 0) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
- if(PlayerInfo[playerid][pMember] != 8) return SendClientMessage(playerid, COLOR_GREY, "Nu faci parte din factiunea mecanic.");
- if(MechanicCallTime[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "Ai acceptat deja un apel!");
- if(MechanicCall[id] != id) return SCM(playerid,COLOR_WHITE,"Acel player nu a apelat la acest serviciu!");
- format(string, sizeof(string), "**(( TTC Dispatch: Tow Truck Member %s (%d) i-a acceptat comanda lui %s (%d). ))**", GetName(playerid), playerid, GetName(id), id);
- SendFactionMessage(8, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* Mecanicul %s a acceptat apelul tau.",sendername);
- SendClientMessage(MechanicCall[id], COLOR_WHITE, string);
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(MechanicCall[id], X, Y, Z);
- SetPlayerCheckpointEx(playerid, X, Y, Z, 5);
- UsedFind[playerid] = 1;
- targetfind[playerid] = id;
- MechanicCall[id] = -1;
- CP[playerid] = 53;
- }
- else return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu a apelat la serviciile factiunii tale sau comanda lui a fost accepta de altcineva!");
- }
- case 7: {
- if(InstructorCall[id] == 1) {
- if(InstructorCall[id] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Acel player nu a apelat la un instructor.");
- if(PlayerInfo[playerid][pMember] != 7) return SendClientMessage(playerid, COLOR_GREY, "Nu faci parte din factiunea car mechanic.");
- if(CP[playerid] != 0) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
- format(string, sizeof(string), "**(( SI Dispatch: Instructor %s (%d) i-a acceptat comanda lui %s (%d). ))**", GetName(playerid), playerid, GetName(id), id);
- SendFactionMessage(7, COLOR_LIGHTBLUE, string);
- format(string, sizeof(string), "* I-ai acceptat apelul lui %s.",GetName(id));
- SendClientMessage(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "* Instructorul %s a acceptat apelul tau.",GetName(playerid));
- SendClientMessage(id, COLOR_YELLOW, string);
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(InstructorCall[id], X, Y, Z);
- SetPlayerCheckpointEx(playerid, X, Y, Z, 5);
- UsedFind[playerid] = 1;
- targetfind[playerid] = id;
- InstructorCall[id] = 0;
- CP[playerid] = 53;
- }
- else return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu a apelat la serviciile factiunii tale sau comanda lui a fost accepta de altcineva!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement