CMD:vehicle(playerid, params[]){ if(Belepve[playerid] == true) { if(pInfo[playerid][Adminszint] == 4) { new parameter[40]; new string52[2048]; new vehid,vehc1,vehc2,vehmodel; new Float: vehx, Float:vehy,Float:vehz,Float:veha; vehid = GetPlayerVehicleID(playerid); vehmodel= GetVehicleModel(vehid); GetVehiclePos(vehid, vehx, vehy,vehz); GetVehicleZAngle(vehid, veha); GetVehicleColor(vehid, vehc1, vehc2); if(sscanf(params, \"%s[40]\", parameter)) return SendClientMessage(playerid, -1, \"Használat:/vehicle [save/delete/edit]\"); { if(IsPlayerInAnyVehicle(playerid)) { if(isnull(vInfo[vehid][tulaj])) { SendClientMessage(playerid, -1, \"Nem létezett, lementve\"); format(string52, sizeof string52, \"INSERT INTO jarmuvek(ID,modelid,vx,vy,vz,va,vcolor1,vcolor2,tulaj) VALUES (\'\', %d, %f, %f, %f, %f, %d, %d, \'Admin\')\",vehmodel, vehx,vehy,vehz,veha,vehc1, vehc2); mysql_tquery(kapcsolat, string52); new string57[2048]; format(string57, sizeof string57, \"SELECT * FROM jarmuvek WHERE modelid = \'%d\' AND vx = \'%f\' AND vy = \'%f\' AND vz = \'%f\' AND va = \'%f\' AND vcolor1 = \'%d\' AND vcolor2 = \'%d\' AND tulaj = \'Admin\'\",vehmodel, vehx,vehy,vehz,veha,vehc1, vehc2); mysql_tquery(kapcsolat, string57,\"adatadas\", \"dd\", playerid, vehid); } else { SendClientMessage(playerid, -1, \"Létezett, felülírva\"); format(string52, sizeof string52, \"UPDATE jarmuvek SET modelid = \'%d\', vx = \'%f\', vy = \'%f\', vz = \'%f\', va = \'%f\', vcolor1 = \'%d\', vcolor2 = \'%d\' WHERE ID = \'%d\'\",vInfo[vehid][modelid], vInfo[vehid][vx],vInfo[vehid][vy],vInfo[vehid][vz],vInfo[vehid][va],vInfo[vehid][vcolor1],vInfo[vehid][vcolor2]); mysql_tquery(kapcsolat, string52); } } else SendClientMessage(playerid, COLOR_ORANGE, \"Hiba: Járműben kell ülnöd a parancs használatához.\"); } else SendClientMessage(playerid, COLOR_ORANGE, \"Hiba: Ezt a parancsot te nem használhatod!\"); } else NoLogin(playerid); return 1;}
forward adatadas(playerid,vehicle);public adatadas(playerid,vehicle){ if(cache_get_row_count() == 1) { vInfo[vehicle][DBID] = cache_get_field_content_int(0, \"ID\"); vInfo[vehicle][modelid] = cache_get_field_content_int(0, \"modelid\"); vInfo[vehicle][vx] = cache_get_field_content_float(0, \"vx\"); vInfo[vehicle][vy] = cache_get_field_content_float(0, \"vy\"); vInfo[vehicle][vz] = cache_get_field_content_float(0, \"vz\"); vInfo[vehicle][va] = cache_get_field_content_float(0, \"va\"); vInfo[vehicle][vcolor1] = cache_get_field_content_int(0, \"vcolor1\"); vInfo[vehicle][vcolor2] = cache_get_field_content_int(0, \"vcolor2\"); cache_get_field_content(0, \"tulaj\",vInfo[vehicle][tulaj]); new carstat[2048]; format(carstat, sizeof carstat, \"DBID: %d, ModelID: %d\\nPzX: %f, PzY: %f, PzZ: %f, PzA: %f\\nSzín1: %d, Szín2: %d, Tulaj: %s\",vInfo[vehicle][DBID],vInfo[vehicle][modelid],vInfo[vehicle][vx],vInfo[vehicle][vy],vInfo[vehicle][vz],vInfo[vehicle][va],vInfo[vehicle][vcolor1],vInfo[vehicle][vcolor2],vInfo[vehicle][tulaj]); SendClientMessage(playerid, -1, carstat); } return 1;}
format(string52, sizeof string52, \"INSERT INTO jarmuvek(ID,modelid,vx,vy,vz,va,vcolor1,vcolor2,tulaj) VALUES (\'\', %d, %f, %f, %f, %f, %d, %d, \'Admin\')\",vehmodel, vehx,vehy,vehz,veha,vehc1, vehc2);
new Cache:eredemeny = mysql_query(SQL,query);
new id = cache_insert_id();vInfo[id][DBID] = id;cache_delete(Cache:eredmeny);
new id = cache_insert_id();
cache_get_value_name_int(0,\"Model\",vInfo[id][vModel]);