19.03.2010, 23:26
Hey,
i've made a little car spawner with Dialog.
But i can open the Dialog, but i cant spawn the car after choose.
See my code:
There i Open the Dialog
And now the list:
And when i chose some of the list, its not print.
Its print on the GameMode start and when i open the Dialog.
Pls help me :>
i've made a little car spawner with Dialog.
But i can open the Dialog, but i cant spawn the car after choose.
See my code:
pawn Код:
#define Sportwagen 0
pawn Код:
if (PRESSED(KEY_ANALOG_LEFT))
{
ShowPlayerDialog(playerid, Sportwagen, DIALOG_STYLE_LIST, "Such dir einen Wagen heraus", "Infernus\nBullet\nTurismo", "Auswдhlen", "SchlieЯen");
print("Open dialog");
}
pawn Код:
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 == 0)
{
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 == 0)
{
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;
}
Its print on the GameMode start and when i open the Dialog.
Pls help me :>