Galera me ajuda ! -
Petrick™ - 15.09.2012
Tipo coloquei um sistema legal de colete no meu sv, mais quando eu uso o colete ele funfa normal, mais com meus amigos nгo, quando eles usa funfa normal ai quando eu tento usar com migo с funfa eu acho que й max_players para aparecer o colete para todo mundo do servidor usar tbm olhe:
PHP код:
forward VerColete(playerid);
public VerColete(playerid)
{
new Float:colete;
GetPlayerArmour(playerid, colete);
if(colete >= 1)
{
SetPlayerAttachedObject(playerid,1,373,1,0.33,-0.029,-0.15,65,25,35);
}
else
{
RemovePlayerAttachedObject(playerid, 1);
}
return 1;
}
Re: Galera me ajuda ! -
Douglas_prt - 15.09.2012
Voce estб colocando esse 'check' na callback OnPlayerUpdate?
Re: Galera me ajuda ! -
Petrick™ - 15.09.2012
Quote:
Originally Posted by Douglas_prt
Voce estб colocando esse 'check' na callback OnPlayerUpdate?
|
no: OnGameModeInit coloquei:
PHP код:
SetTimer("VerColete", 1000, true);
No final do gamemode coloquei:
PHP код:
forward VerColete(playerid);
public VerColete(playerid)
{
new Float:colete;
GetPlayerArmour(playerid, colete);
if(colete >= 1)
{
SetPlayerAttachedObject(playerid,1,373,1,0.33,-0.029,-0.15,65,25,35);
}
else
{
RemovePlayerAttachedObject(playerid, 1);
}
return 1;
}
no: OnPlayerDisconnect coloquei
PHP код:
RemovePlayerAttachedObject(playerid, 1);
no OnGameModeExit: coloquei
PHP код:
for(new dj = 0; dj < MAX_PLAYERS; dj++)
{
RemovePlayerAttachedObject(dj, 1);
}
Re: Galera me ajuda ! -
Douglas_prt - 15.09.2012
pawn Код:
public OnPlayerUpdate(playerid)
{
VerColete(playerid);
return 1;
}
Retire tudo das outras callbacks (OnGamemodeInit, OnPlayerDisc...), use apenas a OnPlayerUpdate, porque esta vai verifica automaticamente as mudanзas no estado do jogador... Vida, Colete, etc...
Pode vir a dar um pouco de Lag
Re: Galera me ajuda ! -
Petrick™ - 15.09.2012
Quote:
Originally Posted by Douglas_prt
pawn Код:
public OnPlayerUpdate(playerid) { VerColete(playerid); return 1; }
Retire tudo das outras callbacks (OnGamemodeInit, OnPlayerDisc...), use apenas a OnPlayerUpdate
Pode vir a dar um pouco de Lag
|
deu erro
PHP код:
C:\Documents and Settings\Petrick\Desktop\SV11\gamemodes\BM.pwn(14560) : error 021: symbol already defined: "OnPlayerUpdate"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
Re: Galera me ajuda ! -
Douglas_prt - 15.09.2012
Quote:
Originally Posted by petrick_schoba
deu erro
PHP код:
C:\Documents and Settings\Petrick\Desktop\SV11\gamemodes\BM.pwn(14560) : error 021: symbol already defined: "OnPlayerUpdate"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
|
Bom... basta ver este erro para perceber os seus 'conhecimentos' de pawn... -.-'
COLOQUE ISTO:
VerColete(playerid); , DENTRO DA CALLBACK ONPLAYERUPDATE QUE ESTБ NO SEU GM.
Jб agora... para mostrar o cуdigo use:
Код HTML:
[pawn]CODIGOAQUI[/pawn]
Re: Galera me ajuda ! -
Petrick™ - 15.09.2012
Alguem ajuda !
Re: Galera me ajuda ! - rjjj - 15.09.2012
Isto deve resolver o seu problema

:
pawn Код:
forward VerColete();
public VerColete()
{
for(new x = 0, y = GetMaxPlayers(); x != y; x++)
{
new Float:colete;
GetPlayerArmour(x, colete);
if(colete > 0.0)
{
SetPlayerAttachedObject(x, 1, 373, 1, 0.33, -0.029, -0.15, 65, 25, 35);
}
else
{
RemovePlayerAttachedObject(x, 1);
}
}
return 1;
}
Espero ter ajudado

.
Re: Galera me ajuda ! -
Petrick™ - 15.09.2012
Quote:
Originally Posted by rjjj
Isto deve resolver o seu problema  :
pawn Код:
forward VerColete(); public VerColete() { for(new x = 0, y = GetMaxPlayers(); x != y; x++) { new Float:colete; GetPlayerArmour(x, colete); if(colete > 0.0) { SetPlayerAttachedObject(x, 1, 373, 1, 0.33, -0.029, -0.15, 65, 25, 35); } else { RemovePlayerAttachedObject(x, 1); } } return 1; }
Espero ter ajudado  .
|
Cara muito obrigado, vlw mesmo continue assim !
Re: Galera me ajuda ! -
Maklister - 15.09.2012
Voce tambem pode tentar assim
pawn Код:
// Code
new Float:colete;
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerArmour(i, colete);
if(colete >= 1)
{
SetPlayerAttachedObject(i,1,373,1,0.33,-0.029,-0.15,65,25,35);
}
else
{
RemovePlayerAttachedObject(i, 1);
}
}
return 1;
Pois GetPlayerMax ira apenas retornar a quantidade maxima de players no server.cfg
Aconselho tambem evitar de usar a public
pawn Код:
public OnPlayerUpdate(playerid)
{
return 1;
}
Pois ela usa milisegundos o que quando haver uma certa quantidade de players, concerteza dara lag