dialog shop buying even when u decline,
#2

you forgot to test for any response:
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	GetPlayerPos(playerid, X,Y,Z);
	GetPlayerFacingAngle(playerid,Angle);
	gINT = GetPlayerInterior(playerid);
	if( dialogid == 1 ) //shop
	{
		if(response)
		{
			switch(listitem)
			{
				case 0:
				{
					if(GetPlayerMoney(playerid) >= 50000)
					{
						GivePlayerMoney(playerid,-50000);
						CreateVehicle(520, X+6,Y,Z+1, Angle, random(127), random(127), -1); LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);
						TogglePlayerControllable(playerid, true);
					}
					else
					{
						SendClientMessage(playerid,oranje,"Server: You don't have 50.000!");
						TogglePlayerControllable(playerid, true);
					}
				}
		 		case 1:
				{
					if(GetPlayerMoney(playerid) >= 60000)
					{
						GivePlayerMoney(playerid,-60000);
						CreateVehicle(432, X,Y+4,Z+1, Angle, random(127), random(127), -1); LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);
						TogglePlayerControllable(playerid, true);
					}
					else
					{
						SendClientMessage(playerid,oranje,"Server: You don't have 60.000!");
						TogglePlayerControllable(playerid, true);
					}
				}
				case 2:
				{
					if(GetPlayerMoney(playerid) >= 75000)
					{
						GivePlayerMoney(playerid,-75000);
						CreateVehicle(425, X+6,Y,Z+1, Angle, random(127), random(127), -1); LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);
						TogglePlayerControllable(playerid, true);
					}
					else
					{
						SendClientMessage(playerid,oranje,"Server: You don't have 75.000!");
						TogglePlayerControllable(playerid, true);
					}
				}
				case 3:
				{
					if(GetPlayerMoney(playerid) >= 30000)
					{
						GivePlayerMoney(playerid,-30000);
						CreateVehicle(601, X+6,Y,Z+1, Angle, random(127), random(127), -1); LinkVehicleToInterior(GetPlayerVehicleID(playerid),gINT);
						TogglePlayerControllable(playerid, true);
					}
					else
					{
						SendClientMessage(playerid,oranje,"Server: You don't have 30.000!");
						TogglePlayerControllable(playerid, true);
					}
				}
				case 4:
				{
					if(GetPlayerMoney(playerid) >= 10000)
					{
						GivePlayerWeapon(playerid, 35, 10);
						GivePlayerMoney(playerid,-10000);
						TogglePlayerControllable(playerid, true);
					}
					else
					{
						SendClientMessage(playerid,oranje,"Server: You don't have 10.000!");
						TogglePlayerControllable(playerid, true);
					}
				}
				case 5:
				{
					if(GetPlayerMoney(playerid) >= 7500)
					{
						SetPlayerHealth(playerid, 100);
						GivePlayerMoney(playerid,-7500);
						TogglePlayerControllable(playerid, true);
					}
					else
					{
						SendClientMessage(playerid,oranje,"Server: You don't have 7.500!");
						TogglePlayerControllable(playerid, true);
					}
				}
				case 6:
				{
					if(GetPlayerMoney(playerid) >= 10000)
					{
						SetPlayerArmour(playerid, 99);
						GivePlayerMoney(playerid,-10000);
						TogglePlayerControllable(playerid, true);
					}
					else
					{
						SendClientMessage(playerid,oranje,"Server: You don't have 10.000!");
						TogglePlayerControllable(playerid, true);
					}
				}
			}
		}
		else
		{
			SendClientMessage(playerid,oranje,"You have closed the V.I.P Shop!");
		}
	}
	return 1;
}
Reply


Messages In This Thread
dialog shop buying even when u decline, - by ~Dangun! - 02.02.2010, 13:27
Re: dialog shop buying even when u decline, - by Babul - 02.02.2010, 16:06

Forum Jump:


Users browsing this thread: 1 Guest(s)