VehicleDelete Error - 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: VehicleDelete Error (
/showthread.php?tid=214581)
VehicleDelete Error -
[MKD]Max - 21.01.2011
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
Re: VehicleDelete Error -
Kwarde - 21.01.2011
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