PDA

View Full Version : Need hwelp with dialogs!!


Scrillex
28/03/2015, 09:14 PM
Hello, samp forum members need some help with y_command caller on dialog...
ERROR:

(2356) : error 017: undefined symbol "ycmd_vbuy"
(2360) : error 017: undefined symbol "PriceArray"
(2360) : error 036: empty statement
(2360) : error 017: undefined symbol "i"
(2360) : fatal error 107: too many error messages on one line



CODE:

case dialog_DealershipConfirm:
{
if(!response)
{
SetPlayerPos(playerid, pDlOldPos[playerid][0], pDlOldPos[playerid][1], pDlOldPos[playerid][2]);
DestroyVehicle(pBuyingCar[playerid]);

pBuyingCar[playerid] = 0, pBuyingCarModel[playerid] = 0;
TogglePlayerControllable(playerid, true);

SendClientMessage(playerid, -1, "{8EB2D6}[INFO]{FFFFFF}: Vehicle purchasement cancelled, taking you back to the vehicle dealership menu..");

return ycmd_vbuy(playerid,pramas[],help); // FIRST error!
}
if(response)
{
for (new i; i != sizeof (PriceArray); ++ i) // ALLL THE REST ERRORS!!!
{
if (PriceArray[i][0] == pBuyingCarModel[playerid])
{
if(GetPlayerMoney(playerid) >= PriceArray[i][1])
{
GivePlayerMoney(playerid, -PriceArray[i][1]);
AddPlayerVehicle(playerid, pBuyingCarModel[playerid], PriceArray[0][i]);
}

else if(GetPlayerMoney(playerid) < PriceArray[i][1])
{
SendClientMessage(playerid, -1, "{8EB2D6}[INFO]{FFFFFF}: You don't have enough money!");

SetPlayerPos(playerid, pDlOldPos[playerid][0], pDlOldPos[playerid][1], pDlOldPos[playerid][2]);
DestroyVehicle(pBuyingCar[playerid]);

pBuyingCar[playerid] = 0, pBuyingCarModel[playerid] = 0;
TogglePlayerControllable(playerid, true);

return ycmd_vbuy(playerid,pramas[],help);
}

break;
}
}
PlayerInfo[playerid][CarOwner] = pBuyingCar[playerid];
PutPlayerInVehicle(playerid, pBuyingCar[playerid], 0);
SendClientMessage(playerid, -1, "{8EB2D6}[INFO]{FFFFFF}: You have successfully bought your vehicle! Make sure to repark it!");
TogglePlayerControllable(playerid, true);
}
return 1;
}

Konstantinos
28/03/2015, 09:31 PM
I don't use y_commands but from a look at its thread, it seems like the function you need to call is Command_ReProcess.

Maybe?

Command_ReProcess(playerid, "/vbuy", false)


I couldn't find examples of it.

Scrillex
28/03/2015, 09:34 PM
Yse that worked.. thanks mate ;) Again you saved me from head ache :D

nicholasramdhan
28/03/2015, 09:34 PM
nvm, you solved already lol