SA-MP Forums Archive
Repair Vehicle not working - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Repair Vehicle not working (/showthread.php?tid=130477)



Repair Vehicle not working - cozza123456 - 27.02.2010

Why does this not work?

error 010: invalid function or declaration

Код:
		if(strcmp(cmd, "/fix", true))
		{
			if(IsPlayerInAnyVehicle(playerid))RepairVehicle(GetPlayerVehicleID(playerid));
			return 1;
		}
I get
error 010: invalid function or declaration
on the top line, the "if(IsPlayerInAnyVehicle" line and the "return 1;" line.


Re: Repair Vehicle not working - -Rebel Son- - 27.02.2010

Код:
if(!strcmp(cmdtext,"/repair",true)) {
if(IsPlayerInAnyVehicle(playerid))
{
new VehicleID, Float:X, Float:Y, Float:Z,Float:Ang;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
VehicleID = GetPlayerVehicleID(playerid);
SetVehiclePos(VehicleID, X, Y, Z);
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
RepairVehicle(VehicleID);
SendClientMessage(playerid, COLOR_LBLUE,"Vehicle repaired!");
}
else
{
SendClientMessage(playerid,COLOR_RED,"Your Not in any Vehicle!");
}
return 1;
}
This is the code i use, and it works Awsome!

-Dakota


Re: Repair Vehicle not working - cozza123456 - 27.02.2010

C:\Documents and Settings\Cozza\Desktop\samp0.3aserver\filterscript s\MidoStream.pwn(553) : error 010: invalid function or declaration
C:\Documents and Settings\Cozza\Desktop\samp0.3aserver\filterscript s\MidoStream.pwn(555) : error 010: invalid function or declaration
C:\Documents and Settings\Cozza\Desktop\samp0.3aserver\filterscript s\MidoStream.pwn(559) : error 010: invalid function or declaration

i cut your script down due to errors but got this now...

Код:
		if(!strcmp(cmdtext,"/fix",true) == 0)
	 	{
		if(IsPlayerInAnyVehicle(playerid))
		{
		VehicleID = GetPlayerVehicleID(playerid);
		RepairVehicle(VehicleID);
		return 1;
		}



Re: Repair Vehicle not working - -Rebel Son- - 27.02.2010

if(!strcmp(cmdtext,"/fix",true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
VehicleID = GetPlayerVehicleID(playerid);
RepairVehicle(VehicleID);
}
else
{
SendClientMessage(playerid,COLOR_RED,"Your Not in any Vehicle!");
}
return 1;
}


Re: Repair Vehicle not working - cozza123456 - 27.02.2010

I still get those same errors... Sorry to be annoying


Re: Repair Vehicle not working - cozza123456 - 27.02.2010

Fixed those errors by moving it above one of my other commands.
But i get Undefined Symbol "VehicleID"


Re: Repair Vehicle not working - cozza123456 - 27.02.2010

I truly am an idiot.

Код:
new VehicleID;



Re: Repair Vehicle not working - lionlev - 22.03.2010

Quote:
Originally Posted by XxCozzaxX
I truly am an idiot.

Код:
new VehicleID;
I got the error of RepairVehicle :P


Re: Repair Vehicle not working - Mike Garber - 22.03.2010

If you get the error from RepairVehicle, you may be using an earlier version of the includes.


Re: Repair Vehicle not working - lionlev - 22.03.2010

Quote:
Originally Posted by mavtias
If you get the error from RepairVehicle, you may be using an earlier version of the includes.
How do I update it?