Combine 2 scripts
#8

Try This:
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys == KEY_SECONDARY_ATTACK)
    {
        if(!IsPlayerInAnyVehicle(playerid))
        {
            new Float:x, Float:y, Float:z, vehicle;
            GetPlayerPos(playerid, x, y, z);
            GetVehicleWithinDistance(playerid, x, y, z, 20.0, vehicle);
            if(IsVehicleRc(vehicle))
            {
                PutPlayerInVehicle(playerid, vehicle, 0);
            }
        }
        else
        {
            new vehicleID = GetPlayerVehicleID(playerid);
            if(IsVehicleRc(vehicleID) || GetVehicleModel(vehicleID) == RC_CAM)
            {
                if(GetVehicleModel(vehicleID) != D_TRAM)
                {
                    new Float:x, Float:y, Float:z;
                    GetPlayerPos(playerid, x, y, z);
                    SetPlayerPos(playerid, x+0.5, y, z+1.0);
                }
            }
        }
    }
    if(!gPlayerUsingLoopingAnim[playerid]) return 1;
    if(IsKeyJustDown(KEY_SECONDARY_ATTACK,newkeys,oldkeys))
    {
        StopLoopingAnim(playerid);
        TextDrawHideForPlayer(playerid,txtAnimHelper);
    }
    if(PRESSED(KEY_FIRE)) AddVehicleComponent(GetPlayerVehicleID(playerid),1010);
    if(newkeys & KEY_SUBMISSION)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if((GetPlayerVehicleID(playerid) == 520) || (GetPlayerVehicleID(playerid) == 425) || (GetPlayerVehicleID(playerid) == 464)) return 1;
            else
            {
                new Float:vx, Float:vy, Float:vz;
                GetVehicleVelocity(GetPlayerVehicleID(playerid), vx, vy, vz);
                SetVehicleVelocity(GetPlayerVehicleID(playerid) ,vx*2,vy*2 ,vz*2);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
Combine 2 scripts - by kbalor - 22.07.2012, 15:30
Re: Combine 2 scripts - by SuperViper - 22.07.2012, 16:01
Re: Combine 2 scripts - by kbalor - 22.07.2012, 16:25
Re: Combine 2 scripts - by Rob_Maate - 22.07.2012, 16:32
Re: Combine 2 scripts - by kbalor - 22.07.2012, 16:38
Re: Combine 2 scripts - by Rob_Maate - 22.07.2012, 17:18
Re: Combine 2 scripts - by kbalor - 22.07.2012, 17:57
Re: Combine 2 scripts - by Andi_Evandy - 23.07.2012, 14:45
Re: Combine 2 scripts - by kbalor - 23.07.2012, 15:53

Forum Jump:


Users browsing this thread: 1 Guest(s)