Help with a car spawn dialog? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with a car spawn dialog? (
/showthread.php?tid=121014)
Help with a car spawn dialog? -
jameskmonger - 14.01.2010
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;
}
Re: Help with a car spawn dialog? -
jameskmonger - 14.01.2010
Anyone?
Re: Help with a car spawn dialog? -
Badger(new) - 14.01.2010
Why are you spawning a vehicle with -1, -1 colours?
"CreateVehicle(589, SpawnCarX, SpawnCarY, SpawnCarZ, SpawnCarAngle, -1, -1, 9999);"
Re: Help with a car spawn dialog? -
ettans - 14.01.2010
Random colors.
Re: Help with a car spawn dialog? -
MadeMan - 14.01.2010
You have
pawn Код:
GetPlayerPos(playerid, SpawnCarX, SpawnCarY, SpawnCarY);
but should be
pawn Код:
GetPlayerPos(playerid, SpawnCarX, SpawnCarY, SpawnCarZ);