Taxi cars [help]
#1

hello guys, i want to make Taxi Cars on rank's and i have too error's
this is the script
PHP код:
if(newcar == taxic[6])  // Rank Masini Taxi
        
{
            if(
PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
            {
                if(
PlayerInfo[playerid][pRank] > 6) { }
                else
                {
                    
SendClientMessage(playerid,COLOR_WHITE,"{999999}You don't have rank 6.");
                    
RemovePlayerFromVehicleEx(playerid);
                }
            }
            else
            {
                
SendClientMessage(playerid,COLOR_WHITE,"{999999}You are not a Los Santos Taxi member or you don't have rank 6.");
                
RemovePlayerFromVehicleEx(playerid);
            }
            else if(
newcar == taxic[4])
            {
                
//if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13)
                //{
                    
if(PlayerInfo[playerid][pRank] > 4) { }
                    else
                    {
                    
SendClientMessage(playerid,COLOR_WHITE,"{999999}You don't have rank 4.");
                    
RemovePlayerFromVehicleEx(playerid);
                    }
                
//}
            
}
            else
            {
                
SendClientMessage(playerid,COLOR_WHITE,"{999999}You are not a Los Santos Taxi member or you don't have rank 4.");
                
RemovePlayerFromVehicleEx(playerid);
            }
        } 
and this is the error's

PHP код:

Current directory
C:\Documents and Settings\Pc\Desktop\Gamelife\gamemodes
Gamelife
.pwn(8780) : error 029invalid expressionassumed zero
Gamelife
.pwn(8780) : warning 215expression has no effect
Gamelife
.pwn(8780) : error 001expected token";"but found "if"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
What it's wrong ?
Reply
#2

missing semicolon, what line is 8780?
Reply
#3

This is on line 8780
PHP код:
    else if(newcar == taxic[4]) 
Reply
#4

You can not have "else if" if you already had "else". Either something is true or it's not. There's no third option.
Reply
#5

Yeh ? How to continue function if can not use elseif ?
Reply
#6

PHP код:
if(newcar == taxic[6])  // Rank Masini Taxi 
        

            if(
PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13
            { 
                if(
PlayerInfo[playerid][pRank] > 6) { } 
                else 
                { 
                    
SendClientMessage(playerid,COLOR_WHITE,"{999999}You don't have rank 6."); 
                    
RemovePlayerFromVehicleEx(playerid); 
                } 
            } 
else if(
newcar == taxic[4]) 
            { 
                
//if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13) 
                //{ 
                    
if(PlayerInfo[playerid][pRank] > 4) { } 
                    else 
                    { 
                    
SendClientMessage(playerid,COLOR_WHITE,"{999999}You don't have rank 4."); 
                    
RemovePlayerFromVehicleEx(playerid); 
                    } 
                
//} 
            
else //Here should be another condition and should be else if not else cuz in the If...Else staments can be only one else not more than
            

                
SendClientMessage(playerid,COLOR_WHITE,"{999999}You are not a Los Santos Taxi member or you don't have rank 6."); 
                
RemovePlayerFromVehicleEx(playerid); 
            } 
            
            } 
            else 
            { 
                
SendClientMessage(playerid,COLOR_WHITE,"{999999}You are not a Los Santos Taxi member or you don't have rank 4."); 
                
RemovePlayerFromVehicleEx(playerid); 
            } 
        } 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)