It shows the nearby message 3 times
#1

pawn Код:
if(Player[playerid][CellphoneConsole] != -1)
    {
        if(Player[playerid][CellphoneConsole] != 911)
        {
            format(string, sizeof(string), "[Phone] %s says: %s", GetName(playerid), text);
            NearByMessage(playerid, GREY, string);
            SendClientMessage(Player[playerid][CellphoneConsole], GREY, string);
            ICChatLog(string);
        }
        else
        {
            new txtstr[128];
            format(txtstr, sizeof(txtstr), "[Phone] %s says: %s", GetName(playerid), text);
            NearByMessage(playerid, GREY, txtstr);
            ICChatLog(string);
           
            switch(Player[playerid][NineOneOneStep])
            {
                case 0:
                {
                    if(!strcmp(text, "LSPD", true))
                    {
                        SendClientMessage(playerid, WHITE, "You've selected the LSPD - How may we help you?");
                        SendClientMessage(playerid, GREY, "Please report the crime you called about.");
                        Player[playerid][NineOneOneStep] = 1;
                    }
                    else if(!strcmp(text, "LSFMD", true))
                    {
                        SendClientMessage(playerid, WHITE, "You've selected the LSFMD - How may we help you?");
                        SendClientMessage(playerid, GREY, "Please describe the current scene!");
                        Player[playerid][NineOneOneStep] = 10;
                    }
                    else
                    {
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
                        Player[playerid][CellphoneConsole] = -1;
                        Player[playerid][NineOneOneStep] = 0;
                        SendClientMessage(playerid, WHITE, "Unrecognized line. The call has been terminated.");
                    }
                }
                case 1:
                {
                    if(strlen(text) >= 1)
                    {
                        format(Player[playerid][ActiveCrimeReport], 255, "%s", text);
                        Player[playerid][NineOneOneStep] = 2;
                        SendClientMessage(playerid, WHITE, "Please report the person who is comitting the crime! Say 'Unsure' if you're unsure.");
                        NearByMessage(playerid, GREY, txtstr);
                    }
                    else
                    {
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
                        Player[playerid][CellphoneConsole] = -1;
                        Player[playerid][NineOneOneStep] = 0;
                    }
                }
                case 2:
                {
                    if(IsPlayerConnectedEx(GetPlayerID(text)))
                    {
                        new location[MAX_ZONE_NAME];
                        GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
                        format(string, sizeof(string), "[DISPATCH]: %s has reported %s for %s.| TRACE: %s | PHONE: %d |", GetName(playerid), GetPlayerID(text), Player[playerid][ActiveCrimeReport], location, Player[playerid][PhoneN]);
                        for(new i = 0; i < MAX_PLAYERS; i++)
                        {
                            if(IsPlayerConnectedEx(i))
                            {
                                if(Groups[Player[i][Group]][CommandTypes] == 1 && Player[i][CopDuty] == 1)
                                {
                                    SendClientMessage(i, RED, string);
                                }
                            }
                        }
                       
                        format(string, sizeof(string), "Thank you for reporting %s. The situation will be investigated!");
                        SendClientMessage(playerid, WHITE, string);
                        Player[playerid][CellphoneConsole] = -1;
                        Player[playerid][NineOneOneStep] = 0;
                       
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
                    }
                    else if(!strcmp(text, "Unsure", true))
                    {
                        new location[MAX_ZONE_NAME];
                        GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
                        format(string, sizeof(string), "[DISPATCH]: %s has reported a crime: %s.| TRACE: %s | PHONE: %d |", GetName(playerid), Player[playerid][ActiveCrimeReport], location, Player[playerid][PhoneN]);

                        for(new i = 0; i < MAX_PLAYERS; i++)
                        {
                            if(IsPlayerConnectedEx(i))
                            {
                                if(Groups[Player[i][Group]][CommandTypes] == 1 && Player[i][CopDuty] == 1)
                                {
                                    SendClientMessage(i, RED, string);
                                }
                            }
                        }
                       
                        format(string, sizeof(string), "Thank you for reporting %s. The situation will be investigated!");
                        SendClientMessage(playerid, WHITE, string);
                        Player[playerid][CellphoneConsole] = -1;
                        Player[playerid][NineOneOneStep] = 0;
                       
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
                    }
                    else
                    {
                        Player[playerid][CellphoneConsole] = -1;
                        Player[playerid][NineOneOneStep] = 0;
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
                        SendClientMessage(playerid, WHITE, "Name not recognized on the database of LS Citizens.");
                    }
                }
                case 10:
                {
                    if(strlen(text) >= 1)
                    {
                        new location[MAX_ZONE_NAME];
                        GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
                        SendClientMessage(playerid, WHITE, "Thank you for calling. A unit will be dispatched shortly!");
                        Player[playerid][CellphoneConsole] = -1;
                        Player[playerid][NineOneOneStep] = 0;
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
                        format(string, sizeof(string), "[LSFMD]: %s has reported: %s.| TRACE: %s | PHONE: %d |", GetName(playerid), text, location, Player[playerid][PhoneN]);

                        for(new i = 0; i < MAX_PLAYERS; i++)
                        {
                            if(IsPlayerConnectedEx(i))
                            {
                                if(Groups[Player[i][Group]][CommandTypes] == 3 && Player[i][MedicDuty] == 1)
                                {
                                    SendClientMessage(i, RED, string);
                                }
                            }
                        }
                    }
                    else
                    {
                        Player[playerid][CellphoneConsole] = -1;
                        Player[playerid][NineOneOneStep] = 0;
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
                    }
                }
            }
        }

        if(Player[playerid][CellphoneConsole] != 544)
        {
            format(string, sizeof(string), "[Phone] %s says: %s", GetName(playerid), text);
            NearByMessage(playerid, GREY, string);
            SendClientMessage(Player[playerid][CellphoneConsole], GREY, string);
            ICChatLog(string);
        }
        else
        {
            new txtstr[128];
            format(txtstr, sizeof(txtstr), "[Phone] %s says: %s", GetName(playerid), text);
            NearByMessage(playerid, GREY, txtstr);
            ICChatLog(string);

            switch(Player[playerid][TaxiJob])
            {
                case 0:
                {
                    if(strlen(text) >= 1)
                    {
                        Player[playerid][TaxiJob] = 1;
                        format(Player[playerid][ActiveTaxiReport], 255, "%s", text);
                        SendClientMessage(playerid, WHITE, "Operator says: Please state your desired destination.");
                        NearByMessage(playerid, GREY, txtstr);
                    }
                    else
                    {
                        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
                        Player[playerid][CellphoneConsole] = -1;
                        Player[playerid][TaxiJob] = 0;
                    }
                }
                case 1:
                {
                    new location[MAX_ZONE_NAME];
                    GetPlayer2DZone(playerid, location, MAX_ZONE_NAME);
                    format(string, sizeof(string), "[TAXICALL: NAME: %s | DESTINATION: %s | TRACE: %s | PHONE: %d ]", GetName(playerid), Player[playerid][ActiveTaxiReport], location, Player[playerid][PhoneN]);
                    for(new i = 0; i < MAX_PLAYERS; i++)
                    {
                        if(IsPlayerConnectedEx(i))
                        {
                            if(Groups[Player[i][Group]][CommandTypes] == 12 && Player[i][TaxiDuty] == 1)
                            {
                                    SendClientMessage(i, GREEN, string);
                            }
                        }
                    }
                    format(string, sizeof(string), "Operator says: Thank you for calling %s. All taxi drivers have been notified.");
                    SendClientMessage(playerid, GREY, string);
                    Player[playerid][CellphoneConsole] = -1;
                    Player[playerid][TaxiJob] = 0;
                    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE);
                }
            }
        }
    }

Explanation: The [DISPATCH] doesn't shows up for the LSPD members, while anything that I speak in the call shows up 3 times..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)