Vehicle dialog problem
#1

I have a personal vehicle system where you can buy a vehicle using a dialog.

When you press "YES" on the dialog you buy the vehicle but when you press "NO" =>Server closed the connection. WHY?

Код:
}
		else
		{
			new id = GetPVarInt(playerid, "DialogValue1");
			if(GetPlayerVehicleAccess(playerid, id) < 1)
			{
				RemovePlayerFromVehicle(playerid);
			}
		}
		return 1;
	}
Код:
case DIALOG_VEHICLE_BUY:
		{
			new vehicleid = GetPVarInt(playerid, "DialogValue1");
			new caption[32], info[256];
			format(caption, sizeof(caption), "Vehicle ID %d", vehicleid);
			format(info, sizeof(info), "This vehicle is for sale ($%d)\nWould you like to buy it?", VehicleValue[vehicleid]);
			ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, caption, info, "Yes", "No");
		}
Reply
#2

Your #define DIALOG_VEHICLE_BUY might be interfering with another filterscript or gamemode.
Make sure you check all your scripts, and there are no dialog IDs that are the same. If you're not sure, try changing #define DIALOG_VEHICLE_BUY to a random number such as 8422. You most likely have two of the same dialog ids.
Reply
#3

I dont have any filterscripts
I replaced DIALOG_VEHICLE_BUY with 8501 but still KICKING Player after press no
Reply
#4

1) Show me where you're using ShowPlayerDialog(playerid, DIALOG_VEHICLE_BUY...

2) Replace your DIALOG_VEHICLE_BUY response with this:
pawn Код:
case DIALOG_VEHICLE_BUY:
{
    if(response)
    {
        new vehicleid = GetPVarInt(playerid, "DialogValue1");
        new caption[32], info[256];
        format(caption, sizeof(caption), "Vehicle ID %d", vehicleid);
        format(info, sizeof(info), "This vehicle is for sale ($%d)\nWould you like to buy it?", VehicleValue[vehicleid]);
        ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, caption, info, "Yes", "No");
        return 1;
    }
    else return 0;
    return 1;
}
EDIT: The error is with your 'dialogid' response. Change the value for 'dialogid' to a random number such as 8523
Reply
#5

I replaced "dialogid" with 8523

Compile results:
Код:
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(1484) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(1500) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(1605) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(1618) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(1740) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(1747) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(1942) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(1992) : error 010: invalid function or declaration
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2078) : error 010: invalid function or declaration
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2080) : warning 205: redundant code: constant expression is zero
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2082) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2086) : warning 205: redundant code: constant expression is zero
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2180) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2186) : warning 205: redundant code: constant expression is zero
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2246) : warning 205: redundant code: constant expression is zero
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2282) : warning 205: redundant code: constant expression is zero
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2296) : warning 205: redundant code: constant expression is zero
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2301) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2310) : warning 205: redundant code: constant expression is zero
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2346) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2349) : warning 205: redundant code: constant expression is zero
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2368) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2371) : warning 205: redundant code: constant expression is zero
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2424) : warning 205: redundant code: constant expression is zero
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2440) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2460) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2470) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2483) : warning 202: number of arguments does not match definition
E:\Documents and Settings\Adrian\Desktop\saveG RPG\filterscripts\avs.pwn(2513) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
P.S.: Im using AVS (Advanced Vehicle System) https://sampforum.blast.hk/showthread.php?tid=276887
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)