SA-MP Forums Archive
Got a problem with CreateVehicle - 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: Got a problem with CreateVehicle (/showthread.php?tid=231985)



Got a problem with CreateVehicle - Libra_PL - 26.02.2011

Sup! I've got a next problem, I don't know what's wrong with that! I made a vehicle spawning system, but I don't know whats wrong with CreateVehicle. I added respawn time in 2 seconds, but it respawns after ~8 seconds. Could anyone tell also how to add vehicle respawn after players leave the vehicle? If I put 0 seconds, it doesn't respawn, and I can't put 0.2 seconds or something after dot). Here's a script of vehicle spawning:

Код:
forward SpawnVehicle(playerid,model);
public SpawnVehicle(playerid,model)
{
	if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, red, "ERROR: You are in a vehicle, you cannot spawn another if you are inside!");
    	new Float:x, Float:y, Float:z, Float:angle;
	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, angle);
        new vehicleid = CreateVehicle(model, x, y, z, angle, -1, -1, 2);
	PutPlayerInVehicle(playerid, vehicleid, 0);
	LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
	VehicleDestroy[vehicleid] = true;
	return 1;
}
Beer is waiting




Re: Got a problem with CreateVehicle - Libra_PL - 26.02.2011

Little bump. Hope anyone will see it and help


Re: Got a problem with CreateVehicle - Lethaal - 26.02.2011

you can only bump every 24hours dont bump every hour


Re: Got a problem with CreateVehicle - alpha500delta - 26.02.2011

Delete a car when a player exits it? then you can use this

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    new car;
    car = GetPlayerVehicleID(playerid);
    DestroyVehicle(car);
    return 1;
}
I wrote this without any wiki or something (except for the callback lol) So errors may occur.

To respawn it... I wouldnt know xD