Something wrong?
#1

Hi guys need help. Got unknown errors. Here's the errors
PHP код:
(6669) : error 029invalid expressionassumed zero
(6669) : warning 215expression has no effect
(6669) : error 001expected token";"but found "if"
(15053) : error 029invalid expressionassumed zero
(15053) : warning 215expression has no effect
(15053) : error 001expected token";"but found "if"
(15053) : error 036: empty statement
(15053) : fatal error 107too 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:slxFloat:slyFloat:slz;
                    
GetPlayerPos(playeridslxslyslz);
                    
SetPlayerPos(playeridslxslyslz);
                    
NOPCheck(playerid);
                    
SendClientMessageEx(playeridCOLOR_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:slxFloat:slyFloat:slz;
                    
GetPlayerPos(playeridslxslyslz);
                    
SetPlayerPos(playeridslxslyslz);
                    
NOPCheck(playerid);
                    
SendClientMessageEx(playeridCOLOR_GRAD2"Only ranks 5+ can drive this vehicle.");
                }
            }
            else
            {
                
SendClientMessageEx(playerid,COLOR_GREY,"   You are not in the LSFMD!");
                
RemovePlayerFromVehicle(playerid);
                new 
Float:slxFloat:slyFloat:slz;
                
GetPlayerPos(playeridslxslyslz);
                
SetPlayerPos(playeridslxslyslz);
                
NOPCheck(playerid);
            }
        } 
Reply
#2

Need help, please
Reply
#3

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?
Reply
#4

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? "
Reply
#5

Removed the ";". Got errors
PHP код:
(6669) : error 029invalid expressionassumed zero
(6669) : warning 215expression has no effect
(6669) : error 001expected token";"but found "if"
(15053) : error 029invalid expressionassumed zero
(15053) : warning 215expression (15053) : error 001expected token";"but found "if" 
Reply
#6

Is it the script or is it the function?
Reply
#7

It's how your doing it that is the issue.

PHP код:
if(!ispassenger)
    {
        
SetPlayerArmedWeapon(playerid0);
     
/* 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.
Reply
#8

So, is there something I can do to fix it?
Reply
#9

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.
Reply
#10

PHP код:
if(!ispassenger)
    {
        
SetPlayerArmedWeapon(playerid0);
     
/* 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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)