08.05.2012, 12:50
Hello guys!
As you can see, i have added a teleport in my lux-admin script. And i am wondering:
When i teleport, i get a monster, and i am placed in it. but, how can the cars which is added here, be destroyed when player enters a new car, or uses the teleport again?
Right now, when i teleport multiple times, it is spawned a new car each time, and they are not destroyed, so after 20 teleports to derby, i have 20 cars standing in the way.
So, when player leaves vehicle, or he enters a new vehicle, i want the old car destroyed..
Thanks!
pawn Код:
dcmd_mderby(playerid,cmdtext[])
{
if(AccInfo[playerid][GodCar] == 1)
{
AccInfo[playerid][GodCar] = 0;
new monster = CreateVehicle(444,1531.1086, 3700.6135, 8.6852,0.0000,-1,-1,-1);
PutPlayerInVehicle(playerid, monster, 0);
SendClientMessage(playerid,green,"Welcome to Monster Derby!");
return
SendClientMessage(playerid,green,"/cargod is NOW auto-turned off.");
}
else if (AccInfo[playerid][GodCar] == 0)
{
new VehicleID = CreateVehicle(444,1531.1086, 3700.6135, 8.6852,0.0000,-1,-1,-1);
PutPlayerInVehicle(playerid, VehicleID, 0);
//LinkVehicleToInterior(VehicleID, NUMBER); // if interior > 0
//SetPlayerInterior(VehicleID, NUMBER); // if interior > 0
SendClientMessage(playerid,green,"Welcome to Monster Derby!");
}
return 1;
}
When i teleport, i get a monster, and i am placed in it. but, how can the cars which is added here, be destroyed when player enters a new car, or uses the teleport again?
Right now, when i teleport multiple times, it is spawned a new car each time, and they are not destroyed, so after 20 teleports to derby, i have 20 cars standing in the way.
So, when player leaves vehicle, or he enters a new vehicle, i want the old car destroyed..
Thanks!