SA-MP Forums Archive
Two errors: - 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: Two errors: (/showthread.php?tid=379175)



Two errors: - DJ_Shocker - 20.09.2012

We're working on fixing a bug in our script, and now it won't compile. Two errors:
Код:
(40306) : error 017: undefined symbol "CreatePermanentVehicles"
(96162) : warning 204: symbol is assigned a value that is never used: "Vehicles"
LINES:

40306
Код:
dcmd_permcar(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, GREY, "    You are not authorized to use this command.");
	new model, color1, color2, faction, family, vip, Float:x, Float:y, Float:z, Float:a;
	GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a);
	if(sscanf(params, "dddddd", model, color1, color2, faction, family, vip)) return SyntaxMessage(playerid, "/permcar [model] [color 1] [color 2] [faction] [family] [VIP]");
	if(model < 400 || model > 611) return SendClientMessage(playerid, GREY, "Invalid model ID.");
	if(color1 < 0 || color1 > 255) return SendClientMessage(playerid, GREY, "Invalid color ID.");
    if(color2 < 0 || color2 > 255) return SendClientMessage(playerid, GREY, "Invalid color ID.");
	new vehicleid = AddStaticVehicleEx(model, x, y, z, a, color1, color2, 1800);
	if (family == 0) family = 255;
	else family -= 1;
	CreatePermanentVehicles(vehicleid);
	//PermanentVehicleStatistics[vehicleid][PermCarID]++;
	PermanentVehicleStatistics[vehicleid][IsPermCar] = 1;
	PermanentVehicleStatistics[vehicleid][PermCarID] = vehicleid;
	PermanentVehicleStatistics[vehicleid][PermCarModel] = model;
	PermanentVehicleStatistics[vehicleid][PermCarFaction] = faction;
	PermanentVehicleStatistics[vehicleid][PermCarFamily] = family;
	PermanentVehicleStatistics[vehicleid][PermCarVIP] = vip;
	PermanentVehicleStatistics[vehicleid][PermCarX] = x;
    PermanentVehicleStatistics[vehicleid][PermCarY] = y;
    PermanentVehicleStatistics[vehicleid][PermCarZ] = z;
    PermanentVehicleStatistics[vehicleid][PermCarRot] = a;
    PermanentVehicleStatistics[vehicleid][PermCarColors][1] = color1;
    PermanentVehicleStatistics[vehicleid][PermCarColors][2] = color2;
    SetPlayerPos(playerid, x, y, z + 2);
    TogglePlayerControllable(playerid, 0);
    SetTimerEx("UnfreezeMeNow", 800, false, "i", playerid);
    ResetEnumVar(vehicleid);
    permcars++;
    SavePermanentVehicles();
    new string[128];
    format(string, sizeof(string), "Permcar #%d created (/permcardel, /permcarloc, /permcarfac).", vehicleid);
    SendClientMessage(playerid, GREY, string);
96162
Код:
	}
	Vehicles=i-1;
	mysql_free_result();
}
I'm not the one scripting this. and I dunno how to script. if you have any ideas, please break it down into easy terminology and steps because i'm at a loss as well as my partner


Re: Two errors: - ViniBorn - 20.09.2012

(40306) : You don't have the function CreatePermanentVehicles in your GameMode.
(96162) : You created the variable "Vehicles" and don't are using ...


Re: Two errors: - [MM]18240[FMB] - 20.09.2012

You must define CreatePermanentVehicles, and the second is just a warning, I ignore those because I am too lazy, and it does nothing bad to the script..


Re: Two errors: - mamorunl - 20.09.2012

Quote:
Originally Posted by [MM]18240[FMB]
Посмотреть сообщение
You must define CreatePermanentVehicles, and the second is just a warning, I ignore those because I am too lazy, and it does nothing bad to the script..
Except for not functioning, right? Or crashing your gamemode, right? Too lazy? Then stop scripting or fix the damn warnings as well and stop pushing your laziness onto other people who DO want to code the right way!


Re: Two errors: - DJ_Shocker - 20.09.2012

guys i didn't create this topic for a fight. thanks for the help to tom who helped on skype and those that reminded me about the define. i appreciate it.
+Repped


Re: Two errors: - [MM]18240[FMB] - 20.09.2012

Best of luck, DJ_Shocker, hope your server works out well.