Something wrong? -
NealPeteros - 21.07.2016
Hi guys need help. Got unknown errors. Here's the errors
PHP код:
(6669) : error 029: invalid expression, assumed zero
(6669) : warning 215: expression has no effect
(6669) : error 001: expected token: ";", but found "if"
(15053) : error 029: invalid expression, assumed zero
(15053) : warning 215: expression has no effect
(15053) : error 001: expected token: ";", but found "if"
(15053) : error 036: empty statement
(15053) : fatal error 107: too many error messages on one line
Here are the lines
6669
PHP код:
else if(IsAnAmbulance(vehicleid))
{
if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
if(LSFMDVehicles[13] == vehicleid && PlayerInfo[playerid][pRank] < 5)
{
RemovePlayerFromVehicle(playerid);
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz);
NOPCheck(playerid);
SendClientMessageEx(playerid, COLOR_GRAD2, "Only ranks 5+ can drive this vehicle.");
}
}
15053
PHP код:
else if(IsAnAmbulance(vehicleid));
{
if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
if(LSFMDVehicles[13] == vehicleid && PlayerInfo[playerid][pRank] < 5)
{
RemovePlayerFromVehicle(playerid);
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz);
NOPCheck(playerid);
SendClientMessageEx(playerid, COLOR_GRAD2, "Only ranks 5+ can drive this vehicle.");
}
}
else
{
SendClientMessageEx(playerid,COLOR_GREY," You are not in the LSFMD!");
RemovePlayerFromVehicle(playerid);
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz);
NOPCheck(playerid);
}
}
Re: Something wrong? -
NealPeteros - 21.07.2016
Need help, please
Re: Something wrong? -
Threshold - 21.07.2016
I can't see anything wrong with the top code, but your bottom code:
pawn Код:
else if(IsAnAmbulance(vehicleid));
Remove the ';' from the end of the line. Can you show the code above line 6669? The error could possibly be above that, otherwise it may be an issue with your 'IsAnAmbulance' function. Does this occur anywhere else in the script?
Re: Something wrong? -
NealPeteros - 21.07.2016
Here's the code on top of the 6669
pawn Код:
if(!ispassenger)
{
SetPlayerArmedWeapon(playerid, 0);
/* else if(IsAPizzaCar(vehicleid))
{
if(PlayerInfo[playerid][pJob] != 21 && PlayerInfo[playerid][pJob2] != 21)
{
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz+1.3);
PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
RemovePlayerFromVehicle(playerid);
NOPCheck(playerid);
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a Pizza Boy!");
}
}*/
else if(IsAnAmbulance(vehicleid))
{
if(PlayerInfo[playerid][pMember] == 4||PlayerInfo[playerid][pLeader] == 4)
{
if(LSFMDVehicles[13] == vehicleid && PlayerInfo[playerid][pRank] < 5)
{
RemovePlayerFromVehicle(playerid);
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz);
NOPCheck(playerid);
SendClientMessageEx(playerid, COLOR_GRAD2, "Only ranks 5+ can drive this vehicle.");
}
}
else
{
SendClientMessageEx(playerid,COLOR_GREY," You are not in the LSFMD!");
RemovePlayerFromVehicle(playerid);
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz);
NOPCheck(playerid);
}
}
And I don't know what you mean by " Does this occur anywhere else in the script? "
Re: Something wrong? -
NealPeteros - 21.07.2016
Removed the ";". Got errors
PHP код:
(6669) : error 029: invalid expression, assumed zero
(6669) : warning 215: expression has no effect
(6669) : error 001: expected token: ";", but found "if"
(15053) : error 029: invalid expression, assumed zero
(15053) : warning 215: expression (15053) : error 001: expected token: ";", but found "if"
Re: Something wrong? -
NealPeteros - 21.07.2016
Is it the script or is it the function?
Re: Something wrong? -
Sew_Sumi - 21.07.2016
It's how your doing it that is the issue.
PHP код:
if(!ispassenger)
{
SetPlayerArmedWeapon(playerid, 0);
/* else if(IsAPizzaCar(vehicleid))
{
if(PlayerInfo[playerid][pJob] != 21 && PlayerInfo[playerid][pJob2] != 21)
{
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz+1.3);
PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
RemovePlayerFromVehicle(playerid);
NOPCheck(playerid);
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a Pizza Boy!");
}
}*/
else if(IsAnAmbulance(vehicleid))
If !ispassenger elseif IsAnAmbulance. I'm sure you want to go through and check your structure overall where these errors are occuring because it's needing to be looked at.
I'm thinking that because you have weird check orders, it will be a buggy check overall.
Definitely to do with the { } and the flow of your code in those areas. This is where indentation, and code folding come in handy in editors.
Re: Something wrong? -
NealPeteros - 21.07.2016
So, is there something I can do to fix it?
Re: Something wrong? -
Sew_Sumi - 21.07.2016
Read through it, step by step.
Code folding in your IDE will help you see if statement issues.
Really, what this comes from, is copying and pasting. You can't just slap things together, hope they compile and expect them to work.
Re: Something wrong? -
Sew_Sumi - 22.07.2016
PHP код:
if(!ispassenger)
{
SetPlayerArmedWeapon(playerid, 0);
/* else if(IsAPizzaCar(vehicleid))
{
if(PlayerInfo[playerid][pJob] != 21 && PlayerInfo[playerid][pJob2] != 21)
{
new Float:slx, Float:sly, Float:slz;
GetPlayerPos(playerid, slx, sly, slz);
SetPlayerPos(playerid, slx, sly, slz+1.3);
PlayerPlaySound(playerid, 1130, slx, sly, slz+1.3);
RemovePlayerFromVehicle(playerid);
NOPCheck(playerid);
SendClientMessageEx(playerid, COLOR_GRAD2, "You are not a Pizza Boy!");
}
}*/
if(IsAnAmbulance(vehicleid))
This will cause the error to stop, but depends on whether the code actually works as intended.