VehicleDelete Error
#1

hello guys when i do this command i do like this first i do

Код:
forward VehicleSpawn(playerid,model);
forward VehicleDelete(vehicleid);
Код:
and then:
public VehicleSpawn(playerid,model)
{
	if(IsPlayerInAnyVehicle(playerid))
	{
		SendClientMessage(playerid, COLOR_RED, "You already have a car!");
	}
 	else
	{
    	new Float:x, Float:y, Float:z, Float:angle;
	 	GetPlayerPos(playerid, x, y, z);
	 	GetPlayerFacingAngle(playerid, angle);
		if(!IsPlayerInAnyVehicle(playerid))
		{
			VehicleDelete(Player[playerid][Veh]);
			return 1;
		}
	    new vehicleid = CreateVehicle(model,x,y,z,angle,-1,-1,-1);
		PutPlayerInVehicle(playerid, vehicleid, 0);
		SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
		LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
		ChangeVehicleColor(vehicleid,36,36);
        Player[playerid][Veh] = vehicleid;
	}
	return 1;
}
Код:
the error i got this one:

function "VehicleDelete" is not implemented
Reply
#2

You need to make the "public VehicleDelete(playerid);" - instead of only forwarding.
Also, I have an tip. Instead of using "forward callback(params);" and then "public callback(params){}" you can use: "CB:callback(params){}" - It's faster and it saves some diskspace.
Just add this at the top of your script:

pawn Код:
#define CB:%0(%1) forward %0(%1); public %0(%1)
- Kevin
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)