1st Person Driving Question
#1

Hello this is code for FS 1st Person Vehicle Driving. http://pastebin.com/xUacgAEN
How can i make this to be without CMD (Command) .. When i entry in vehicle, to be automatic With 1stPerson ? ? How must be the CODE ?
Reply
#2

Try to use OnPlayerEnterVehicle.
Reply
#3

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
if(GetPVarInt(playerid,"used") == 0)
{
new p = GetPlayerVehicleID(playerid);
obj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
AttachPlayerObjectToVehicle(playerid,obj[playerid],p,-0.314999, -0.195000, 0.510000, 0.000000, 0.000000, 0.000000);
AttachCameraToPlayerObject(playerid,obj[playerid]);
SetPVarInt(playerid,"used",1);
}
else if(GetPVarInt(playerid,"used") == 1)
{
SetCameraBehindPlayer(playerid);
DestroyPlayerObject(playerid,obj[playerid]);
SetPVarInt(playerid,"used",0);
}
}
if(newstate == PLAYER_STATE_ONFOOT)
{
if(GetPVarInt(playerid,"used") == 1)
{
SetPVarInt(playerid,"used",0);
SetCameraBehindPlayer(playerid);
DestroyPlayerObject(playerid,obj[playerid]);
}
}
return 1;
}
I hope it helps you!
Reply
#4

Works, Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)