Help about this warning
#1

Quote:
C:\Users\server\Desktop\SAMP FILES\PPC_Trucking6\PNT v1.0\pawno\include\PPC_Toll.inc(27) : warning 202: number of arguments does not match definition
C:\Users\server\Desktop\SAMP FILES\PPC_Trucking6\PNT v1.0\pawno\include\PPC_Toll.inc(27) : warning 202: number of arguments does not match definition
C:\Users\server\Desktop\SAMP FILES\PPC_Trucking6\PNT v1.0\pawno\include\PPC_Toll.inc(27) : warning 202: number of arguments does not match definition
C:\Users\server\Desktop\SAMP FILES\PPC_Trucking6\PNT v1.0\pawno\include\PPC_Toll.inc(52) : warning 202: number of arguments does not match definition
C:\Users\server\Desktop\SAMP FILES\PPC_Trucking6\PNT v1.0\pawno\include\PPC_Toll.inc(52) : warning 202: number of arguments does not match definition
C:\Users\server\Desktop\SAMP FILES\PPC_Trucking6\PNT v1.0\pawno\include\PPC_Toll.inc(52) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


6 Warnings.

Line 27:
PHP код:
MoveObject(ATollGates[TollGate][GateID], ATollGates[TollGate][TollX], ATollGates[TollGate][TollY], ATollGates[TollGate][TollZ]+0.820.04ATollGates[TollGate][TollRX], ATollGates[TollGate][TollRY], ATollGates[TollGate][TollRZ]); 
Line 52:
PHP код:
MoveObject(ATollGates[TollGate][GateID], ATollGates[TollGate][TollX], ATollGates[TollGate][TollY], ATollGates[TollGate][TollZ]+0.820.04ATollGates[TollGate][TollRX], ATollGates[TollGate][TollRY]-90.0ATollGates[TollGate][TollRZ]); 
Define:
PHP код:
// Setup a custom type that holds all data about toll-boots (les peages jaune)
enum TTollGate
{
    
GateID// Holds the object-id of the gate
    
TollPrice// Holds the price for passing the gate
    
GateStatus// Holds the status of the gate (open = 1, closed = 0)
    
Float:TollX// Holds the coordinates when the gate is opened
    
Float:TollY// Holds the coordinates when the gate is opened
    
Float:TollZ// Holds the coordinates when the gate is opened
    
Float:TollRX// Holds the coordinates when the gate is closed
    
Float:TollRY// Holds the coordinates when the gate is closed
    
Float:TollRZ // Holds the coordinates when the gate is closed
}
new 
ATollGates[MAX_TOLLGATES][TTollGate]; 
Full Code:
PHP код:
// This file holds all functions for the toll-system
forward Toll();
public 
Toll()
{
    
// Loop through all players
    
for(new playeridplayerid MAX_PLAYERSplayerid++)
    {
        
// If the player isn't connected, skip to the next player
        
if(APlayerData[playerid][LoggedIn] == false) continue;
        
// Check if the player is the driver of a vehicle
        
if (GetPlayerVehicleSeat(playerid) == 0)
        {
            
// Loop through all toll-gates
            
for (new TollGateTollGate MAX_TOLLGATESTollGate++)
            {
                
// Check if this toll-gate exists
                
if (ATollGates[TollGate][GateID] != 0)
                {
                    
// Check if the player is in range of the tollgate
                    
if(IsPlayerInRangeOfPoint(playerid7.5ATollGates[TollGate][TollX], ATollGates[TollGate][TollY], ATollGates[TollGate][TollZ]))
                    {
                        
// Check if the toll-gate is closed
                        
if(ATollGates[TollGate][GateStatus] == 0)
                        {
                            
// Open the gate
                            
MoveObject(ATollGates[TollGate][GateID], ATollGates[TollGate][TollX], ATollGates[TollGate][TollY], ATollGates[TollGate][TollZ]+0.820.04ATollGates[TollGate][TollRX], ATollGates[TollGate][TollRY], ATollGates[TollGate][TollRZ]);
                            
// Set status to OPEN
                            
ATollGates[TollGate][GateStatus] = 1;
                            if (
ATollGates[TollGate][TollPrice] != 0)
                            {
                                
// Let the player pay the toll
                                
RewardPlayer(playerid, -ATollGates[TollGate][TollPrice], 0);
                                new 
string[50];
                                
format(stringsizeof(string), TXT_PlayerPaysTollATollGates[TollGate][TollPrice]);
                                
GameTextForPlayer(playeridstring30004);
                            }
                            
// Start a timer that closes the gate after 5 seconds
                            
SetTimerEx("CloseGate"5000false"i"TollGate);
                        }
                    }
                }
            }
        }
    }
}
forward CloseGate(TollGate);
public 
CloseGate(TollGate)
{
    
// Close the gate
    
MoveObject(ATollGates[TollGate][GateID], ATollGates[TollGate][TollX], ATollGates[TollGate][TollY], ATollGates[TollGate][TollZ]+0.820.04ATollGates[TollGate][TollRX], ATollGates[TollGate][TollRY]-90.0ATollGates[TollGate][TollRZ]);
    
// Set status to CLOSED
    
ATollGates[TollGate][GateStatus] = 0;

I am using PPC_Trucking gamemode and I saw a guy commented on the thread here. (http://forum.sa-mp.com/showthread.ph...=zcmd&page=438) the guy is DrAlio

I followed his instructions but I got this warnings doesn't edit anything..
Reply
#2

Hi

Why you don;t use return 1; under if statement.
Reply
#3

Quote:
Originally Posted by TadePoleMG
Посмотреть сообщение
Hi

Why you don;t use return 1; under if statement.
It's just an include PPC_Toll.inc and doesn't fix the warning.
Reply
#4

Use that in your script instead of .inc.
Reply
#5

Quote:
Originally Posted by TadePoleMG
Посмотреть сообщение
Use that in your script instead of .inc.

Tried it after you say but still got the warnings no error at all just warning.
Reply
#6

I fixed it but there's a problem

Quote:

gamemodes\PPC_Trucking.pwn(1475) : warning 203: symbol is never used: "IsVehicleAirVehicle"
gamemodes\PPC_Trucking.pwn(1475) : warning 203: symbol is never used: "Player_PortOutAdminZone"
gamemodes\PPC_Trucking.pwn(1475) : warning 203: symbol is never used: "RefuelMaxPrice"

Doesn't even have line 1475 .
Reply
#7

The reason why you get «symbol is never used» is because you have functions/variables that has no use in your script. So basically to get these warnings away you can either comment them out(or remove them) doesn’t really matter. At least if you are not planning on using them. Just search for «IsVehicleAirVehicle», «Player_PortOutAdminZone» and «RefuelMaxPrice». These warnings will give no major harm to your script, it just tells you that you have functions/variables that is not used.
Reply
#8

Quote:
Originally Posted by Revy
Посмотреть сообщение
The reason why you get «symbol is never used» is because you have functions/variables that has no use in your script. So basically to get these warnings away you can either comment them out(or remove them) doesn’t really matter. At least if you are not planning on using them. Just search for «IsVehicleAirVehicle», «Player_PortOutAdminZone» and «RefuelMaxPrice». These warnings will give no major harm to your script, it just tells you that you have functions/variables that is not used.
Already fixed it thanks btw

Thread Closed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)