Got a problem with CreateVehicle
#1

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

Reply
#2

Little bump. Hope anyone will see it and help
Reply
#3

you can only bump every 24hours dont bump every hour
Reply
#4

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)