Help to understand code
#1

Hi all. I'm trying to understand code. When my gamemode starts, after OnGameModeInit I have function call:

Код:
mysql_function_query(MysqlConnection,fquery,true,"CarCheck","");
Код:
forward CarCheck();
public CarCheck()
{
new rows,fields;
cache_get_data(rows,fields);
new fetch[24];
new msg[200];
if(rows>0)
{
 	 for(new rowas = 0; rowas != rows; rowas++)
    {
	cache_get_field_content(rowas, "Name", fetch);
	format( msg, sizeof(msg), "SELECT * FROM `users` WHERE Name = '%s'",fetch);
	mysql_function_query(MysqlConnection,msg,true,"CarCheck2","s",fetch);
	}

	}
		return 1;
	}
Код:
forward CarCheck2(name[]);
public CarCheck2(name[])
{
new rows,fields;
cache_get_data(rows,fields);
new msg[200];
if(rows==0)
{
 format( msg,sizeof( msg ),"DELETE FROM `cars` WHERE  Name = '%s'",Name);
 mysql_function_query(MysqlConnection,msg,false,"","");
 return 1;
}
	return 1;
	}
Can you help me do understand, when server delete the car? I do not understand, what code checking and when he delete car, when not.
Reply


Messages In This Thread
Help to understand code - by ,TomY' - 04.08.2018, 10:21
Re: Help to understand code - by Sew_Sumi - 04.08.2018, 10:31
Re: Help to understand code - by ,TomY' - 04.08.2018, 10:39
Re: Help to understand code - by Sew_Sumi - 04.08.2018, 10:41
Re: Help to understand code - by ,TomY' - 04.08.2018, 10:49
Re: Help to understand code - by Sew_Sumi - 04.08.2018, 11:03
Re: Help to understand code - by ,TomY' - 04.08.2018, 11:24
Re: Help to understand code - by Sew_Sumi - 04.08.2018, 15:42

Forum Jump:


Users browsing this thread: 1 Guest(s)