[Problema] OnPlayerUpdate
#1

Quisiese que
Por ejemplo al tener el arma 5 (M4/AK47) Guardada se "SetPlayerAttachedObject" el objeto 355 en la espalda

pawn Код:
if(GetPlayerState(playerid)  == PLAYER_STATE_ONFOOT)
    {
        new Arma[MAX_PLAYERS],Bala[MAX_PLAYERS];
        GetPlayerWeaponData(playerid, 5, Arma[playerid], Bala[playerid]);
        if(Arma[playerid] == 30 && Bala[playerid] >= 1)//Ak-47
        {
               if(GetPlayerWeapon(playerid) == 30) RemovePlayerAttachedObject(playerid,5);
               else SetPlayerAttachedObject(playerid, 5, 355, 1, -0.060921, -0.141673, 0.000000, 0.000000, 35.362735, 0.000000);
        }
    }

Pero no funciona.. Lo he colocado en OnPlayerUpdate pero no actualiza
Reply
#2

Pone asн y decime si te funcionу.

pawn Код:
if(GetPlayerState(playerid)  == PLAYER_STATE_ONFOOT)
    {
        new Arma[MAX_PLAYERS],Bala[MAX_PLAYERS];
        GetPlayerWeaponData(playerid, 5, Arma[playerid], Bala[playerid]);
        if(Arma[playerid] == 30 && Bala[playerid] >= 1)//Ak-47
        {
               if(GetPlayerWeapon(playerid) == 30)SetPlayerAttachedObject(playerid, 5, 355, 1, -0.060921, -0.141673, 0.000000, 0.000000, 35.362735, 0.000000);
               else RemovePlayerAttachedObject(playerid,5);
        }
    }
Reply
#3

No funciono aun...
Reply
#4

yo probe tu codigo y me funcionу bien, ten en cuenta que OnPlayerUpdate necesita retornar 1 para que se actualize el jugador.

No es necesario usar arrays usando MAX_PLAYERS, por que solo vas a usar 2 variables.
pawn Код:
public OnPlayerUpdate(playerid) {
    if(GetPlayerState(playerid)  == PLAYER_STATE_ONFOOT)
    {
        new Arma,Bala;
        GetPlayerWeaponData(playerid, 5, Arma, Bala);
        if(Arma == 30 && Bala >= 1)//Ak-47
        {
            if(GetPlayerWeapon(playerid) == 30) RemovePlayerAttachedObject(playerid,5);
            else SetPlayerAttachedObject(playerid, 5, 355, 1, -0.060921, -0.141673, 0.000000, 0.000000, 35.362735, 0.000000);
        }
    }
    return 1;
 }
Reply
#5

No tengo idea por que no funciona...
Borre todo el OnPlayerUpdate y solo coloque eso para probar y sigue sin funcionar
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)