Invalid expression, assumed zero - 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: Invalid expression, assumed zero (
/showthread.php?tid=263933)
Invalid expression, assumed zero -
Jack_Leslie - 24.06.2011
I get the error on this code:
PHP код:
if(strcmp(cmd,"/csrepair",true)==)
{
if(IsPlayerInRangeOfPoint(playerid,1,624.725952, -22.463268, 1002.037719))
{
if(PlayerInfo[playerid][pJob] == 7 && JobDuty[playerid] == 0)
{
new vehid = GetPlayerVehicleID(playerid);
if(vehid && PlayerInfo[playerid][pJob] == 7 && JobDuty[playerid] == 1)
{
RepairVehicle(vehid);
format(string, sizeof(string), "* %s uses his utilities to repair the vehicle.", sendername);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else {
SendClientMessage(playerid,COLOR_YELLOW,"[Chop Shop] You aren't in a Vehicle to repair!");
return 1;
}
else {
SendClientMessage(playerid,COLOR_YELLOW,"[Chop Shop] You are not On-Duty at the Chop Shop!");
return 1;
}
else {
SendClientMessage(playerid,COLOR_YELLOW,"[Chop Shop] You aren't at the Repair Spot!");
return 1;
}
}
}
return 1;
}
At every else { }
Re: Invalid expression, assumed zero -
Jack_Leslie - 24.06.2011
Urgent.
Re: Invalid expression, assumed zero -
[MG]Dimi - 24.06.2011
pawn Код:
if(strcmp(cmd,"/csrepair",true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid,1,624.725952, -22.463268, 1002.037719))
{
if(PlayerInfo[playerid][pJob] == 7 && JobDuty[playerid] == 0)
{
new vehid = GetPlayerVehicleID(playerid);
if(vehid && PlayerInfo[playerid][pJob] == 7 && JobDuty[playerid] == 1)
{
RepairVehicle(vehid);
format(string, sizeof(string), "* %s uses his utilities to repair the vehicle.", sendername);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[Chop Shop] You aren't in a Vehicle to repair!");
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[Chop Shop] You are not On-Duty at the Chop Shop!");
return 1;
}
return 1;
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"[Chop Shop] You aren't at the Repair Spot!");
return 1;
}
return 1;
}
You would get loose indentitation with your code but I fixed it and you forgot == 0 at command strcmp
Re: Invalid expression, assumed zero -
Jack_Leslie - 24.06.2011
Thankyou