25.04.2014, 22:27
pawn Код:
//arriba de todo debajo de los includes
new Text3D:label[MAX_PLAYERS];
//en OnPlayerSpawn
Delete3DTextLabel(label[playerid]);
label[playerid] = Create3DTextLabel("_",WHITE, 30.0, 40.0, 50.0, 40.0, 0);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.4);
//en OnPlayerUpdate (es un codigo simple,no es necesario crear un timer)
ActualizarLabel(playerid);
//al final del GM(gamemode9
stock ActualizarLabel(playerid){
new texto[20];
switch(GetPlayerScore(playerid)){
case 0..9:{texto="Private";}
case 10..49:{texto="Private First Class";}
case 50..99:{texto="Corporal";}
case 100..199:{texto="Sergeant";}
case 200..299:{texto="Staff Sergeant";}
case 300..499:{texto="Sergeant First Class";}
case 500..599:{texto="Master Sergeant";}
case 600:{texto="Commander";}
}
Update3DTextLabelText(label[playerid], WHITE, texto);
}
https://sampwiki.blast.hk/wiki/Attach3DTextLabelToPlayer
https://sampwiki.blast.hk/wiki/Delete3DTextLabel
https://sampwiki.blast.hk/wiki/Update3DTextLabelText
https://sampwiki.blast.hk/wiki/GetPlayerScore
https://sampwiki.blast.hk/wiki/switch