TextDraw -
MoonRey - 08.09.2013
Ta dando alguns erros quando eu tento compilar meu GM, e й no TextDraw, se alguem puder me ajudar.
Os erros sгo esses:
pawn Код:
(2758) : error 029: invalid expression, assumed zero
(2758) : error 029: invalid expression, assumed zero
(2758) : warning 215: expression has no effect
(2758) : error 001: expected token: ";", but found "]"
(2758) : fatal error 107: too many error messages on one line
Os cуdigos:
pawn Код:
//Topo do GM
static Text:Velocimetro[MAX_PLAYERS];
//OnPlayerConnect
Linha do Erro: Velocimetro[playerid] = TextDrawCreate(11.000000,291.000000, " ");
TextDrawBackgroundColor(Velocimetro[playerid], 0x000000FF);
TextDrawFont(Velocimetro[playerid], 3);
TextDrawLetterSize(Velocimetro[playerid], 0.400000,1.300000);
TextDrawColor(Velocimetro[playerid], -1);
TextDrawSetOutline(Velocimetro[playerid], 1);
Re: TextDraw -
smiiir - 08.09.2013
pawn Код:
// Topo do GM
new Text:Velocimetro [ MAX_PLAYERS ] ;
pawn Код:
// OnPlayerConnect
Velocimetro[playerid] = TextDrawCreate(11.000000,291.000000, " ");
TextDrawBackgroundColor(Velocimetro[playerid], 0x000000FF);
TextDrawFont(Velocimetro[playerid], 3);
TextDrawLetterSize(Velocimetro[playerid], 0.400000,1.300000);
TextDrawColor(Velocimetro[playerid], -1);
TextDrawSetOutline(Velocimetro[playerid], 1);
Re: TextDraw -
MoonRey - 08.09.2013
Mesmo erro =/
Re: TextDraw -
smiiir - 08.09.2013
Vocк estб colocando errado,
eu testei no meu gamemode e funcionou normalmente
Re: TextDraw -
MoonRey - 08.09.2013
Eu achei uma coisa estranha, quando eu tirei o text pra tentar compilar, deu o mesmo erro, sу que em outra linha do Velocimetro e_e Nгo sei se ajuda, mas vou colocar o Sistema de Velocimetro inteiro:
pawn Код:
//Topo do GM
static Text:Velocimetro[MAX_PLAYERS];
new bool:Vel[MAX_PLAYERS];
forward VelUpdate();
//OnPlayerConnect
Velocimetro[playerid] = TextDrawCreate(11.000000,291.000000, " ");
TextDrawBackgroundColor(Velocimetro[playerid], 0x000000FF);
TextDrawFont(Velocimetro[playerid], 3);
TextDrawLetterSize(Velocimetro[playerid], 0.400000,1.300000);
TextDrawColor(Velocimetro[playerid], -1);
TextDrawSetOutline(Velocimetro[playerid], 1);
//OnPlayerUpdate
if(IsPlayerConnected(playerid))
{
if(dini_Int(file, "Velocimetro") == 1)
{
new string3[126];
format(string3, sizeof(string3), "Velocimetro: %i ~y~~h~KM/h",GetVehicleSpeed(playerid));
TextDrawSetString(Velocimetro[playerid],string3);
if(IsPlayerInAnyVehicle(playerid))
{
TextDrawShowForPlayer(playerid,Velocimetro[playerid]);
}
else
{
TextDrawHideForPlayer(playerid,Velocimetro[playerid]);
}
}
return 1;
}
//Final do GM
stock GetVehicleSpeed(playerid)
{
if(!IsPlayerInAnyVehicle(playerid)) return 1;
new Float:vPos[3];
GetVehicleVelocity(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]);
return floatround((floatmul(floatsqroot(floatpower(vPos[0], 2.0) + floatpower(vPos[1], 2.0) + floatpower(vPos[2], 2.0)), 100.0) / 0.4463), floatround_floor);
}
Re: TextDraw -
smiiir - 08.09.2013
Cara,.
pawn Код:
new Text:Velocimetro [ MAX_PLAYERS ] ;
Re: TextDraw -
WLSF - 08.09.2013
Nгo usa static, usa new, mostra as coisas que tem acima do TextDrawCreate, no OnPlayerConnect
Re: TextDraw -
MoonRey - 08.09.2013
Mas eu deixo assim:
pawn Код:
new Text:Velocimetro[MAX_PLAYERS];
new bool:Vel[MAX_PLAYERS];
forward VelUpdate();
E da o mesmo erro .-.
A cima do TextDrawCreate no OnPlayerConnect nгo tem nada, ta assim:
pawn Код:
public OnPlayerConnect(playerid)
{
//Velocimetro
Velocimetro[playerid] = TextDrawCreate(11.000000,291.000000, " ");
TextDrawBackgroundColor(Velocimetro[playerid], 0x000000FF);
TextDrawFont(Velocimetro[playerid], 3);
TextDrawLetterSize(Velocimetro[playerid], 0.400000,1.300000);
TextDrawColor(Velocimetro[playerid], -1);
TextDrawSetOutline(Velocimetro[playerid], 1);
Re: TextDraw -
smiiir - 08.09.2013
Lб em cima vocк postou com 'static' compila com 'new'
Re: TextDraw -
WLSF - 08.09.2013
Mas o erro nгo й ai cara, porque aqui tб compilando de boas.