[AJUDA]Colete com SetPlayerAttachedObject -
[R] ousenber [K] - 08.05.2011
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;
}
Re: [AJUDA]Colete com SetPlayerAttachedObject -
Macintosh - 08.05.2011
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;
}
Re: [AJUDA]Colete com SetPlayerAttachedObject -
[R] ousenber [K] - 08.05.2011
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.
Re: [AJUDA]Colete com SetPlayerAttachedObject -
Shadoww5 - 08.05.2011
PHP код:
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;
}
Re: [AJUDA]Colete com SetPlayerAttachedObject -
[R] ousenber [K] - 08.05.2011
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;
}
Re: [AJUDA]Colete com SetPlayerAttachedObject -
Shadoww5 - 08.05.2011
PHP код:
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);
else if(GetPlayerArmour(i) <= 0) return RemovePlayerAttachedObject(i,5);
}
return 1;
}
Tenta agora.
Re: [AJUDA]Colete com SetPlayerAttachedObject -
The Knight - 09.05.2011
PHP код:
public ChecarLife( playerid )
{
for(new i = 0; i<MAX_PLAYERS; i++)
{
#define Knight_Armour 5
new Float: kArmour;
GetPlayerArmour( i, kArmour );
if( IsPlayerAttachedObject( playerid, Knight_Armour ) && !kArmour) return RemovePlayerAttachedObject( i, Knight_Armour );
else if( kArmour ) return SetPlayerAttachedObject( i, Knight_Armour, 19142, 1, 0.1, 0.05, 0.0 );
}
return true;
}
Nгo sei se "1, 0.1, 0.05, 0.0" estб correto, apenas corrigi o resto.
Re: [AJUDA]Colete com SetPlayerAttachedObject -
[R] ousenber [K] - 09.05.2011
@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.
Re: [AJUDA]Colete com SetPlayerAttachedObject -
The Knight - 09.05.2011
Substitua por:
pawn Код:
IsPlayerAttachedObjectSlotUsed( i, Knight_Armour );
E coloca no topo do gamemode:
pawn Код:
#define IsPlayerHoldingObject(%1) IsPlayerAttachedObjectSlotUsed(%1,MAX_PLAYER_ATTACHED_OBJECTS-1)
Re: [AJUDA]Colete com SetPlayerAttachedObject -
[R] ousenber [K] - 09.05.2011
cara funfo! so q o colete fica branco AFFZ