Error, why? omg
#1

hello. i am getting a " invalid expression, assumed zero", on this code. on the last ELSE line.

could you please tell me whats wrong?


Код:
{
    			    new form[128];
    				new vehicle = GetPlayerVehicleID(i);
    				new Float: Speed;
    				Speed = GetSpeed(i);
    				if(!OutOfFuel[i])
    				{
	    				if(Fuel[vehicle] <= 25)
	    				{
	    				    if(EngineStatus[vehicle])
	    				    {
	  					        
								if(Speed > 0)
	  					        {
		   	    					format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~Gdeposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
			    					GameTextForPlayer(i,form,1000,5);
								}
	    				    }
	    				    else
	    				    {
	   	    					format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~deposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
		    					GameTextForPlayer(i,form,1000,5);
	    				    }
	    				}
	  					else
	  					{
	  					    if(EngineStatus[vehicle])
	  					    {
	  					        
								if(Speed > 0)
	  					        {
			  						format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~deposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
			  						GameTextForPlayer(i,form,1000,5);
								}
	  						}
	  						else
	  						{
	  							format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~deposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
		  						GameTextForPlayer(i,form,1000,5);


							}

						//here	else
 							{
	  							format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor desligado.~n~~w~Combustivel:~g~ %d%    ",Fuel[vehicle],GetSpeedKM(i));
		  						GameTextForPlayer(i,form,1000,5);
	  						}
						  }
  					}
  				}
Reply
#2

whats %d% over there?
Reply
#3

pawn Код:
new form[128];
                    new vehicle = GetPlayerVehicleID(i);
                    new Float: Speed;
                    Speed = GetSpeed(i);
                    if(!OutOfFuel[i])
                    {
                        if(Fuel[vehicle] <= 25)
                        {
                            if(EngineStatus[vehicle])
                            {
                               
                                if(Speed > 0)
                                {
                                    format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~Gdeposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
                                    GameTextForPlayer(i,form,1000,5);
                                }
                            }
                            else
                            {
                                format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~deposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
                                GameTextForPlayer(i,form,1000,5);
                            }
                        }
                        else
                        {
                            if(EngineStatus[vehicle])
                            {
                               
                                if(Speed > 0)
                                {
                                    format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~deposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
                                    GameTextForPlayer(i,form,1000,5);
                                }
                            }
                            else
                            {
                                format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~deposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
                                GameTextForPlayer(i,form,1000,5);


                           
                                                        }
                                else
                            {
                                format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor desligado.~n~~w~Combustivel:~g~ %d%    ",Fuel[vehicle],GetSpeedKM(i));
                                GameTextForPlayer(i,form,1000,5);
                            }
                          }
                    }
                }
Try this and tell, it MAY work

EDIT: JUST MOVE THE BRACKET beside "//here" a little bit to the right like other brackets
Reply
#4

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
Try this and tell, it MAY work
Please also tell what you've changed.
Reply
#5

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
whats %d% over there?
thats is not meanted to show. its a speedometer, but i just want the fuel game text, if you know what i mean
Reply
#6

I mean should'nt it be %d instead of %d% ?
Reply
#7

Quote:
Originally Posted by Red_Dragon.
Посмотреть сообщение
Try this and tell, it MAY work

EDIT: JUST MOVE THE BRACKET beside "//here" a little bit to the right like other brackets
yea, i know the //here were added here. but with ypur code still giving the same error
Reply
#8

Just TRY what i said MOVE THE BRACKET i think it is the wrong thing


EDIT: Try this: https://sampforum.blast.hk/showthread.php?tid=305047
Reply
#9

sorry the double post, but i forget one thing.


pawn Код:
if(ShowFuel[i] && GetPlayerState(i) == PLAYER_STATE_DRIVER)
                {
                   new form[128];
                    new vehicle = GetPlayerVehicleID(i);
                    new Float: Speed;
                    Speed = GetSpeed(i);
                    if(!OutOfFuel[i])
                    {
                        if(Fuel[vehicle] <= 25)
                        {
                            if(EngineStatus[vehicle])
                            {

                                if(Speed > 0)
                                {
                                    format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~Gdeposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
                                    GameTextForPlayer(i,form,1000,5);
                                }
                            }
                            else
                            {
                                format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~deposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
                                GameTextForPlayer(i,form,1000,5);
                            }
                        }
                        else
                        {
                            if(EngineStatus[vehicle])
                            {

                                if(Speed > 0)
                                {
                                    format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~deposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
                                    GameTextForPlayer(i,form,1000,5);
                                }
                            }
                            else
                            {
                                format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor a trabalhar.~n~~w~Combustivel:~g~ %d%~n~~r~deposito na reserva. ",Fuel[vehicle],GetSpeedKM(i));
                                GameTextForPlayer(i,form,1000,5);



                                                        }
                                else
                            {
                                format(form, sizeof(form), "~w~~n~~n~~n~~n~~n~~n~~y~Motor desligado.~n~~w~Combustivel:~g~ %d%    ",Fuel[vehicle],GetSpeedKM(i));
                                GameTextForPlayer(i,form,1000,5);
                            }
                          }
                    }
                }
Reply
#10

Not sure, but I guess it cant be
if
else
else
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)