20.09.2012, 21:08
pawn Код:
forward CheckarColete(playerid);
public OnGameModeInit()
{
SetTimer("CheckarColete", 1000, true); // Verifica se o jogador possui colete a cada segundo.
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
RemovePlayerAttachedObject(playerid, 1);
return 1;
}
public CheckarColete(playerid)
{
new Float:Colete;
GetPlayerArmour(playerid, Colete);
if(IsACop(playerid))
{
if(Colete >= 1)
{
SetPlayerAttachedObject(playerid,1,19142,1,0.1,0.05,0.0,0.0,0.0,0.0);
}
else
{
RemovePlayerAttachedObject(playerid, 1);
}
}
return 1;
}
P.S: Voce deve setar o colete para o jogador, nгo para todos os jogadores conectados. Apartir do momento em que um objecto й agregado ao PLAYERID, todos os outros jogadores vгo conseguir ver esse objecto.