SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 21/10/2018, 04:42 AM   #1
Duun
Gangsta
 
Duun's Avatar
 
Join Date: Oct 2012
Location: Salvador
Posts: 525
Reputation: 25
Default erro que n consigo resolver

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

Code:
error 047: array sizes do not match, or destination array is too small
linha:
Code:
HInfo[id][hDono] = "Ninguém";
código todo:
Code:
#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;
}
__________________
Sistema de Casas Open Source
Duun is offline   Reply With Quote
Old 21/10/2018, 04:46 AM   #2
Electrifying
Big Clucker
 
Join Date: Sep 2018
Location: Pernambuco
Posts: 90
Reputation: 0
Default Re: erro que n consigo resolver

twwww
Electrifying is offline   Reply With Quote
Old 21/10/2018, 04:49 AM   #3
Duun
Gangsta
 
Duun's Avatar
 
Join Date: Oct 2012
Location: Salvador
Posts: 525
Reputation: 25
Default Re: erro que n consigo resolver

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

Code:
enum InfoH
{
	hID,
	Float:hIcone[3],
	hPreco,
	hDono[25],
	
	hCofre,
	hAluguel,
	hCarro,
	
	Float:hPosx,
	Float:hPosy,
	Float:hPosz
}
__________________
Sistema de Casas Open Source
Duun is offline   Reply With Quote
Old 21/10/2018, 05:04 AM   #4
FerrariL
Gangsta
 
FerrariL's Avatar
 
Join Date: Sep 2016
Location: Goiânia
Posts: 553
Reputation: 22
Default Re: erro que n consigo resolver

Você deve usar format ou strcat.
__________________
Faço sistemas por encomenda, discord: FerrariL
#5104
FerrariL is offline   Reply With Quote
Old 21/10/2018, 05:08 AM   #5
Duun
Gangsta
 
Duun's Avatar
 
Join Date: Oct 2012
Location: Salvador
Posts: 525
Reputation: 25
Default Re: erro que n consigo resolver

fiz assim e deu certo:

Code:
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 (c) 1997-2006, ITB CompuPhase


2 Warnings.
__________________
Sistema de Casas Open Source
Duun is offline   Reply With Quote
Old 21/10/2018, 05:14 AM   #6
Duun
Gangsta
 
Duun's Avatar
 
Join Date: Oct 2012
Location: Salvador
Posts: 525
Reputation: 25
Default Re: erro que n consigo resolver

alguém ai ?
__________________
Sistema de Casas Open Source
Duun is offline   Reply With Quote
Old 21/10/2018, 05:38 AM   #7
Felipealves
Big Clucker
 
Join Date: Mar 2016
Location: Paraná
Posts: 85
Reputation: 3
Default Re: erro que n consigo resolver

PHP Code:
HInfo[id][hIcone][0] = Pos[0], HInfo[id][hIcone][1] = Pos[1], HInfo[id][hIcone][2] = Pos[2]; 
Felipealves is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] To com um erro não consigo resolver! LucasF Português/Portuguese 4 19/10/2013 05:08 PM
[Ajuda] Erro não consigo resolver lucaskill66 Português/Portuguese 2 02/10/2013 01:58 PM
[Ajuda] Erro simples que não consigo resolver ! [THs]ShadoW Português/Portuguese 11 27/01/2013 09:26 PM
[Ajuda] Erro que nao consigo resolver :S Nill.Oliveira Português/Portuguese 9 12/10/2012 12:22 AM
[Ajuda] Não consigo resolver este erro arakuta Português/Portuguese 6 25/11/2011 11:20 PM


All times are GMT. The time now is 05:24 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.