MYSQL Help !!
#13

i found a tutorial on forus, will that be good for me? please check.
here is Object loading code:

Code:
orward LoadObjects(limit);
public LoadObjects(limit)
{
	new count, rows, fields, data[50];
	cache_get_data(rows, fields);
	for(new i; i < rows; i++)
	{
		if(count > limit)
		{
			printf("Number of objects exceeded limit!");
			break;
		}
		for(new h; h < sizeof(object); h++)
		{
			if(object[h][ScriptID] == 0)
			{
				cache_get_field_content(i, "ScriptID", data); object[h][ScriptID] = strval(data);
				cache_get_field_content(i, "ModelID", data); object[h][ModelID] = strval(data);
				cache_get_field_content(i, "X", data); object[h][X] = floatstr(data);
				cache_get_field_content(i, "Y", data); object[h][Y] = floatstr(data);
				cache_get_field_content(i, "Z", data); object[h][Z] = floatstr(data);
				cache_get_field_content(i, "rX", data); object[h][rX] = floatstr(data);
				cache_get_field_content(i, "rY", data); object[h][rY] = floatstr(data);
				cache_get_field_content(i, "rZ", data); object[h][rZ] = floatstr(data);
				CreateDynamicObject(object[h][ModelID], object[h][X], object[h][Y], object[h][Z], object[h][rX], object[h][rY], object[h][rZ]);
				count++;
				break;
			}
		}
	}
	printf("Current objects on the server: %d",CountDynamicObjects());
	return 1;
}
Reply


Messages In This Thread
MYSQL Help !! - by ManIsHere - 12.03.2017, 08:05
Re: MYSQL Help !! - by sizeof - 12.03.2017, 08:10
Re: MYSQL Help !! - by Unte99 - 12.03.2017, 08:11
Re: MYSQL Help !! - by ManIsHere - 12.03.2017, 09:01
Re: MYSQL Help !! - by ManIsHere - 12.03.2017, 18:25
Re: MYSQL Help !! - by ManIsHere - 13.03.2017, 06:43
Re: MYSQL Help !! - by X337 - 13.03.2017, 07:14
Re: MYSQL Help !! - by ManIsHere - 13.03.2017, 08:06
Re: MYSQL Help !! - by ManIsHere - 13.03.2017, 10:34
Re: MYSQL Help !! - by GTLS - 13.03.2017, 10:48
Re: MYSQL Help !! - by X337 - 13.03.2017, 10:50
Re: MYSQL Help !! - by Unte99 - 13.03.2017, 10:54
Re: MYSQL Help !! - by ManIsHere - 13.03.2017, 11:45

Forum Jump:


Users browsing this thread: 1 Guest(s)