25.07.2012, 00:37
Estou algumas dъvidas pois, gostaria de integrar uma string na label, e nгo sei como fazer.
new string[128], nome[24];
GetPlayerName(playerid, nome, 24);
format(string, sizeof(string), "blablabla meu id: %d e meu nome й %s", playerid, nome);
label[playerid] = Create3DTextLabel(string, 0xFF0000, 0.0, 0.0, 0.0, 50.0, 0);
new Text3D: PtText;
PtText = Create3DTextLabel(STRING, COR, X, Y, Z, DIST, VW, TLOS);
Attach3DTextLabelToPlayer(PtText, playerid, OffsX, OffsY, OffsZ);
public OnPlayerSpawn(playerid)
{
new string[128];
new rand = 1 + random(49);
PlayerInfo[playerid][pPrisioneiro] = rand;
for(new i=0; i<MAX_PLAYERS; i++)
{
format(string, sizeof(string), "prisioneiro: %d", rand);
Create3DTextLabel(string, 0xFF0000, 0.0, 0.0, 0.0, 50.0, 0);
}
pawn Код:
|
public OnPlayerSpawn(playerid) {
new Str[24], Rand = ++random(49), Text3D: PtText;
PlayerInfo[playerid][pPrisioneiro] = Rand;
format(Str, sizeof(Str), "Prisioneiro: %i", Rand);
PtText = Create3DTextLabel(Str, 0xFF0000FF, 0.0, 0.0, 0.0, 50.0, 0);
Attach3DTextLabelToPlayer(PtText, playerid, 0.0, 0.0, 0.0);
return 1;
}
C:\Users\NOOBRE\Desktop\x\gamemodes\x.pwn(1361) : error 022: must be lvalue (non-constant)
new string[256], Rand = ++random(50), Text3D: PtText;