029:Invalid expression,assumed zero. "else" - 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: 029:Invalid expression,assumed zero. "else" (
/showthread.php?tid=541712)
029:Invalid expression,assumed zero. "else" -
weedxd - 13.10.2014
Why is "else" marked as an invlaid expression ?
PHP код:
(23530) : error 029: invalid expression, assumed zero
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
if(g_var[playerid] == 0 && IsPlayerInRangeOfPoint(playerid, 5, 2789.6619, -2517.8105, 16.1509))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not inside a vehicle.");
{
>>>>> else
{
DisablePlayerCheckpoint(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
new string[128], amount;
amount = 100+random(300);
format(string, sizeof(string), "*You've earned {FF6347}$%d{33CCFF} from dropping a car!", amount);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GiveDodMoney(playerid, amount);
SetVehicleToRespawn(vehicleid);
g_var[playerid] = 1;
SetTimerEx("CountDown",1200*1000, false, "d", playerid);
}
}
}
Re: 029:Invalid expression,assumed zero. "else" -
]Rafaellos[ - 13.10.2014
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(g_var[playerid] == 0 && IsPlayerInRangeOfPoint(playerid, 5, 2789.6619, -2517.8105, 16.1509))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You are not inside a vehicle.");
new
amount = random(300) + 100,
string[128]
;
DisablePlayerCheckpoint(playerid);
format(string, sizeof(string), "*You've earned {FF6347}$%d{33CCFF} from dropping a car!", amount);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GiveDodMoney(playerid, amount);
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
g_var[playerid] = 1;
SetTimerEx("CountDown", 1200 * 1000, false, "d", playerid);
}
return 1;
}
Re: 029:Invalid expression,assumed zero. "else" -
Thanos1997 - 13.10.2014
probably it should be like this
Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(g_var[playerid] == 0 && IsPlayerInRangeOfPoint(playerid, 5, 2789.6619, -2517.8105, 16.1509))
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER)
{
SendClientMessage(playerid, COLOR_GREY, "You are not inside a vehicle.");
}
>>>>> else
{
DisablePlayerCheckpoint(playerid);
new vehicleid = GetPlayerVehicleID(playerid);
new string[128], amount;
amount = 100+random(300);
format(string, sizeof(string), "*You've earned {FF6347}$%d{33CCFF} from dropping a car!", amount);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
GiveDodMoney(playerid, amount);
SetVehicleToRespawn(vehicleid);
g_var[playerid] = 1;
SetTimerEx("CountDown",1200*1000, false, "d", playerid);
}
}
}
Re: 029:Invalid expression,assumed zero. "else" -
weedxd - 13.10.2014
Thank you Thanos it helped
+Rep