14.01.2010, 16:23
I've got the dialog working, but this (in OnDialogResponse) takes the money, but doesn't spawn the Club.
Here's the rest of my code:
(At top of script
(In OnPlayerCommandText
Код:
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!"); } } } }
(At top of script

Код:
new Float:SpawnCarX, Float:SpawnCarY, Float:SpawnCarZ, Float:SpawnCarAngle;

Код:
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; }