Posts: 1,239
Threads: 16
Joined: Mar 2011
Reputation:
0
That's very good idea. I might try to script something like that, can you wait till tomorrow?
Posts: 1,504
Threads: 109
Joined: Jan 2012
Quote:
Originally Posted by [MG]Dimi
pawn Код:
#include <a_samp>
public OnPlayerKeyStateChange(playerid,newkeys,oldkeys) { if(newkeys & KEY_SUBMISSION) { if(IsPlayerInAnyVehicle(playerid)) { new Float:Speed[3],Float:Pos[4],id; id = GetPlayerVehicleID(playerid); GetVehicleVelocity(id,Speed[0],Speed[1],Speed[2]); GetVehiclePos(id,Pos[0],Pos[1],Pos[2]); GetVehicleZAngle(id,Pos[3]); SetVehiclePos(id,Pos[0]+(40*floatcos(90+Pos[3],degrees)),Pos[1]+(40*floatsin(90+Pos[3],degrees)),Pos[2]); SetVehicleZAngle(id,Pos[3]); SetVehicleVelocity(id,Speed[0],Speed[1],Speed[2]); } } return 1; }
Use it only while on flat, not while going uphill. I can improve it ofc if you want
|
This is freaking cool, I might edit this code for On-foot and use it, thanks!
Posts: 1,504
Threads: 109
Joined: Jan 2012
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_SUBMISSION)
{
new Float:Speed[3],Float:Pos[4];
GetPlayerVelocity(playerid,Speed[0],Speed[1],Speed[2]);
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
GetPlayerFacingAngle(playerid,Pos[3]);
SetPlayerPos(playerid,Pos[0]+(40*floatcos(90+Pos[3],degrees)),Pos[1]+(40*floatsin(90+Pos[3],degrees)),Pos[2]);
SetPlayerFacingAngle(playerid,Pos[3]);
SetPlayerVelocity(playerid,Speed[0],Speed[1],Speed[2]);
}
return 1;
}
The only problem with it is that you can go through objects.