26.07.2015, 23:51
okay i've made dynamic gate system, the problem is it doesn't fill up full information.... here's my codes, p/s i've made dynamic mapicon/3dtextlabel and it works so confusing..
here's my codes
and here's n sql save
http://prntscr.com/7xd24k
and doesn't show any error or something... please help.
here's my codes
Код:
stock SaveMap(mapid) { new query[200]; format(query, sizeof(query), "UPDATE `maps` SET `MapObjectID` = '%d', `ObjectX` = '%.4f', `ObjectY` = '%.4f', `ObjectZ` = '%.4f', `ObjectRotX` = '%.4f', `ObjectRotY` = '%.4f' `ObjectRotZ` = '%.4f', `ObjectVW` = '%d', `ObjectINT` = '%d' WHERE `MapID` = '%d'", Maps[mapid][MapObjectID], Maps[mapid][ObjectX], Maps[mapid][ObjectY], Maps[mapid][ObjectZ], Maps[mapid][ObjectRotX], Maps[mapid][ObjectRotY], Maps[mapid][ObjectRotZ], Maps[mapid][ObjectVW], Maps[mapid][ObjectINT], Maps[mapid][MapID] ); return mysql_tquery(g_iHandle, query); } Function LoadMaps() { static rows, fields; cache_get_data(rows, fields, g_iHandle); for (new i = 0; i < rows; i ++) if (i < MAX_MAPS) { Maps[i][MapExists] = true; Maps[i][MapID] = cache_get_field_int(i, "MapID"); Maps[i][MapObjectID] = cache_get_field_int(i, "MapObjectID"); Maps[i][ObjectX] = cache_get_field_float(i, "ObjectX"); Maps[i][ObjectY] = cache_get_field_float(i, "ObjectY"); Maps[i][ObjectZ] = cache_get_field_float(i, "ObjectZ"); Maps[i][ObjectRotX] = cache_get_field_float(i, "ObjectRotX"); Maps[i][ObjectRotY] = cache_get_field_float(i, "ObjectRotY"); Maps[i][ObjectRotZ] = cache_get_field_float(i, "ObjectRotZ"); Maps[i][ObjectVW] = cache_get_field_int(i, "ObjectVW"); Maps[i][ObjectINT] = cache_get_field_int(i, "ObjectINT"); MAP_Refresh(i); } return 1; }
Код:
stock MAP_Create(playerid) { new Float:x, Float:y, Float:z, Float:angle; if (GetPlayerPos(playerid, x, y, z) && GetPlayerFacingAngle(playerid, angle)) { for (new i = 0; i < MAX_MAPS; i ++) if (!Maps[i][MapExists]) { Maps[i][MapExists] = true; Maps[i][MapObjectID] = 980; Maps[i][ObjectX] = x + (3.0 * floatcos(-angle, degrees)); Maps[i][ObjectY] = y + (3.0 * floatcos(-angle, degrees)); Maps[i][ObjectZ] = z; Maps[i][ObjectRotX] = 0; Maps[i][ObjectRotY] = 0; Maps[i][ObjectRotZ] = angle; Maps[i][ObjectVW] = GetPlayerVirtualWorld(playerid); Maps[i][ObjectINT] = GetPlayerInterior(playerid); MAP_Refresh(i); mysql_tquery(g_iHandle, "INSERT INTO `maps` (`MapObjectID`) VALUES(980)", "OnMapCreated", "d", i); return i; } } return -1; }
Код:
stock MAP_Refresh(mid) { if (mid != -1 && Maps[mid][MapExists]) { if (IsValidDynamicObject(Maps[mid][MapObject])) DestroyDynamicObject(Maps[mid][MapObject]); Maps[mid][MapObject] = CreateDynamicObject(Maps[mid][MapObjectID], Maps[mid][ObjectX], Maps[mid][ObjectY], Maps[mid][ObjectZ], Maps[mid][ObjectRotX], Maps[mid][ObjectRotY], Maps[mid][ObjectRotZ], Maps[mid][ObjectVW], Maps[mid][ObjectINT]); return 1; } return 1; }
http://prntscr.com/7xd24k
and doesn't show any error or something... please help.