#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;
}
GetVehiclePos(transformer2,info[0],info[1],info[2]);
transformer2 = AddStaticVehicle(452,info[0],info[1],info[2],info[3],0,0);
transformer2 = AddStaticVehicle(452,-2209.5,2398.5,4.6,0,0,0);
|
Originally Posted by Rizard
If this is supposed to be the normal spawnplace,
X,Y,Z,ANGLE = -2209.5,2398.5,4.6,0 Then don't get the coцrdinates from the previous vehicle but put those in stead. wrong: pawn Код:
pawn Код:
|

|
Originally Posted by Don Correlli
You can't detect keys UP, DOWN, LEFT or RIGHT at OnPlayerKeyStateChange callback, use GetPlayerKeys with the timer.
|
|
Originally Posted by Rizard
You could be a bit nicer to the only person who tries to understand your english
![]() so it wasn't the normal spawn place you meant... Quote:
|
public CheckKeys(playerid)
{
if(GetPlayerKeys(playerid)==...)
{
....
}
}
OnPlayerEnterVehicle()
{
if(vehicleid==...)
{
SetTimer("CheckKeys", 200, 1);
}
}
|
Originally Posted by Rizard
Asuming what he says is true,
You should be using a timer that checks what keys are pressed every ... milliseconds. (in stead of what you are doing atm) Using GetPlayerKeys... for example pawn Код:
|
, did you read my question i want them to respawn at the starting place, and you are trying to explain me how to make it work.