[AJU]Key movimentar objeto
#6

@Garfield:
Nгo esta Tudo errado,ele precisa Apenas de um GetPos para arrumar tudo isso..

@BieL:
Cara vocк nгo deve achar que seu trabalho esta errado por opiniгo de outros,FikDik

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new Float:X;
    new Float:Y;
    new Float:Z;
    GetObjectPos(Navio[19], X, Y, Z);
    if((newkeys ==  KEY_WALK) || (newkeys ==  KEY_UP) && (DirigindoNavio[playerid] = 1))
    {
       
        MoveObject(Navio[19], X+2, Y, Z, 8.0);
        return 1;
    }
    if(((newkeys) ==  KEY_WALK) || (newkeys ==  KEY_UP) && (newkeys == KEY_RIGHT) && (DirigindoNavio[playerid] = 1))
    {
         
        MoveObject(Navio[19], X+2, Y+2, Z, 8.0);
        return 1;
    }
    if(((newkeys) ==  KEY_DOWN) || (newkeys ==  KEY_DOWN) && (newkeys == KEY_LEFT) && (DirigindoNavio[playerid] = 1))
    {
        MoveObject(Navio[19], X-2, Y-2, Z, 5.0);
        return 1;
    }
    if(((newkeys) ==  KEY_DOWN) || (newkeys ==  KEY_DOWN) && (newkeys == KEY_RIGHT) && (DirigindoNavio[playerid] = 1))
    {
        MoveObject(Navio[19], X-2, Y+2, Z, 5.0);
        return 1;
    }
    return 1;
}
Caso nгo de Tente:


pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new Float:X;
    new Float:Y;
    new Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    if((newkeys ==  KEY_WALK) || (newkeys ==  KEY_UP) && (DirigindoNavio[playerid] = 1))
    {
       
        MoveObject(Navio[19], X+2, Y, Z, 8.0);
        return 1;
    }
    if(((newkeys) ==  KEY_WALK) || (newkeys ==  KEY_UP) && (newkeys == KEY_RIGHT) && (DirigindoNavio[playerid] = 1))
    {
         
        MoveObject(Navio[19], X+2, Y+2, Z, 8.0);
        return 1;
    }
    if(((newkeys) ==  KEY_DOWN) || (newkeys ==  KEY_DOWN) && (newkeys == KEY_LEFT) && (DirigindoNavio[playerid] = 1))
    {
        MoveObject(Navio[19], X-2, Y-2, Z, 5.0);
        return 1;
    }
    if(((newkeys) ==  KEY_DOWN) || (newkeys ==  KEY_DOWN) && (newkeys == KEY_RIGHT) && (DirigindoNavio[playerid] = 1))
    {
        MoveObject(Navio[19], X-2, Y+2, Z, 5.0);
        return 1;
    }
    return 1;
}
@EDIT:
Uma linha alн pode arrumar Tudo Creio... (GetPos
Reply


Messages In This Thread
[AJU]Key movimentar objeto - by BiieL - 27.08.2010, 23:13
Re: [AJU]Key movimentar objeto - by Canabis - 27.08.2010, 23:35
Re: [AJU]Key movimentar objeto - by BiieL - 27.08.2010, 23:41
Re: [AJU]Key movimentar objeto - by zSuYaNw - 27.08.2010, 23:46
Re: [AJU]Key movimentar objeto - by BiieL - 27.08.2010, 23:47
Respuesta: [AJU]Key movimentar objeto - by ipsBruno - 28.08.2010, 00:25
Re: [AJU]Key movimentar objeto - by BiieL - 28.08.2010, 01:02
Re: [AJU]Key movimentar objeto - by SuB_ZeRo0_ - 28.08.2010, 01:16
Re: [AJU]Key movimentar objeto - by BiieL - 28.08.2010, 01:36
Re: [AJU]Key movimentar objeto - by CyNiC - 28.08.2010, 01:39

Forum Jump:


Users browsing this thread: 2 Guest(s)