Ajuda para resolver argument type mismatch(argument 1) -
Infiniteplay - 01.03.2015
Bom galera estou criando um comando de criar label, porйm ta dando um erro que nгo sei resolver
Linha:
PHP код:
new Float:x, Float:y, Float:z, file[100], File:PFile, LineForFile[100], Msg[128], Distancia, FRASE;
Erro da linha:
PHP код:
035: Argument type mismatch (argument 1)
Re: Ajuda para resolver argument type mismatch(argument 1) -
JonathanFeitosa - 01.03.2015
Faz assim:
PHP код:
new
Float:x,
Float:y,
Float:z,
file[100],
File:PFile,
LineForFile[100],
Msg[128],
Distancia,
FRASE
;
E diga onde localizado o erro. Mande tambйm exemplo de uso do mesmo.
Re: Ajuda para resolver argument type mismatch(argument 1) -
Infiniteplay - 01.03.2015
Eu fiz isso, ai o erro foi pra essa linha
PHP код:
Create3DTextLabel(FRASE, 0xFF0000AA, x, y, z, Distancia, 0, 0);
Re: Ajuda para resolver argument type mismatch(argument 1) -
JonathanFeitosa - 01.03.2015
Pode mandar o format do FRASE se quiser...
Re: Ajuda para resolver argument type mismatch(argument 1) -
Infiniteplay - 01.03.2015
Nгo tem nenhum format do FRASE, to aprendendo ainda a fazer, por isso estou sempre precisando de ajuda..
Eu coloquei FRASE[50]; mas quando cria o label fica bugado, aparece um э no lugar do texto
Re: Ajuda para resolver argument type mismatch(argument 1) -
JonathanFeitosa - 01.03.2015
Apague new Texto e Distвncia.
PHP код:
Create3DTextLabel("Minha Primeira Label", 0xFF0000AA, x, y, z, 2.0, 0, 0);
Re: Ajuda para resolver argument type mismatch(argument 1) -
Infiniteplay - 01.03.2015
new Texto seria o new FRASE[50]?
e esse cуdigo vou colocar ele, porйm nгo sei oque vai mudar jб que esse cуdigo jб tem um texto definido..
Re: Ajuda para resolver argument type mismatch(argument 1) -
JonathanFeitosa - 01.03.2015
Sim.. Perdгo й que estou no celular e tambйm nгo prestei atenзгo no tipo de sistema que estas fazendo. Vocк nгo estava passando valor a FRASE.
Pode publicar o comando completo?
Re: Ajuda para resolver argument type mismatch(argument 1) -
Infiniteplay - 01.03.2015
Claro, talvez vocк repare alguns erros bem bestas no comando, mas como disse estou aprendendo..
PHP код:
CMD:criarlabel(playerid, params[])
{
if (APlayerData[playerid][LoggedIn] != true) return SendClientMessage(playerid, -1, "{FF0000}| {33AA33}ERRO {FF0000}| {FFFFFF}Vocк nгo estб logado!");
// Setup local variables
new Float:x,
Float:y,
Float:z,
file[100],
File:PFile,
LineForFile[100],
Msg[128],
Distancia,
FRASE[50];
if (APlayerData[playerid][PlayerJailed] != 0) return SendClientMessage(playerid, COR_ERRO, "{FF0000}| {33AA33}ERRO {FF0000}| {FFFFFF}Vocк nгo pode usar esse comando na cadeia!");
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 5
if(CallRemoteFunction("PegarLevelNovo","i",playerid) < 7) return SendClientMessage(playerid, -1, "{FF0000}| {33AA33}ERRO {FF0000}| {FFFFFF}Vocк nгo tem permissгo para isso!");
if (sscanf(params, "ui", FRASE, Distancia)) SendClientMessage(playerid, 0xFF0000AA, "{FF0000}| {33AA33}INFO {FF0000}| {FFFFFF}Use: \"/criarlabel [Texto] [Distancia]\"");
else
{
GetPlayerPos(playerid, x, y, z);
z = z - 1.0; // Adjust camera Z-coordinate 1m lower than normal (otherwise the camera floats in the air)
// Move the player a bit, otherwise he could get stuck inside the camera-object
// Save the camera to a file
for (new LABELID; LABELID < MAX_LABEL; LABELID++)
{
// Check if this index is free
// Setup this label (create the labels and store the data)
Create3DTextLabel(FRASE, 0xFF0000AA, x, y, z, Distancia, 0, 0);
// Save the file
format(file, sizeof(file), LABELFile, LABELID); // Construct the complete filename for this camera-file
PFile = fopen(file, io_write); // Open the label-file for writing
format(LineForFile, 100, "Create3DTextLabel(%s, 0xFF0000AA, %i, %i, %i, %i, 0, 0)", FRASE, x, y, z, Distancia);
fwrite(PFile, LineForFile); // And save it to the file
fclose(PFile); // Close the file
// Let the player know he created a new camera
format(Msg, 128, "{FF0000}| {33AA33}LABEL {FF0000}| {FFFFFF}Vocк criou o label ID: %i", LABELID);
SendClientMessage(playerid, 0x00FF00FF, Msg);
// Exit the function
return 1;
}
// In case all camera-slots are occupied (100 camera's have been created already), let the player know about it
format(Msg, 128, "{FF0000}| {33AA33}LABEL {FF0000}| {FFFFFF}Vocк nгo pode criar mais de %s labels", MAX_LABEL);
SendClientMessage(playerid, 0xFFFFFFFF, Msg);
}
}
else
return 0;
return 1;
}
Re: Ajuda para resolver argument type mismatch(argument 1) -
JonathanFeitosa - 01.03.2015
Nгo reparei muito o code, mas vocк pode comeзar arrumando por aqui:
troque o "ui" por "s[128]i"