dialog response to every pickup!
#1

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{

    {
    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5500$\n\nWeapons\nDeathmatch stadium\nRunnies Deathmatch", "Select", "Cancel");
    }
	return 1;
}

stock ShowDialog(playerid)
{
      ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5500$\n\nWeapons\nDeathmatch stadium\nRunnies Deathmatch", "Select", "Cancel");
return 1;
}

	
	//Briefcases Aka Weapon Shopes

	 CreatePickup(1210,2,-148.4453,1110.0249,19.7500, -1);
	 CreatePickup(1210, 2, -297.04, 1537.17, 75.56);
	 CreatePickup(1210, 2, 284.25, 1923.62, 17.64);
	 CreatePickup(1210,2,-797.5327,1556.2026,27.1244, -1);
	 CreatePickup(1210,2,1146.6642,1976.5652,10.8203, -1);
     CreatePickup(1210, 2, -1463.82, 2613.76, 62.06);
	 CreatePickup(1210,2,-252.4021,2603.1230,62.8582, -1); //usa pickup
how to fix it? whenever i go to a weapon pickup,money bag pickup etc it shows me the dialog..
Reply
#2

Try this Plan
Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(IsPlayerInRangeOfPoint(playerid,5.0,-148.4453,1110.0249,19.7500))
		{
                    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Briefcase", "Health - 5000$\nArmour - 5500$\n\nWeapons\nDeathmatch stadium\nRunnies Deathmatch", "Select", "Cancel");
		    return 1;
		}

else if(IsPlayerInRangeOfPoint(playerid,5.0,-797.5327,1556.2026,27.1244))
               {
                    //Dialog
		    return 1;
		}
else if(IsPlayerInRangeOfPoint(playerid,5.0,1146.6642,1976.5652,10.8203))
               {
                    // another Dialog
		    return 1;
		}
	return 1;
}
Reply
#3

@TunisianoGamer; Whenever they close the dialog, they pickup again the pickup and they are in range - thus it will show the dialog again.

pawn Код:
// Global variable
new
    bool: In_Pickup[ MAX_PLAYERS ]
;

// OnPlayerConnect:
In_Pickup[ playerid ] = false;

public OnPlayerPickUpPickup( playerid, pickupid )
{
    switch( pickupid )
    {
        case YOU_PICKUP_THAT_SHOWS_THE_DIALOG:
        {
            if( IsPlayerInRangeOfPoint( playerid, 1.0, X, Y, Z ) ) // CHANGE THE COORDINATES
            {
                if( !In_Pickup[ playerid ] )
                {
                    In_Pickup[ playerid ] = true;
                    ShowPlayerDialog( ... );
                }
            }
            else
            {
                if( In_Pickup[ playerid ] ) In_Pickup[ playerid ] = false;
            }
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)