21.02.2010, 13:32
I have made a FS with transforming cars (i made it with help of looking into the existing transformer FS) and it works, but when i transform the car into another one it respawns at the last place it transformed but i don't want that i want it to respawn at the normal spawn place Here is the FS:
pawn Код:
#include <a_samp>
new transformer2;
public OnFilterScriptInit()
{
print("Transformer filterscript by [RTA]Dave"); //DO NOT remove these credits!
transformer2 = AddStaticVehicleEx(411,-2209.5,2398.5,4.6,0,0,0,120);
LinkVehicleToInterior(transformer2,1);
cloaked = 1;
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
new Float:info[7],model;
if (IsPlayerInVehicle(playerid,transformer2))
{
if (newkeys & KEY_ANALOG_LEFT)
{
GetVehicleVelocity(transformer2,info[4],info[5],info[6]);
GetVehiclePos(transformer2,info[0],info[1],info[2]);
GetVehicleZAngle(transformer2,info[3]);
GetVehicleModel(model);
DestroyVehicle(transformer2);
transformer2 = AddStaticVehicle(452,info[0],info[1],info[2],info[3],0,0);
PutPlayerInVehicle(playerid,transformer2,0);
PlayerPlaySound(playerid,1133,0,0,0);
SetVehicleVelocity(transformer2,info[4],info[5],info[6]);
}
if (newkeys & KEY_ANALOG_RIGHT)
{
GetVehicleVelocity(transformer2,info[4],info[5],info[6]);
GetVehiclePos(transformer2,info[0],info[1],info[2]);
GetVehicleZAngle(transformer2,info[3]);
GetVehicleModel(model);
DestroyVehicle(transformer2);
transformer2 = AddStaticVehicle(519,info[0],info[1],info[2],info[3],0,0);
PutPlayerInVehicle(playerid,transformer2,0);
PlayerPlaySound(playerid,1133,0,0,0);
SetVehicleVelocity(transformer2,info[4],info[5],info[6]);
}
if (newkeys & KEY_ANALOG_DOWN)
{
GetVehicleVelocity(transformer2,info[4],info[5],info[6]);
GetVehiclePos(transformer2,info[0],info[1],info[2]);
GetVehicleZAngle(transformer2,info[3]);
GetVehicleModel(model);
DestroyVehicle(transformer2);
transformer2 = AddStaticVehicle(411,info[0],info[1],info[2],info[3],0,0);
PutPlayerInVehicle(playerid,transformer2,0);
PlayerPlaySound(playerid,1133,0,0,0);
SetVehicleVelocity(transformer2,info[4],info[5],info[6]);
}
if (newkeys & KEY_ANALOG_UP)
{
GetVehicleVelocity(transformer2,info[4],info[5],info[6]);
GetVehiclePos(transformer2,info[0],info[1],info[2]);
GetVehicleZAngle(transformer2,info[3]);
GetVehicleModel(model);
DestroyVehicle(transformer2);
transformer2 = AddStaticVehicle(522,info[0],info[1],info[2],info[3],0,0);
PutPlayerInVehicle(playerid,transformer2,0);
PlayerPlaySound(playerid,1133,0,0,0);
SetVehicleVelocity(transformer2,info[4],info[5],info[6]);
}
if (newkeys & KEY_SUBMISSION)
{
if(cloaked == 1)
{
LinkVehicleToInterior(transformer2,0);
cloaked = 0;
return 1;
}
}
}
return 1;
}