[AJUDA]Colete com SetPlayerAttachedObject
#1

ai to com um erro tava vendo uns nigoso poraй e achei um comando q quando digita /colete aparece um colete so q ele fica branco , aq ta tudo o q o comando tem, ajudem-me plz '--'

pawn Код:
TOPO DO GM
forward ChecarLife(playerid)

ONGAMEMODEINIT
SetTimer("ChecarLife",500,true);

ONPLAYERCOMMANDTEXT
    if(strcmp(cmdtext, "/colete", true) == 0)
    {
    SetPlayerArmour(playerid, 100);
    SetPlayerAttachedObject(playerid, 0, 19142, 1, 0.084367, 0.041716, 0.017513, 3.662353, 355.182006, 0.181060, 1.000000, 1.000000, 1.000000 );
    }

FINAL DO GM
public ChecarLife()
{
   for(new i = 0; i <MAX_PLAYERS; i++) if(IsPlayerConnected(i))
   {
       static HP;
       GetPlayerArmour(i,HP);
       if(GetPlayerArmour(i) > 0)
                                  SetPlayerAttachedObject(i,5,19142,1,0.1,0.05,0.0,0.0,0.0,0.0);
       else
            RemovePlayerAttachedObject(i,5);
   }
   return true;
}
Reply
#2

Tente isto.

pawn Код:
public ChecarLife()
{
  for(new i = 0; i<MAX_PLAYERS; i++)
  {
    if(GetPlayerArmour(x) >= 1) return SetPlayerAttachedObject(x,5,19142,1,0.1,0.05,0.0,0.0,0.0,0.0);
    else if(GetPlayerArmour(x) <= 0) return RemovePlayerAttachedObject(x,5);        
  }
  return 1;
}
Reply
#3

deu estes erros

pawn Код:
C:\Users\Washington\Desktop\testes\gamemodes\new.pwn(616) : warning 235: public function lacks forward declaration (symbol "ChecarLife")
C:\Users\Washington\Desktop\testes\gamemodes\new.pwn(620) : error 017: undefined symbol "x"
C:\Users\Washington\Desktop\testes\gamemodes\new.pwn(620) : error 017: undefined symbol "x"
C:\Users\Washington\Desktop\testes\gamemodes\new.pwn(621) : error 017: undefined symbol "x"
C:\Users\Washington\Desktop\testes\gamemodes\new.pwn(621) : error 017: undefined symbol "x"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

PHP код:
public ChecarLife(playerid)
{
  for(new 
0i<MAX_PLAYERSi++)
  {
    if(
GetPlayerArmour(i) >= 1) return SetPlayerAttachedObject(i,5,19142,1,0.1,0.05,0.0,0.0,0.0,0.0);
    else if(
GetPlayerArmour(i) <= 0) return RemovePlayerAttachedObject(i,5);        
  }
  return 
1;

Reply
#5

cara fica dando esses warnings( warnings da @$@%#Ё&! )

pawn Код:
C:\Users\Washington\Desktop\testes\gamemodes\MxP.pwn(665) : warning 202: number of arguments does not match definition
C:\Users\Washington\Desktop\testes\gamemodes\MxP.pwn(666) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase

Header size:           4004 bytes
Code size:            28000 bytes
Data size:           136284 bytes
Stack/heap size:      16384 bytes; estimated max. usage=5016 cells (20064 bytes)
Total requirements:  184672 bytes

2 Warnings.
aonde da o warning e o comando que vc me passou

pawn Код:
public ChecarLife(playerid)
{
  for(new i = 0; i<MAX_PLAYERS; i++)
  {
    if(GetPlayerArmour(i) >= 1) return SetPlayerAttachedObject(i,5,19142,1,0.1,0.05,0.0,0.0,0.0,0.0);
    else if(GetPlayerArmour(i) <= 0) return RemovePlayerAttachedObject(i,5);        
  }
  return 1;
}
Reply
#6

PHP код:
public ChecarLife(playerid)
{
  for(new 
0i<MAX_PLAYERSi++)
  {
    if(
GetPlayerArmour(i) >= 1) return SetPlayerAttachedObject(i,5,19142,1,0.1,0.05,0.0);
    else if(
GetPlayerArmour(i) <= 0) return RemovePlayerAttachedObject(i,5);        
  }
  return 
1;

Tenta agora.
Reply
#7

PHP код:
public ChecarLifeplayerid )
{
   for(new 
0i<MAX_PLAYERSi++)
   {
      
#define Knight_Armour 5
      
new FloatkArmour;
      
GetPlayerArmourikArmour );
      if( 
IsPlayerAttachedObjectplayeridKnight_Armour ) && !kArmour) return RemovePlayerAttachedObjectiKnight_Armour );
      else if( 
kArmour ) return SetPlayerAttachedObjectiKnight_Armour1914210.10.050.0 );
   }
   return 
true;

Nгo sei se "1, 0.1, 0.05, 0.0" estб correto, apenas corrigi o resto.
Reply
#8

@Shadow
continua com os 2 warnings!

@Knight
nao deu warnings mais deu 1 erro

pawn Код:
C:\Users\Washington\Desktop\testes\gamemodes\MxP.pwn(710) : error 017: undefined symbol "IsPlayerAttachedObject"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#9

Substitua por:
pawn Код:
IsPlayerAttachedObjectSlotUsed( i, Knight_Armour );
E coloca no topo do gamemode:
pawn Код:
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
Reply
#10

cara funfo! so q o colete fica branco AFFZ
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)