[Ajuda] erro que n consigo resolver
#1

to tentando criar um sistema de casas aqui, mas ta dando esse erro :

Код:
error 047: array sizes do not match, or destination array is too small
linha:
Код:
HInfo[id][hDono] = "Ninguйm";
cуdigo todo:
Код:
#define MAX_HOUSES 100


enum InfoH
{
	hID,
	hIcone,
	hPreco,
	hDono[25],
	
	hCofre,
	hAlguel,
	hCarro,
	
	Float:hPosx,
	Float:hPosy,
	Float:hPosz
}

new HInfo[MAX_HOUSES][InfoH];




CMD:criarcasa(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo tem permisгo para usar este comando!");

	new id, preco;
	if(sscanf(params, "dd", id, preco)) return SendClientMessage(playerid, -1, "/criarcasa id preco");

	new Float:Pos[3];
	GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
	
	HInfo[id][hID] = id;
	HInfo[id][hPreco] = preco;
	HInfo[id][hDono] = "Ninguйm";

	return 1;
}
Reply
#2

twwww
Reply
#3

tentei adicionar isto
Код:
	HInfo[id][hIcone] = Pos[0], Pos[1], Pos[2];
no comando de criar a casa, mas dб esses warnings:
Код:
warning 215: expression has no effect
mudei a new dele mesmo assim n funcionou:

Код:
enum InfoH
{
	hID,
	Float:hIcone[3],
	hPreco,
	hDono[25],
	
	hCofre,
	hAluguel,
	hCarro,
	
	Float:hPosx,
	Float:hPosy,
	Float:hPosz
}
Reply
#4

Vocк deve usar format ou strcat.
Reply
#5

fiz assim e deu certo:

Код:
CMD:criarcasa(playerid, params[])
{
	if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "Vocк nгo tem permisгo para usar este comando!");

	new id, preco;
	if(sscanf(params, "dd", id, preco)) return SendClientMessage(playerid, -1, "/criarcasa id preco");

	new Float:Pos[3];
	GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);

	
	HInfo[id][hID] = id;
	HInfo[id][hCofre] = 0;
	HInfo[id][hCarro] = 265;
	HInfo[id][hPreco] = preco;
	HInfo[id][hAluguel] = 0;
	
	
	new str[120];
	format (str, sizeof(str), "O Administrador %s criou uma casa id %d valor: %d", GetNome(playerid), id, preco);
	SendClientMessageToAll(-1, str);
	
	new stx[25];
	format (stx, sizeof(stx), "Ninguйm");
	HInfo[id][hDono] = stx;


//	HInfo[id][hIcone] = Pos[0], Pos[1], Pos[2];


	return 1;
}
porem nessa parte HInfo[id][hIcone] = Pos[0], Pos[1], Pos[2]; dб erro.
aqui era pra setar a posiзгo da casa de acordo com o id dela.
por exemplo, casa 1 pos: x y z entende ?


mas da esses warnings


C:\Users\Lucas\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gm.pwn(8 : warning 215: expression has no effect
C:\Users\Lucas\Desktop\samp037_svr_R2-1-1_win32\gamemodes\gm.pwn(8 : warning 215: expression has no effect
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
Reply
#6

alguйm ai ?
Reply
#7

PHP код:
HInfo[id][hIcone][0] = Pos[0], HInfo[id][hIcone][1] = Pos[1], HInfo[id][hIcone][2] = Pos[2]; 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)