OnDialogResponse problem
#1

Hi,

When a player enter to a private vehicle, he/she need to enter a password to use the vehicle.

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    ...
    ShowPlayerDialog(playerid, DIALOG_HOUSE_VEHICLE_PASS, DIALOG_STYLE_PASSWORD, "{FF0000}Enter password", "To use this car, you had to enter the car's password.\n\r{FFFF00}Enter password:", "Ok", "Cancel");
}
When the player enters something and click the "Ok" button everything is okey. But if the player clicks to the "Cancel" buttom, the OnDialogResponse() function runs fine, but when the player leaves the server, the game crashes.

Код:
if(dialogid == DIALOG_HOUSE_VEHICLE_PASS)
{
    if(response == 0) // it runs fine in game, but when I leave the game crashes
    {
        SendClientMessage(playerid, COLOR_RED, "Cancelled.");
        PlayerInfo[playerid][PlayerEnteredVehicle] = 0;
        return 1;
    }
    ...
    // here the server checks that, the password is correct or not
    return 1;
}
I'm sure in that the PlayerInfo[] enumerated type have the PlayerEnteredVehicle field.

Can anybody help me? Thank you,


Zuckerman
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)