Trucker Mission
#1

i get error from here

Код:
Trucker_OnPlayerEnterCheckpoint(playerid)
{
	// Check if the player is inside his vehicle while entering a checkpoint
	if (GetPlayerVehicleID(playerid) == APlayerData[playerid][VehicleID])
	{
		// Also check if the player still has his trailer attached
		if (APlayerData[playerid][TrailerID] == GetVehicleTrailer(GetPlayerVehicleID(playerid)))
		{
		    // Check the jobstep
		    switch (APlayerData[playerid][JobStep])
		    {
				// JobStep is 1 (truckdriver is loading his goods at the checkpoint)
		 		case 1:
		 		}
    	          new RouteText[50];
                  format(RouteText, 50, "Loading");
			      TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
			    }
				// JobStep is 2 (truckdriver is unloading his goods at the checkpoint) or 3 (unloading for convoys)
				case 2, 3:
				}
    	          new RouteText[50];
                  format(RouteText, 50, "Unloading");
			      TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
				}
		   	}
			// Disable the player's actions (he cannot move anymore)
			TogglePlayerControllable(playerid, 0);
			// Start a timer (Public function "LoadUnload(playerid)" gets called when the timer runs out)
			APlayerData[playerid][LoadingTimer] = SetTimerEx("Trucker_LoadUnload", 5000, false, "d" , playerid);
		}
		else
		    SendClientMessage(playerid, 0xFFFFFFFF, TXT_NeedTrailerToProceed);
	}
	else
	    SendClientMessage(playerid, 0xFFFFFFFF, TXT_NeedVehicleToProceed);

	return 1;
}
Код:
error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "new"
error 017: undefined symbol "RouteText"
fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

PHP код:
Trucker_OnPlayerEnterCheckpoint(playerid)
{
    
// Check if the player is inside his vehicle while entering a checkpoint
    
if (GetPlayerVehicleID(playerid) == APlayerData[playerid][VehicleID])
    {
        
// Also check if the player still has his trailer attached
        
if (APlayerData[playerid][TrailerID] == GetVehicleTrailer(GetPlayerVehicleID(playerid)))
        {
            
// Check the jobstep
            
switch (APlayerData[playerid][JobStep])
            {
                
// JobStep is 1 (truckdriver is loading his goods at the checkpoint)
                 
case 1:
                 }
                  
format(RouteText50"Loading");
                  
TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
                }
                
// JobStep is 2 (truckdriver is unloading his goods at the checkpoint) or 3 (unloading for convoys)
                
case 23:
                }
                  
format(RouteText50"Unloading");
                  
TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
                }
               }
            
// Disable the player's actions (he cannot move anymore)
            
TogglePlayerControllable(playerid0);
            
// Start a timer (Public function "LoadUnload(playerid)" gets called when the timer runs out)
            
APlayerData[playerid][LoadingTimer] = SetTimerEx("Trucker_LoadUnload"5000false"d" playerid);
        }
        else
            
SendClientMessage(playerid0xFFFFFFFFTXT_NeedTrailerToProceed);
    }
    else
        
SendClientMessage(playerid0xFFFFFFFFTXT_NeedVehicleToProceed);

    return 
1;

Try that.
Reply
#3

Quote:
Originally Posted by edgargreat
Посмотреть сообщение
PHP код:
Trucker_OnPlayerEnterCheckpoint(playerid)
{
    
// Check if the player is inside his vehicle while entering a checkpoint
    
if (GetPlayerVehicleID(playerid) == APlayerData[playerid][VehicleID])
    {
        
// Also check if the player still has his trailer attached
        
if (APlayerData[playerid][TrailerID] == GetVehicleTrailer(GetPlayerVehicleID(playerid)))
        {
            
// Check the jobstep
            
switch (APlayerData[playerid][JobStep])
            {
                
// JobStep is 1 (truckdriver is loading his goods at the checkpoint)
                 
case 1:
                 }
                  
format(RouteText50"Loading");
                  
TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
                }
                
// JobStep is 2 (truckdriver is unloading his goods at the checkpoint) or 3 (unloading for convoys)
                
case 23:
                }
                  
format(RouteText50"Unloading");
                  
TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
                }
               }
            
// Disable the player's actions (he cannot move anymore)
            
TogglePlayerControllable(playerid0);
            
// Start a timer (Public function "LoadUnload(playerid)" gets called when the timer runs out)
            
APlayerData[playerid][LoadingTimer] = SetTimerEx("Trucker_LoadUnload"5000false"d" playerid);
        }
        else
            
SendClientMessage(playerid0xFFFFFFFFTXT_NeedTrailerToProceed);
    }
    else
        
SendClientMessage(playerid0xFFFFFFFFTXT_NeedVehicleToProceed);
    return 
1;

Try that.
He had an incorrect brace, where he had '}', he should of had a '{'. But instead, you go and put in more closing braces...?

pawn Код:
Trucker_OnPlayerEnterCheckpoint(playerid)
{
    // Check if the player is inside his vehicle while entering a checkpoint
    if (GetPlayerVehicleID(playerid) == APlayerData[playerid][VehicleID])
    {
        // Also check if the player still has his trailer attached
        if (APlayerData[playerid][TrailerID] == GetVehicleTrailer(GetPlayerVehicleID(playerid)))
        {
            // Check the jobstep
            switch (APlayerData[playerid][JobStep])
            {  
                // JobStep is 1 (truckdriver is loading his goods at the checkpoint)
                case 1:
                {
                    format(RouteText, 50, "Loading");
                    TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
                }
                // JobStep is 2 (truckdriver is unloading his goods at the checkpoint) or 3 (unloading for convoys)
                case 2, 3:
                {
                    format(RouteText, 50, "Unloading");
                    TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
                }
            }
            // Disable the player's actions (he cannot move anymore)
            TogglePlayerControllable(playerid, 0);
            // Start a timer (Public function "LoadUnload(playerid)" gets called when the timer runs out)
            APlayerData[playerid][LoadingTimer] = SetTimerEx("Trucker_LoadUnload", 5000, false, "d" , playerid);
        }
        else SendClientMessage(playerid, 0xFFFFFFFF, TXT_NeedTrailerToProceed);
    }
    else SendClientMessage(playerid, 0xFFFFFFFF, TXT_NeedVehicleToProceed);
    return 1;
}
Reply
#4

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
He had an incorrect brace, where he had '}', he should of had a '{'. But instead, you go and put in more closing braces...?

pawn Код:
Trucker_OnPlayerEnterCheckpoint(playerid)
{
    // Check if the player is inside his vehicle while entering a checkpoint
    if (GetPlayerVehicleID(playerid) == APlayerData[playerid][VehicleID])
    {
        // Also check if the player still has his trailer attached
        if (APlayerData[playerid][TrailerID] == GetVehicleTrailer(GetPlayerVehicleID(playerid)))
        {
            // Check the jobstep
            switch (APlayerData[playerid][JobStep])
            {  
                // JobStep is 1 (truckdriver is loading his goods at the checkpoint)
                case 1:
                {
                    format(RouteText, 50, "Loading");
                    TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
                }
                // JobStep is 2 (truckdriver is unloading his goods at the checkpoint) or 3 (unloading for convoys)
                case 2, 3:
                {
                    format(RouteText, 50, "Unloading");
                    TextDrawSetString(APlayerData[playerid][MissionText], RouteText);
                }
            }
            // Disable the player's actions (he cannot move anymore)
            TogglePlayerControllable(playerid, 0);
            // Start a timer (Public function "LoadUnload(playerid)" gets called when the timer runs out)
            APlayerData[playerid][LoadingTimer] = SetTimerEx("Trucker_LoadUnload", 5000, false, "d" , playerid);
        }
        else SendClientMessage(playerid, 0xFFFFFFFF, TXT_NeedTrailerToProceed);
    }
    else SendClientMessage(playerid, 0xFFFFFFFF, TXT_NeedVehicleToProceed);
    return 1;
}
Thanks
Reply
#5

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
Thanks
Use for further questions [PAWN] in case of [CODE] instead, so it's better readable.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)