DAMN IT DOESN'T WORK PROPERLY!
#3

Add this somewhere in your script...

pawn Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
...and then...

pawn Код:
if((newkeys & KEY_FIRE) && (GetPlayerState(playerid) == 2))
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    GetXYInFrontOfPlayer(playerid, x, y, 1.0);
    SetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, 0.0);
}
You don't need to check IsPlayerInAnyVehicle because GetPlayerState already does that.
Reply


Messages In This Thread
DAMN IT DOESN'T WORK PROPERLY! - by stieben - 20.01.2010, 18:41
Re: DAMN IT DOESN'T WORK PROPERLY! - by timmehhh - 20.01.2010, 18:43
Re: DAMN IT DOESN'T WORK PROPERLY! - by MadeMan - 20.01.2010, 19:14
Re: DAMN IT DOESN'T WORK PROPERLY! - by Daren_Jacobson - 20.01.2010, 19:16
Re: DAMN IT DOESN'T WORK PROPERLY! - by MadeMan - 20.01.2010, 19:19
Re: DAMN IT DOESN'T WORK PROPERLY! - by stieben - 21.01.2010, 15:38
Re: DAMN IT DOESN'T WORK PROPERLY! - by stieben - 21.01.2010, 16:04
Re: DAMN IT DOESN'T WORK PROPERLY! - by MadeMan - 21.01.2010, 16:52
Re: DAMN IT DOESN'T WORK PROPERLY! - by stieben - 22.01.2010, 14:08

Forum Jump:


Users browsing this thread: 1 Guest(s)