SA-MP Forums Archive
enum help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: enum help (/showthread.php?tid=363406)



enum help - Private200 - 27.07.2012

I want to create new missions . I fixed every error on PPC_DefLocations

But now i have a problem with PPC_DefLoads

Here the problem is

Код:
G:\The new server!!!\pawno\include\PPC_DefLoads.inc(2) : error 001: expected token: ";", but found "enum"
Here pawn code is

pawn Код:
// Setup a custom type that holds all data about a load
enum TLoad
{
    LoadName[50], // The name of the load
    bool:Mafia, // Holds "true" if this load is wanted by the mafia
    Float:PayPerUnit, // Holds the price for every meter to haul this type of load (this gets multiplied by the distance to calculate the payment)
    PCV_Required, // This holds the vehicle-type the player needs to use this load (and automatically the player's class)
    FromLocations[30], // This array holds all loading-points for this load
    ToLocations[30] // This array holds all unloading-points for this load
}
NOTE!: THe second line is :

pawn Код:
enum TLoad



Re: enum help - TaLhA XIV - 27.07.2012

PHP код:
// Setup a custom type that holds all data about a load
enum {TLoad

    LoadName
[50], // The name of the load
    
bool:Mafia// Holds "true" if this load is wanted by the mafia
    
Float:PayPerUnit// Holds the price for every meter to haul this type of load (this gets multiplied by the distance to calculate the payment)
    
PCV_Required// This holds the vehicle-type the player needs to use this load (and automatically the player's class)
    
FromLocations[30], // This array holds all loading-points for this load
    
ToLocations[30// This array holds all unloading-points for this load

test this if it is correct


Re: enum help - McCurdy - 27.07.2012

Try this one:
Код:
enum TLoad
{
    LoadName[50], // The name of the load
    bool:Mafia, // Holds "true" if this load is wanted by the mafia
    Float:PayPerUnit, // Holds the price for every meter to haul this type of load (this gets multiplied by the distance to calculate the payment)
    PCV_Required, // This holds the vehicle-type the player needs to use this load (and automatically the player's class)
    FromLocations[30], // This array holds all loading-points for this load
    ToLocations[30] // This array holds all unloading-points for this load
};



Re: enum help - Devilxz97 - 27.07.2012

what is the means of TLoad give more information

example;

pawn Код:
enum TLoad
{
    LoadName[50], // The name of the load
    bool:Mafia, // Holds "true" if this load is wanted by the mafia
    Float:PayPerUnit, // Holds the price for every meter to haul this type of load (this gets multiplied by the distance to calculate the payment)
    PCV_Required, // This holds the vehicle-type the player needs to use this load (and automatically the player's class)
    FromLocations[30], // This array holds all loading-points for this load
    ToLocations[30] // This array holds all unloading-points for this load
}
new TheLoad[MAX_PLAYERS][TLoad];



Re: enum help - Vince - 27.07.2012

If you get that error, then it means that the mistake is ABOVE the referenced line, not below it.


Re: enum help - Private200 - 27.07.2012

Quote:
Originally Posted by McCurdy
Посмотреть сообщение
Try this one:
Код:
enum TLoad
{
    LoadName[50], // The name of the load
    bool:Mafia, // Holds "true" if this load is wanted by the mafia
    Float:PayPerUnit, // Holds the price for every meter to haul this type of load (this gets multiplied by the distance to calculate the payment)
    PCV_Required, // This holds the vehicle-type the player needs to use this load (and automatically the player's class)
    FromLocations[30], // This array holds all loading-points for this load
    ToLocations[30] // This array holds all unloading-points for this load
};
not working , non of these working


Re: enum help - Universal - 27.07.2012

Show us a little bit of code above the error line please?

And try this:
pawn Код:
enum TLoad
{
    LoadName[50], // The name of the load
    bool:Mafia, // Holds "true" if this load is wanted by the mafia
    Float:PayPerUnit, // Holds the price for every meter to haul this type of load (this gets multiplied by the distance to calculate the payment)
    PCV_Required, // This holds the vehicle-type the player needs to use this load (and automatically the player's class)
    FromLocations[30], // This array holds all loading-points for this load
    ToLocations[30], // This array holds all unloading-points for this load
};



Re: enum help - Private200 - 27.07.2012

Error line is
pawn Код:
enum Tload
and example didnt work


Re: enum help - Private200 - 27.07.2012

Error line is
pawn Код:
enum Tload
and example didnt work


Re: enum help - Vince - 27.07.2012

Let's all ignore my post;

Quote:
Originally Posted by Vince
Посмотреть сообщение
If you get that error, then it means that the mistake is ABOVE the referenced line, not below it.