Spawn cars
#1

Hey guys
Код:
CMD:qw(playerid)
{
	new Float:x;
	new Float:y;
	new Float:z;
	new Float:a;
	GPP(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, a);
	new car = AddStaticVehicleEx(400, x+1, y+1, z, a, -1, -1, 1);
	vehicle3Dtext[car] = Create3DTextLabel("LANDSTALKER", 0xFF0000AA, 0.0, 0.0, 0.0, 20.0, 0, 1);
	Attach3DTextLabelToVehicle(vehicle3Dtext[car], car, 0.0, 0.0, 0.0);
	PutPlayerInVehicle(playerid, car, 0);
	SCM(playerid, 0xF81414, "Spawnovali ste Landstalkera");
	return 1;
}
With command above i spawn Landstalker but there is problem. When i type "qw" again it will spawn another landstalker near and another and another. How can i make if player is not in vehicle for x sec it will just dissapear from map??
Reply
#2

SetTimer
OnPlayerExitVehicle
KillTimer
DestroyVehicle
Reply
#3

Код:
CMD:qw(playerid)
{
	new Float:x;
	new Float:y;
	new Float:z;
	new Float:a;
	GPP(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, a);
	DestroyVehicle(pCar[playerid]);
	new car = CreateVehicle(400, x+1, y+1, z, a, -1, -1, 1);
	vehicle3Dtext[car] = Create3DTextLabel("LANDSTALKER", 0xFF0000AA, 0.0, 0.0, 0.0, 20.0, 0, 1);
	Attach3DTextLabelToVehicle(vehicle3Dtext[car], car, 0.0, 0.0, 0.0);
	PutPlayerInVehicle(playerid, car, 0);
	pCar[playerid] = GetPlayerVehicleID(playerid);
	SCM(playerid, 0xF81414, "Spawnovali ste Landstalkera");
	return 1;
}
Don't worry i've dont it. Now when he spawnes another vehicle first one will get destorey But thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)