[Ajuda] Pawn.RakNet objetos
#1

Olб, estou tentando fazer um sistema pra esconder objetos anexados na cabeзa do jogador apenas para ele e ficar visнvel para os outros jogadores utilizando Pawn.RakNet, sendo assim, nгo atrapalha na mira, pra isso usei OnPlayerKeyStateChange, quando o sistema verifica que o jogador estб na mira, eu uso BS_RPC e BS_WriteValue pra esconder, mas quando o jogador sai da mira simplesmente o objeto nгo volta

Macros

PHP Code:
// HOLDING(keys)
#define HOLDING(%0) \
    
((newkeys & (%0)) == (%0))
#define RELEASED(%0) \
    
(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) 
Cуdigo no OnPlayerKeyStateChange

PHP Code:
    if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
    {
        if(
HOLDING(128))
        {
            if(
GetPlayerWeapon(playerid) == 34)
            {
                if(
IsPlayerAttachedObjectSlotUsed(playerid0))
                {
                    new 
BitStream:bs BS_New();
                    
BS_WriteValue(bs
                        
PR_UINT16playerid,
                        
PR_UINT320,
                        
PR_BOOL0);
                    
BS_RPC(bsplayerid113);
                    
BS_Delete(bs);
                }    
            }
        }
        else if(
RELEASED(128))
        {
            if(
IsPlayerAttachedObjectSlotUsed(playerid0))
            {
                new 
BitStream:bs BS_New();
        
                
BS_WriteValue(
                            
bs
                            
PR_UINT16playerid
                            
PR_UINT320,
                            
PR_BOOL1,
                            
PR_INT32e_Player_Attached[playerid][ObjID],
                            
PR_UINT32e_Player_Attached[playerid][BoneID],
                            
PR_FLOATe_Player_Attached[playerid][oPosX],
                            
PR_FLOATe_Player_Attached[playerid][oPosY],
                            
PR_FLOATe_Player_Attached[playerid][oPosZ],
                            
PR_FLOATe_Player_Attached[playerid][orPosX],
                            
PR_FLOATe_Player_Attached[playerid][orPosY],
                            
PR_FLOATe_Player_Attached[playerid][orPosZ],
                            
PR_FLOATe_Player_Attached[playerid][oScaleX],
                            
PR_FLOATe_Player_Attached[playerid][oScaleY],
                            
PR_FLOATe_Player_Attached[playerid][oScaleZ]
                            );  
                
BS_RPC(bsplayerid113); 
                
BS_Delete(bs); 
            }
        }
    } 
Enum

PHP Code:
enum ATTACH_DATA_OBJ
{
    
ObjID,
    
BoneID,
    
Float:oPosX,
    
Float:oPosY,
    
Float:oPosZ,
    
Float:orPosX,
    
Float:orPosY,
    
Float:orPosZ,
    
Float:oScaleX,
    
Float:oScaleY,
    
Float:oScaleZ
};
new 
e_Player_Attached[MAX_PLAYERS][ATTACH_DATA_OBJ]; 
Reply


Messages In This Thread
Pawn.RakNet objetos - by Electrifying - 04.12.2018, 00:55
Re: Pawn.RakNet objetos - by Injury - 04.12.2018, 08:39
Re: Pawn.RakNet objetos - by Electrifying - 04.12.2018, 14:47
Re: Pawn.RakNet objetos - by Domingues - 04.12.2018, 15:00
Re: Pawn.RakNet objetos - by Electrifying - 04.12.2018, 15:49
Re: Pawn.RakNet objetos - by ipsLuan - 04.12.2018, 16:05
Re: Pawn.RakNet objetos - by Injury - 04.12.2018, 16:06
Re: Pawn.RakNet objetos - by Electrifying - 04.12.2018, 16:39
Re: Pawn.RakNet objetos - by matheusdorado - 04.12.2018, 16:46
Re: Pawn.RakNet objetos - by Electrifying - 04.12.2018, 17:14

Forum Jump:


Users browsing this thread: 2 Guest(s)