12.01.2015, 07:51
no necesitas timer ni usar dos Create3DTextLabel para el mismo fin, es que no actualizas el texto, para eso se utiliza Update3DTextLabelText .
saludos.
https://sampwiki.blast.hk/wiki/Update3DTextLabelText_ES
saludos.
https://sampwiki.blast.hk/wiki/Update3DTextLabelText_ES
pawn Код:
new Text3D:Agresivo[MAX_PLAYERS];
pawn Код:
// esto lo creas una sola vez en OnGameModeInit (con un bucle), o en OnPlayerConnect / OnPlayerSpawn o donde desees crearlo.
Delete3DTextLabel(Agresivo[playerid]);
Agresivo[playerid] = Create3DTextLabel("_",-1,30.0,40.0,5.0,40.0,1);
Attach3DTextLabelToPlayer(Agresivo[playerid], playerid, 0.0, 0.0, 0.3);
pawn Код:
// esto lo colocas en donde verificaraa los golpes causados, ejemplo: OnPlayerTakeDamage
new Maldad = Info[playerid][pKarmaMenos];
if(Maldad >= 100 && Maldad <= 149){
Info[playerid][pKarmaMas] = 0;
Update3DTextLabelText(Agresivo[playerid], 0xFFA200FF, "Agresivo");
}
if(Maldad >= 150 && Maldad <= 199){
Info[playerid][pKarmaMas] = 0;
Update3DTextLabelText(Agresivo[playerid], 0xFF7D00FF, "Malo");
}
// o mucho mejor : ...
switch(Info[playerid][pKarmaMenos]){
case 100..149:{ Info[playerid][pKarmaMas] = 0; Update3DTextLabelText(Agresivo[playerid], 0xFFA200FF, "Agresivo"); }
case 150..199:{ Info[playerid][pKarmaMas] = 0; Update3DTextLabelText(Agresivo[playerid], 0xFF7D00FF, "Malo"); }
}