[Ajuda] OnPlayerUpdate
#1

Queria ajuda de voces pra adicionar esse codigo na public onplayerupdate abaixo.


esse code aqui na public abaixo
pawn Код:
if (GetPVarInt(playerid, "laser")) {
                RemovePlayerAttachedObject(playerid, 0);
                if ((IsPlayerInAnyVehicle(playerid)) || (IsPlayerInWater(playerid))) return 1;
                switch (GetPlayerWeapon(playerid)) {
                        case 23: {
                                if (IsPlayerAiming(playerid)) {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing aiming
                                                0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched aiming
                                                0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);
                                        }
                                } else {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing not aiming
                                                0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched not aiming
                                                0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
                        }       }       }
                        case 27: {
                                if (IsPlayerAiming(playerid)) {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing aiming
                                                0.588246, -0.022766, 0.138052, -11.531745, 347.712585, 352.784271);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched aiming
                                                0.588246, -0.022766, 0.138052, 1.468254, 350.712585, 352.784271);
                                        }
                                } else {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing not aiming
                                                0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched not aiming
                                                0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
                        }       }       }
                        case 30: {
                                if (IsPlayerAiming(playerid)) {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing aiming
                                                0.628249, -0.027766, 0.078052, -6.621746, 352.552642, 355.084289);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched aiming
                                                0.628249, -0.027766, 0.078052, -1.621746, 356.202667, 355.084289);
                                        }
                                } else {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing not aiming
                                                0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched not aiming
                                                0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
                        }       }       }
                        case 31: {
                                if (IsPlayerAiming(playerid)) {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing aiming
                                                0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched aiming
                                                0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);
                                        }
                                } else {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing not aiming
                                                0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched not aiming
                                                0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
                        }       }       }
            case 34: {
                if (IsPlayerAiming(playerid)) {
                    return 1;
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper standing not aiming
                        0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper crouched not aiming
                        0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
            }   }   }
                        case 29: {
                                if (IsPlayerAiming(playerid)) {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing aiming
                                                0.298249, -0.02776, 0.158052, -11.631746, 359.302673, 357.584259);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched aiming
                                                0.298249, -0.02776, 0.158052, 8.368253, 358.302673, 352.584259);
                                        }
                                } else {
                                        if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing not aiming
                                                0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
                                        } else {
                                                SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched not aiming
                                                0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
        }       }       }       }       }
        return 1;
}



pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
            for(new i = 0; i < sizeof(SpikeInfo); i++)
            {
                if(IsPlayerInRangeOfPoint(playerid, 3.1, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
                {
                    if(SpikeInfo[i][sCreated] == 1)
                    {
                        new panels, doors, luzes, tires;
                        new carid = GetPlayerVehicleID(playerid);
                        GetVehicleDamageStatus(carid, panels, doors, luzes, tires);
                        tires = encode_tires(1, 1, 1, 1);
                        UpdateVehicleDamageStatus(carid, panels, doors, luzes, tires);
                    }
                }
            }
        }
    //}
    return 1;
}
Reply
#2

Nгo sei se vai funcionar simplismente peguei e adicionei o cуdigo ai dentro '-'

pawn Код:
public OnPlayerUpdate(playerid)
{
    if (GetPVarInt(playerid, "laser")) {
        RemovePlayerAttachedObject(playerid, 0);
        if ((IsPlayerInAnyVehicle(playerid)) || (IsPlayerInWater(playerid))) return 1;
        switch (GetPlayerWeapon(playerid)) {
            case 23: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing aiming
                        0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched aiming
                        0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing not aiming
                        0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched not aiming
                        0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
                    }       }       }
            case 27: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing aiming
                        0.588246, -0.022766, 0.138052, -11.531745, 347.712585, 352.784271);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched aiming
                        0.588246, -0.022766, 0.138052, 1.468254, 350.712585, 352.784271);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing not aiming
                        0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched not aiming
                        0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
                    }       }       }
            case 30: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing aiming
                        0.628249, -0.027766, 0.078052, -6.621746, 352.552642, 355.084289);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched aiming
                        0.628249, -0.027766, 0.078052, -1.621746, 356.202667, 355.084289);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing not aiming
                        0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched not aiming
                        0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
                    }       }       }
            case 31: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing aiming
                        0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched aiming
                        0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing not aiming
                        0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched not aiming
                        0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
                    }       }       }
            case 34: {
                if (IsPlayerAiming(playerid)) {
                    return 1;
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper standing not aiming
                        0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper crouched not aiming
                        0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
                    }   }   }
            case 29: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing aiming
                        0.298249, -0.02776, 0.158052, -11.631746, 359.302673, 357.584259);
                    }
                    else
                    {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched aiming
                        0.298249, -0.02776, 0.158052, 8.368253, 358.302673, 352.584259);
                    }
                }
                else
                {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing not aiming
                        0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
                    }
                    else
                    {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched not aiming
                        0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
                    }       }       }       }      
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
           
            for(new i = 0; i < sizeof(SpikeInfo); i++)
            {
               
                if(IsPlayerInRangeOfPoint(playerid, 3.1, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
                {
                   
                    if(SpikeInfo[i][sCreated] == 1)
                    {
                       
                        new panels, doors, luzes, tires;
                        new carid = GetPlayerVehicleID(playerid);
                        GetVehicleDamageStatus(carid, panels, doors, luzes, tires);
                        tires = encode_tires(1, 1, 1, 1);
                        UpdateVehicleDamageStatus(carid, panels, doors, luzes, tires);
                    }
                }
            }
        }
    return 1;
}
Reply
#3

Quote:
Originally Posted by focaximubh
Посмотреть сообщение
Nгo sei se vai funcionar simplismente peguei e adicionei o cуdigo ai dentro '-'

pawn Код:
public OnPlayerUpdate(playerid)
{
    if (GetPVarInt(playerid, "laser")) {
        RemovePlayerAttachedObject(playerid, 0);
        if ((IsPlayerInAnyVehicle(playerid)) || (IsPlayerInWater(playerid))) return 1;
        switch (GetPlayerWeapon(playerid)) {
            case 23: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing aiming
                        0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched aiming
                        0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing not aiming
                        0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched not aiming
                        0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
                    }       }       }
            case 27: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing aiming
                        0.588246, -0.022766, 0.138052, -11.531745, 347.712585, 352.784271);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched aiming
                        0.588246, -0.022766, 0.138052, 1.468254, 350.712585, 352.784271);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing not aiming
                        0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched not aiming
                        0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
                    }       }       }
            case 30: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing aiming
                        0.628249, -0.027766, 0.078052, -6.621746, 352.552642, 355.084289);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched aiming
                        0.628249, -0.027766, 0.078052, -1.621746, 356.202667, 355.084289);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing not aiming
                        0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched not aiming
                        0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
                    }       }       }
            case 31: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing aiming
                        0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched aiming
                        0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing not aiming
                        0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched not aiming
                        0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
                    }       }       }
            case 34: {
                if (IsPlayerAiming(playerid)) {
                    return 1;
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper standing not aiming
                        0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper crouched not aiming
                        0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
                    }   }   }
            case 29: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing aiming
                        0.298249, -0.02776, 0.158052, -11.631746, 359.302673, 357.584259);
                    }
                    else
                    {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched aiming
                        0.298249, -0.02776, 0.158052, 8.368253, 358.302673, 352.584259);
                    }
                }
                else
                {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing not aiming
                        0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
                    }
                    else
                    {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched not aiming
                        0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
                    }       }       }       }      
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
           
            for(new i = 0; i < sizeof(SpikeInfo); i++)
            {
               
                if(IsPlayerInRangeOfPoint(playerid, 3.1, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
                {
                   
                    if(SpikeInfo[i][sCreated] == 1)
                    {
                       
                        new panels, doors, luzes, tires;
                        new carid = GetPlayerVehicleID(playerid);
                        GetVehicleDamageStatus(carid, panels, doors, luzes, tires);
                        tires = encode_tires(1, 1, 1, 1);
                        UpdateVehicleDamageStatus(carid, panels, doors, luzes, tires);
                    }
                }
            }
        }
    return 1;
}
Deu 26 erros
Reply
#4

@EDITІ

Sу para lembrar {26 erros} costumam ser faltas de { } tanto abertos quanto fechados tem um treko que й identificador de linhas ele identifica a linha EXATA onde estб faltando o { }...


Tente agora pf

pawn Код:
public OnPlayerUpdate(playerid)
{
    if (GetPVarInt(playerid, "laser")) {
        RemovePlayerAttachedObject(playerid, 0);
        if ((IsPlayerInAnyVehicle(playerid)) || (IsPlayerInWater(playerid))) return 1;
        switch (GetPlayerWeapon(playerid)) {
            case 23: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing aiming
                        0.108249, 0.030232, 0.118051, 1.468254, 350.512573, 364.284240);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched aiming
                        0.108249, 0.030232, 0.118051, 1.468254, 349.862579, 364.784240);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP standing not aiming
                        0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SP crouched not aiming
                        0.078248, 0.027239, 0.113051, -11.131746, 350.602722, 362.384216);
                    }       }       }
            case 27:
              {
                if (IsPlayerAiming(playerid))
                 {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing aiming
                        0.588246, -0.022766, 0.138052, -11.531745, 347.712585, 352.784271);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched aiming
                        0.588246, -0.022766, 0.138052, 1.468254, 350.712585, 352.784271);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS standing not aiming
                        0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // SPAS crouched not aiming
                        0.563249, -0.01976, 0.134051, -11.131746, 351.602722, 351.384216);
                    }       }       }      }
            case 30: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing aiming
                        0.628249, -0.027766, 0.078052, -6.621746, 352.552642, 355.084289);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched aiming
                        0.628249, -0.027766, 0.078052, -1.621746, 356.202667, 355.084289);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK standing not aiming
                        0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // AK crouched not aiming
                        0.663249, -0.02976, 0.080051, -11.131746, 358.302734, 353.384216);
                    }       }       }
            case 31: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing aiming
                        0.528249, -0.020266, 0.068052, -6.621746, 352.552642, 355.084289);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched aiming
                        0.528249, -0.020266, 0.068052, -1.621746, 356.202667, 355.084289);
                    }
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 standing not aiming
                        0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // M4 crouched not aiming
                        0.503249, -0.02376, 0.065051, -11.131746, 357.302734, 354.484222);
                    }       }       }
            case 34: {
                if (IsPlayerAiming(playerid)) {
                    return 1;
                } else {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper standing not aiming
                        0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
                    } else {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // Sniper crouched not aiming
                        0.658248, -0.03276, 0.133051, -11.631746, 355.302673, 353.584259);
                    }   }   }
            case 29: {
                if (IsPlayerAiming(playerid)) {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing aiming
                        0.298249, -0.02776, 0.158052, -11.631746, 359.302673, 357.584259);
                    }
                    else
                    {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched aiming
                        0.298249, -0.02776, 0.158052, 8.368253, 358.302673, 352.584259);
                    }
                }
                else
                {
                    if (GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 standing not aiming
                        0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
                    }
                    else
                    {
                        SetPlayerAttachedObject(playerid, 0, GetPVarInt(playerid, "color"), 6, // MP5 crouched not aiming
                        0.293249, -0.027759, 0.195051, -12.131746, 354.302734, 352.484222);
                    }       }       }       }      
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
           
            for(new i = 0; i < sizeof(SpikeInfo); i++)
            {
               
                if(IsPlayerInRangeOfPoint(playerid, 3.1, SpikeInfo[i][sX], SpikeInfo[i][sY], SpikeInfo[i][sZ]))
                {
                   
                    if(SpikeInfo[i][sCreated] == 1)
                    {
                       
                        new panels, doors, luzes, tires;
                        new carid = GetPlayerVehicleID(playerid);
                        GetVehicleDamageStatus(carid, panels, doors, luzes, tires);
                        tires = encode_tires(1, 1, 1, 1);
                        UpdateVehicleDamageStatus(carid, panels, doors, luzes, tires);
                    }
                }
            }
        }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)