[Ajuda] Mysql
#1

Код:
forward CriarObjeto(Modelo,Float:x,Float:y,Float:z,Float:Rx,Float:Ry,Float:Rz);
public CriarObjeto(Modelo,Float:x,Float:y,Float:z,Float:Rx,Float:Ry,Float:Rz)
{
	new Pasta[200];
	format(Pasta,sizeof(Pasta),"SELECT * FROM `objetos` WHERE `X` = '%f' AND `Y` = '%f' AND `Z` = '%f'",z,y,z);
	mysql_tquery(MysqlDb,Pasta,"CriarObjetoS","dffffff",Modelo,x,y,z,Rx,Ry,Rz);
	return 1;
}
forward CriarObjetoS(Modelo,Float:x,Float:y,Float:z,Float:Rx,Float:Ry,Float:Rz);
public CriarObjetoS(Modelo,Float:x,Float:y,Float:z,Float:Rx,Float:Ry,Float:Rz)
{
	if(cache_num_rows() == 0){
	new String[300];
	format(String,sizeof(String),"INSERT INTO objetos(Modelo,X,Y,Z,Rx,Ry,Rz) VALUES ('%d','%f','%f','%f','%f','%f','%f'),",Modelo,x,y,z,Rx,Ry,Rz);
	mysql_query(MysqlDb,String,false);}
	return 1;
}
Nгo estб verificando se existe
o mesmo objeto й criado 2,3,4... vezes

Help! ;l
Reply


Messages In This Thread
Mysql - by Guscooby - 07.10.2017, 21:37
Re: Mysql - by ZaHHak - 08.10.2017, 01:40

Forum Jump:


Users browsing this thread: 2 Guest(s)