Dialog not responding + some questions.
#1

Hi,

I have a dialog to pay the police ticket, everything works fine but its not responding when player click "Pay" button. But its responding when they click "Cancel" button. I made a test FS to check if other dialogs aren't responding as well or not and they too didn't respond. I am pretty sure its not the script fault cause some old dialogs that i had scripted in the same way are working fine but its not working for newly added dialogs. If i make a /pay command with the same scripts, it works fine.

pawn Код:
if(dialogid == DIALOG_TICKET)
{
    new
        str[100],
        Fines
    ;
   
    if(!response)
    {
        format(str, sizeof(str), "Suspect %s did not pay the ticket. You can jail him now.", GetName(playerid));
        SendClientMessage(pInfo[playerid][TicketingID], RED, str);
        SendClientMessage(playerid, RED, "You didn't pay the fine, police are able to jail you!");
        KillTimer(pInfo[playerid][Timer_PoliceCanJailMe]);
        pInfo[playerid][Ticketed] = false;
        pInfo[playerid][PoliceWarnedMe] = false;
        SetJobText(playerid);
        pInfo[playerid][PoliceCanJailMe] = true;
    }
    if(response)
    {
        if(pInfo[playerid][Ticketed] == true)
        {
            Fines = GetPlayerWantedLevel(playerid) * DefaultFinePerStar;
            RewardPlayer(pInfo[playerid][TicketingID], Fines, GetPlayerWantedLevel(playerid));
            format(str, 80, "%s has paid the ticket of $%i", GetName(playerid), Fines);
            SendClientMessage(pInfo[playerid][TicketingID], BLUE, str);
            RewardPlayer(playerid, -Fines, 0);
            RewardPlayer(pInfo[playerid][TicketingID], Fines, 0);
            format(str, 80, "You have paid the ticket of $%i to Officer %s", Fines, GetName(pInfo[playerid][TicketingID]));
            SendClientMessage(playerid, RED, str);
            SetJobText(playerid);
            pInfo[pInfo[playerid][TicketingID]][StatsPoliceFined]++;
            SetPlayerWantedLevel(playerid, 0);
            if(pInfo[playerid][WantedID] == playerid)
            {
                pInfo[playerid][TicketingID] = 0;
                pInfo[playerid][WantedID] = 0;
            }
            pInfo[playerid][Ticketed] = false;
            pInfo[playerid][PoliceWarnedMe] = false;
            KillTimer(pInfo[playerid][Timer_PoliceCanJailMe]);
            PlayerFile_Save(pInfo[playerid][TicketingID]);
            PlayerFile_Save(playerid);
        }
    }
    return 1;
}
Dialog is defined as #define DIALOG_TICKET 742

And another problem is, i have set
pawn Код:
if(IsPlayerConnected(targetid))
{
    //do stuffs here
}
else
    return SendClientMessage(playerid, 0xFF0000FF, "Player is not connected1");
in all of my commands and sometimes when player reconnects to the server it says "Player is not connected" even if they are, while using all the commands on the selected players. I have latest version of sscanf so what else could be the reason?
Reply
#2

/Bump

Sorry for bumping faster, but i need to fix it. Someone help.
Reply
#3

is it sending this message format(str, sizeof(str), "Suspect %s did not pay the ticket. You can jail him now.", GetName(playerid));?
Reply
#4

Yes its sending. The cancel button is respondin but not the Pay button.
Reply
#5

then the problem is this if(pInfo[playerid][Ticketed] == true)
remove this
  • if a player is viewing pay ticket dialog that means he has ticket to pay ofc
    then why check that he is ticketed or not
  • and there is some problem with pInfo[playerid][Ticketed] too either its not a bool or you are not setting it it to true properly
Reply
#6

Have you set
pawn Код:
if(pInfo[playerid][Ticketed] == true)
to the target when the cop gives him a ticket?
Reply
#7

Well, i am not a noob at making a boolean var. as i said, i made a test fs to check if the dialog responses or not and it didn't. I had set 2 messages with cancel and ok button but they both didn't work. Same scripted stuff is working with old dialog, and i believe that i haven't reach the max dialog limit. But still, i will try to remove the true statement from the dialog and see if it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)