04.08.2018, 10:21
Hi all. I'm trying to understand code. When my gamemode starts, after OnGameModeInit I have function call:
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.
Код:
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;
}

