Buy boat command
#1

Hey guys I started editing a sell boat command and I was wondering how to deal with its dialog. So to make it simple, my script has a /buyboat command when I enter it it pops me another script dialog. Which i dont want to see. Any idea on how to create a new dialog for those six boats im trying to sell. Thanks so much , here's the script

Код:
CMD:buyboat(playerid, params[])
{
	new string[128];
   	if(!IsPlayerLoggedIn(playerid) || PlayerInfo[playerid][pAsshole] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use command.");
	if(!IsPlayerInRangeOfPoint(playerid, 10, 830.0919,-2061.3379,12.8672)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the boat dealership.");
	//if(PlayerInfo[playerid][pVIP] >= 2)
	//{
		if(PlayerInfo[playerid][vModel] && PlayerInfo[playerid][vVModel])
		{
			format(string, sizeof(string), "You already own  ID %d and %d.", PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVVeh]);
			SendClientMessage(playerid, COLOR_GREY, string);
		    return 1;
		}
		else ShowDialog(playerid, 37);
	    return 1;
	/*}
	if(PlayerInfo[playerid][vModel])
	{
		format(string, sizeof(string), "You already own vehicle ID %d.", PlayerInfo[playerid][pVeh]);
		SendClientMessage(playerid, COLOR_GREY, string);
	    return 1;
	}
	ShowDialog(playerid, 37);
	return 1;*/
}
Код:
else if(dialogid == 37) // Boats
	{
	    new string[128], carid, price;
	    if(response)
	    {
	        switch(listitem)
	        {
	            case 0: {carid = 446; price = 25000;} 
	            case 1: {carid = 452; price = 35000;} 
	            case 2: {carid = 453; price = 30000;} 
	            case 3: {carid = 454; price = 25000;} 
	            case 4: {carid = 472; price = 27000;}
	            case 5: {carid = 473; price = 24000;} 
	            case 6: {carid = 484; price = 30000;} 
	            case 7: {carid = 493; price = 30000;} 
	        }
	        if(price > PlayerInfo[playerid][pMoney]) return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money on you.");
            GiveDodMoney(playerid, -price);
         	format(string, sizeof(string), " You have purchased a %s. (Unlock it using /lock)", RVN(carid));
            ++PlayerCars;
			SendClientMessage(playerid, COLOR_GREEN, string);
	        //if(PlayerInfo[playerid][pVIP] >= 2 && PlayerInfo[playerid][vModel])
	        if(PlayerInfo[playerid][vModel])
	        {
	            PlayerInfo[playerid][pVVeh] = CreateVehicle(carid, 826.8421,-2078.9644,-0.1015,87.8349,0,0,1200);
		        SetVehicleParamsEx(PlayerInfo[playerid][pVVeh], 0, 0, 0, 1, 0, 0, 0);
		        PlayerInfo[playerid][vVLocked] = 1;
		        PlayerInfo[playerid][vVModel] = carid;
				GetVehiclePos(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVX], PlayerInfo[playerid][vVY], PlayerInfo[playerid][vVZ]);
				GetVehicleZAngle(PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][vVA]);
				PlayerInfo[playerid][vVC1] = 0;
				PlayerInfo[playerid][vVC2] = 0;
				return 1;
	        }
	        PlayerInfo[playerid][pVeh] = CreateVehicle(carid, 826.8421,-2078.9644,-0.1015,87.8349,0,0,1200);
	        SetVehicleParamsEx(PlayerInfo[playerid][pVeh], 0, 0, 0, 1, 0, 0, 0);
	        PlayerInfo[playerid][vLocked] = 1;
	        PlayerInfo[playerid][vModel] = carid;
			GetVehiclePos(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vX], PlayerInfo[playerid][vY], PlayerInfo[playerid][vZ]);
			GetVehicleZAngle(PlayerInfo[playerid][pVeh], PlayerInfo[playerid][vA]);
			PlayerInfo[playerid][vC1] = 0;
			PlayerInfo[playerid][vC2] = 0;
	    }
	}
I have no idea what dialog 37 is in my script. How can I get it to refer to another dialog ? thanks sooo much !
Reply
#2

Maybe you can change Dialog ID like 37 to 137 ... and maybe your Dialog ID same as Another Dialog id ?
Reply
#3

Try returning 0 on OnDialogResponse. This will then not conflict any other dialogs from other scripts.
Reply
#4

Thansk for your quick reply guys, i tried what you says and returned 0 for the dialog, also changed the dialog id to 440 which doesnt exist. When i try the command it says i aint at the boat dealership. when i get to the boat dealership, I dont get any messages and the dialog box doesnt appear.. Im going crazy
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)