[Ajuda] Objeto no player
#1

E ai galera, seguinte to precizando da ajuda de vocкs com o seguinte:

Tф editando um sistema de escudoque achei na net, sу q tipo assim, o escudo nгo fica "no" player, ele vai meio q na frente, mais nгo preso ao player, queria saber como eu faзo pra prender o escudo ao player, o code do escudo ta ali ||
\/
pawn Код:
ObjEscudo[playerid] = CreateObject(18637,0,0,0,0,0,0,0);
AttachObjectToPlayer(ObjEscudo[playerid],playerid,0,0.4,0.43,90,1,172.0);
ApplyAnimation(playerid,"PED","FightA_block",4.1,0,1,1,1,1);
Й isso, se precizar de + algo й sу avisar.

Quem puder ajudar. Valeu!
Reply
#2

pawn Код:
if(!strcmp(cmdtext,"/escudo",true))
{
       SetPlayerAttachedObject(playerid,1,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);
       SetPlayerAttachedObject(playerid,2,18642,7,0.1,0.0,-0.11,0.0,-90.0,90.0);
       SendClientMessage(playerid, 0xAFAFAFAA," Vocк Pegou Seu Escudo!");
       return true;
}

if(!strcmp(cmdtext,"/desequipar",true))
{
      RemovePlayerAttachedObject(playerid, 1);
      RemovePlayerAttachedObject(playerid, 2);
      SendClientMessage(playerid, 0xAFAFAFAA," Vocк Retirou Seu Escudo!");
      return true;
}
Reply
#3

Vou testar se der certo posto aqui
Reply
#4

@ Jonathan_Feitosa

Cara, o escudo aparece e some em + ou - 1 seg.
O que tem d errado?
Reply
#5

PHP код:
if(strcmp(cmdtext,"/escudo",true) == 0)
{
    
RemovePlayerAttachedObject(playerid1);
    
RemovePlayerAttachedObject(playerid2);
    
SetPlayerAttachedObject(playerid,1,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);
    
SetPlayerAttachedObject(playerid,2,18642,7,0.1,0.0,-0.11,0.0,-90.0,90.0);
    
SendClientMessage(playerid0xFFFFFFFF," Vocк Pegou Seu Escudo!");
    return 
1;

Tenta.
Reply
#6

@Shadoww5

Consegui arrumar, mггs... agora bugou todos os outros comandos do server
Reply
#7

Manda o CODE de como vocк deixou o /escudo e /desequipar.
Reply
#8

Consegui corrigir o bug dos comandos beleza, sу q os tiros atravessam o escudo, como eu arrumo
Reply
#9

OnPlayerShootPlayer

if(Escudo[playerid] == 1) SetPlayetHealth(playerid/target/alguem, 100);
Reply
#10

  • Baixe esta include: https://sampforum.blast.hk/showthread.php?tid=195439
  • Coloque isto no topo do GM:

    PHP код:
    #include <OPSP>
    new Escudo[MAX_PLAYERS]; 
  • Use este comando:

    PHP код:
    if(strcmp(cmdtext,"/escudo",true) == 0)
    {
        if(
    Escudo[playerid] == 0)
        {
            
    SetPlayerAttachedObject(playerid,1,18637,13,0.35,0.0,0.0,0.0,0.0,180.0);
            
    SetPlayerAttachedObject(playerid,2,18642,7,0.1,0.0,-0.11,0.0,-90.0,90.0);
            
    SendClientMessage(playerid0xFFFFFFFF," Vocк pegou seu escudo!");
            
    Escudo[playerid] = 1;
        }
        else
        {
            
    RemovePlayerAttachedObject(playerid1);
            
    RemovePlayerAttachedObject(playerid2);
            
    SendClientMessage(playerid0xFFFFFFFF," Vocк retirou seu escudo!");
            
    Escudo[playerid] = 0;
        }
        return 
    1;

  • Entгo crie esta callback no seu GM:

    PHP код:
    public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
    {
        if(
    Escudo[Target] == 1)
        {
            new 
    Float:vida;
            
    GetPlayerHealth(Targetvida);
            
    SetPlayerHealth(Targetvida);
            return 
    1;
        }
        return 
    1;

Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)