#1

Hey guys,

Im getting a weird error while compiling a vehicle system.
The script is using some stocks, and so far i fixed some errors; but still getting a few errors.
pawn Код:
stock LoadVehicle(vehicle, filename[])
{
    new INI:iniid = INI_Open(filename);
    CreateVehicleEx(INI_Int("Model", carData[vehicle][model]), // this is the error line (96)
                    INI_Int("xSpawn", carData[vehicle][xspawn]),
                    INI_Int("ySpawn", carData[vehicle][yspawn]),
                    INI_Int("zSpawn", carData[vehicle][zspawn]),
                    INI_Int("rot", carData[vehicle][anglespawn]),
                    INI_Int("Col1", carData[vehicle][col1]),
                    INI_Int("Col2", carData[vehicle][col2]),
                    INI_Int("respawn" carData[vehicle][respawn]),
                    INI_String("Owner", carData[vehicle][owner[MAX_PLAYER_NAME]], #MAX_PLAYER_NAME) );
    INI_Close(iniid);
    return 0;
}
Im using the function when at OnPlayerConnect, and when i comment the line; it still gives the same error.
pawn Код:
public OnPlayerConnect(playerid)
{
    new file[50];
    format( file, sizeof file, "/Vehicles/%i.ini", GetName(playerid) );
    LoadVehicle(GetPlayerVehicleID(playerid), file);
    return 1;
}
Note: The error is still at the same line, when LoadVehicle() is used
Код:
C:\Users\Wesley\Documents\SA-MP\Veh3(1).pwn(96) : error 029: invalid expression, assumed zero
C:\Users\Wesley\Documents\SA-MP\Veh3(1).pwn(96) : error 017: undefined symbol "name"
C:\Users\Wesley\Documents\SA-MP\Veh3(1).pwn(96) : error 001: expected token: ";", but found "return"
C:\Users\Wesley\Documents\SA-MP\Veh3(1).pwn(96) : fatal error 107: too many error messages on one line
As far as i know, i dont have the variable 'name' somewhere in the script.
~Wesley
Reply
#2

pawn Код:
GetName(playerid)
{
new name[24];
GetPlayerName(playerid,name,24);
return name;
}
//Sorry for the indentitation, wrote this directly on the website.
Reply
#3

I do have the GetName function already, which is working. Its using the variable 'Name' though, so that wont be the problem neither.
pawn Код:
stock GetName(playerid)
{
    new Name[24];
    GetPlayerName( playerid, Name, sizeof Name );
    return Name;
}
Reply
#4

pawn Код:
INI_String("Owner", carData[vehicle][owner[MAX_PLAYER_NAME]], #MAX_PLAYER_NAME) );
Why do you have 2 closing braces here?
Also, try doing just
pawn Код:
INI_String("Owner", carData[vehicle][owner[MAX_PLAYER_NAME]], 24);
Reply
#5

The double brackets are because the last one is for closing the ShowPlayerDialog.
When i just change it to 24, still the same error
Reply
#6

Then I guess it would have to do with the enum, please show the way you are creating it.
Reply
#7

pawn Код:
enum carDataEnum
{
    model,
    Float:xspawn,
    Float:yspawn,
    Float:zspawn,
    Float:anglespawn,
    col1,
    col2,
    respawn,
    owner[MAX_PLAYER_NAME]
}
new carData[MAX_VEHICLES][carDataEnum];
Reply
#8

Well I know that this might sound kinda stupid, but are you sure you are including the Y_INI include?
Reply
#9

Yipyap
pawn Код:
#include <YSI/y_ini.inc>
Reply
#10

y_ini doesn't work that way.

Look at the tutorial again.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)