Help with a car spawn dialog?
#1

I've got the dialog working, but this (in OnDialogResponse) takes the money, but doesn't spawn the Club.

Код:
	if(dialogid == 2 && response)
	{
	  switch(listitem)
	 {
	 case 0:
	 {
	 if(PlayerInfo[playerid][Cash] <= 2000)
		{
		GivePlayerMoney(playerid, -2000);
		CreateVehicle(589, SpawnCarX, SpawnCarY, SpawnCarZ, SpawnCarAngle, -1, -1, 9999);
		} else {
		SendClientMessage(playerid, COLOR_WHITE, "You need more money, fool!");
		}
	 }
  }
 }
Here's the rest of my code:
(At top of script
Код:
new Float:SpawnCarX, Float:SpawnCarY, Float:SpawnCarZ, Float:SpawnCarAngle;
(In OnPlayerCommandText
Код:
	if (strcmp(cmd, "/car", true) == 0)
	{
			GetPlayerPos(playerid, SpawnCarX, SpawnCarY, SpawnCarY);
			GetPlayerFacingAngle(playerid, SpawnCarAngle);
	ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Spawnable Cars", "Club ($2000)\nFlash ($2500)\nSultan ($5000)\nJester ($7500)", "Purchase", "Cancel");
	return 1;
	}
Reply
#2

Anyone?
Reply
#3

Why are you spawning a vehicle with -1, -1 colours?
"CreateVehicle(589, SpawnCarX, SpawnCarY, SpawnCarZ, SpawnCarAngle, -1, -1, 9999);"
Reply
#4

Random colors.
Reply
#5

You have

pawn Код:
GetPlayerPos(playerid, SpawnCarX, SpawnCarY, SpawnCarY);
but should be

pawn Код:
GetPlayerPos(playerid, SpawnCarX, SpawnCarY, SpawnCarZ);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)