Problem with Dialog car spawn.
#8

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == Sportwagen)
	{
		if(response)
			{
				if(listitem == 0)
					{
					new Float:X,Float:Y,Float:Z,Float:Angle, carid;
			  	GetPlayerPos(playerid,X,Y,Z);
			  	GetPlayerFacingAngle(playerid,Angle);
			  	carid = CreateVehicle(541,X,Y,Z,Angle,-1,-1,600);
			  	PutPlayerInVehicle(playerid,carid,0);
			  		TogglePlayerControllable(playerid, 1);
			  	SendClientMessage(playerid, 0x0ffffff, "Auto [Bullet] wurde erfolgreich gespawnt!");
                print("spawn?");
				}
				if(listitem == 1)
		 		{
				 	new Float:X,Float:Y,Float:Z,Float:Angle, carid;
				 	GetPlayerPos(playerid,X,Y,Z);
				  	GetPlayerFacingAngle(playerid,Angle);
				  	carid = CreateVehicle(411,X,Y,Z,Angle,-1,-1,600);
				  	PutPlayerInVehicle(playerid,carid,0);
					TogglePlayerControllable(playerid, 1);
				 	SendClientMessage(playerid, 0x0ffff, "Auto [Infernus] wurde erfolgreich gespawnt!");
                    print("1");
				}
				if(listitem == 2)
		 		{
				 	new Float:X,Float:Y,Float:Z,Float:Angle, carid;
				 	GetPlayerPos(playerid,X,Y,Z);
				  	GetPlayerFacingAngle(playerid,Angle);
				  	carid = CreateVehicle(411,X,Y,Z,Angle,-1,-1,600);
				  	PutPlayerInVehicle(playerid,carid,0);
					TogglePlayerControllable(playerid, 1);
				 	SendClientMessage(playerid, 0x0ffff, "Auto [Infernus] wurde erfolgreich gespawnt!");
                    print("1");
				 }
			}
		}
return 1;
}
you didn't change the numbers in the listitem statements
Код:
if(listitem == 0) {
//Do something
}
if(listitem == 1) {
//Do something
}
if(listitem == 2) {
//Do something
}
yours was

Код:
if(listitem == 0) {
//Do something
}
if(listitem == 0) {
//Do something
}
if(listitem == 0) {
//Do something
}
so all of the same code was being executed when you selected the first item in the list.
Reply


Messages In This Thread
Problem with Dialog car spawn. - by _soad_ - 19.03.2010, 23:26
Re: Problem with Dialog car spawn. - by Torran - 19.03.2010, 23:28
Re: Problem with Dialog car spawn. - by _soad_ - 19.03.2010, 23:30
Re: Problem with Dialog car spawn. - by westre - 19.03.2010, 23:31
Re: Problem with Dialog car spawn. - by Torran - 19.03.2010, 23:33
Re: Problem with Dialog car spawn. - by _soad_ - 19.03.2010, 23:36
Re: Problem with Dialog car spawn. - by westre - 19.03.2010, 23:39
Re: Problem with Dialog car spawn. - by Rattertouille - 19.03.2010, 23:40
Re: Problem with Dialog car spawn. - by _soad_ - 19.03.2010, 23:41
Re: Problem with Dialog car spawn. - by pen_theGun - 20.03.2010, 00:05

Forum Jump:


Users browsing this thread: 1 Guest(s)