[Tutorial] How to create a vehicle system using Y_INI and Y_CMD
#21

Error in this line:

Code:
VehicleInfo[vehicleID][vLocked] = INI_Int("locked") == 1 ? true : false;
Code:
error 017: undefined symbol "INI_Int"
Error in this line too:
Code:
format(strLoc, sizeof(strLoc), "Loc%d", i), INI_Float(strLoc, VehicleInfo[vehicleID][vLoc][i]);
Code:
C:Desktop\SAMP - SERVER\samp037_svr_R2-1-1_win32\gamemodes\HA-GM.pwn(6272) : error 029: invalid expression, assumed zero
C:SAMP - SERVER\samp037_svr_R2-1-1_win32\gamemodes\HA-GM.pwn(6272) : error 001: expected token: ";", but found "return"
Reply
#22

UPPPPP
Reply
#23

Good job!
Reply
#24

Nice one!
Reply
#25

Every time the server LOADs the GM, the variable of the vehicle:
Code:
VehicleInfo[vehicleid][vOwner]
Adds more 1 Letter.
Example:
Meu nick is Hayden_Almeida
When i create the vehicle and after this i close the server, it saves the file like:
Code:
owner = Hayden_Almeida
When i open the Server and i enter the vehicle and print what is the string in
Code:
VehicleInfo[vehicleid][vOwner]
it says:
Code:
HHayden_Almeida
and if i close the server, the file now contains:
Code:
owner = HHayden_Almeida
Reply
#26

https://ibb.co/cQbh4m
Reply
#27

(224) : warning 217: loose indentation
(226) : error 029: invalid expression, assumed zero
(226) : error 001: expected token: ")", but found "return"
(226) : fatal error 107: too many error messages on one line
Reply
#28

Code:
C:\Users\matia\Desktop\Actualizacion SV\filterscripts\Personal.pwn(24) : warning 203: symbol is never used: "vehicleID"
C:\Users\matia\Desktop\Actualizacion SV\filterscripts\Personal.pwn(72) : error 047: array sizes do not match, or destination array is too small
C:\Users\matia\Desktop\Actualizacion SV\filterscripts\Personal.pwn(82) : error 029: invalid expression, assumed zero
C:\Users\matia\Desktop\Actualizacion SV\filterscripts\Personal.pwn(82) : error 001: expected token: ";", but found "return"
C:\Users\matia\Desktop\Actualizacion SV\filterscripts\Personal.pwn(82) : error 017: undefined symbol "i"
C:\Users\matia\Desktop\Actualizacion SV\filterscripts\Personal.pwn(82) : fatal error 107: too many error messages on one line

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


5 Errors.
..........................
CODE:
Code:
stock VehicleLoad(vehicleID, file[])
// This function will load the vehicle provided by the id when the server starts.
{
	INI_ParseFile(file, "LoadVehicleData", .bExtra = true, .extra = vehicleID); // Parse the vehicle data from the INI file.
	VehicleCreate(VehicleInfo[vehicleID][vModel], VehicleInfo[vehicleID][vLoc], VehicleInfo[vehicleID][vColor1], VehicleInfo[vehicleID][vColor2], VehicleInfo[vehicleID][vRespawn],
	VehicleInfo[vehicleID][vOwner], VehicleInfo[vehicleID][vLocked]); // Creates the vehicle from the information we loaded and parsed. Pretty self-explanatory.
}

forward LoadVehicleData(vehicleID, name[], value[]);
public LoadVehicleData(vehicleID, name[], value[]) // This a callback with the parameter of the vehicleID send from our VehicleLoad function. This function will pretty much parse the data from the file.
{
	new strLoc[8]; // Will hold the location key name dynamically.
	// The first argument is the key and the second argument is the data which will hold the value of that key.
	INI_Int("model", VehicleInfo[vehicleID][vModel]);
	for(new i = 0; i < 4; i++) format(strLoc, sizeof(strLoc), "Loc%d", i), INI_Float(strLoc, VehicleInfo[vehicleID][vLoc][i]);
	// Looping through our location data and retrive it. Loc0 = LocX, Loc1 = LocY, Loc2 = LocZ, Loc3 = LocA.
	INI_Int("color1", VehicleInfo[vehicleID][vColor1]); // You should've guessed it by now.
	INI_Int("color2", VehicleInfo[vehicleID][vColor2]);
	INI_Int("respawn", VehicleInfo[vehicleID][vRespawn]);
	INI_String("owner", VehicleInfo[vehicleID][vOwner], MAX_PLAYER_NAME);
	VehicleInfo[vehicleID][vLocked] = INI_Int("locked") == 1 ? true : false;
	//Converting the locked data from int(whole number) to bool(true/false) and assign it.

	return 1;
}
Reply
#29

Having the same problem with the LoadVehicleData group.

But also error 017: undefined symbol "INI_Int".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)