How to fix this error ? - 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)
+--- Thread: How to fix this error ? (
/showthread.php?tid=490831)
How to fix this error ? -
barts - 28.01.2014
PHP код:
CMD:buycar(playerid, params[])
{
new string[128], vslot;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsPlayerInRangeOfPoint(playerid, 2, -135.0201,1116.2260,20.1966)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the vehicles dealership.");
if(PlayerInfo[playerid][vModel] && PlayerInfo[playerid][vVModel] && PlayerInfo[playerid][vVVModel])
{
format(string, sizeof(string), "You already own vehicles ID %d and %d and %d.", PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][pVVVeh]);
SendClientMessage(playerid, COLOR_GREY, string);
}
if(sscanf(params, "i", vslot)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /buycar [slot]");
if(vslot < 1 || vslot > 3) return SendClientMessage(playerid, COLOR_WHITE, "There are only 3 slots");
switch(vslot)
{
case 1: Wannabuycarinslot[playerid] = 1;
case 2: Wannabuycarinslot[playerid] = 2;
case 3: Wannabuycarinslot[playerid] = 3;
}
else SSSShowDialog(playerid, 10);
return 1;
}
Error line: else SSSShowDialog(playerid, 10);
Error:
error 029: invalid expression, assumed zero
Re: How to fix this error ? -
Konstantinos - 28.01.2014
pawn Код:
CMD:buycar(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsPlayerInRangeOfPoint(playerid, 2, -135.0201,1116.2260,20.1966)) return SendClientMessage(playerid, COLOR_GREY, "You are not near the vehicles dealership.");
if(PlayerInfo[playerid][vModel] && PlayerInfo[playerid][vVModel] && PlayerInfo[playerid][vVVModel])
{
new string[64]
format(string, sizeof(string), "You already own vehicles ID %d and %d and %d.", PlayerInfo[playerid][pVeh], PlayerInfo[playerid][pVVeh], PlayerInfo[playerid][pVVVeh]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
new vslot;
if(sscanf(params, "i", vslot)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /buycar [slot]");
if(vslot < 1 || vslot > 3) return SendClientMessage(playerid, COLOR_WHITE, "There are only 3 slots");
Wannabuycarinslot[playerid] = vslot;
SSSShowDialog(playerid, 10);
return 1;
}