r3f13x Posted July 26, 2020 Report Share Posted July 26, 2020 Salut All. Am o problema. Cand Vreau sa creez o masina pentru o factiune cu comanda /Createvehicle Mi-o creaza direct intr-o factiune de ce? Si cand dau restart la server masina dispare. si nici in baza de date nu se salveaza, de la ce o fi problema asta? Quote Link to comment Share on other sites More sharing options...
0 VLM Posted July 26, 2020 Report Share Posted July 26, 2020 Arata comanda createvehicle Quote FONDATOR COMUNITATEA VL https://discord.gg/comvl Link to comment Share on other sites More sharing options...
0 r3f13x Posted July 26, 2020 Author Report Share Posted July 26, 2020 Acum 2 minute, VLM a spus: Arata comanda createvehicle YCMD:createvehicle(playerid, params[], help) { new Float: Pos[3], Float: Angle, string[256], szQuery[500], modelid, color[2]; if(PlayerInfo[playerid][pAdmin] < 6) return 1; if(sscanf(params, "iii", modelid, color[0], color[1])) return SCM(playerid, COLOR_GREY, "USAGE: {FFFFFF}/createvehicle <model> <color1> <color2>"); if(400 <= modelid >= 611) return SCM(playerid, COLOR_GREY, "Invalid vehicle id. (400 - 611)"); if(!(0 <= color[0] <= 255 && 0 <= color[1] <= 255)) return SCM(playerid, COLOR_GREY, "Invalid color id. (0 - 255)"); if(IsPlayerInAnyVehicle(playerid)) return 1; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); GetPlayerFacingAngle(playerid, Angle); new carid = GetServerVehicles()+1; ServerVehicles[carid][vSpawned] = CreateVehicle(modelid, Pos[0], Pos[1], Pos[2], Angle, color[0], color[1], -1); SetVehicleNumberPlate(ServerVehicles[carid][vSpawned], "NewCar"); PutPlayerInVehicleEx(playerid, ServerVehicles[carid][vSpawned], 0); ServerVehicles[carid][vID] = carid; ServerVehicles[carid][vModel] = modelid; ServerVehicles[carid][vLocation][0] = Pos[0]; ServerVehicles[carid][vLocation][1] = Pos[1]; ServerVehicles[carid][vLocation][2] = Pos[2]; ServerVehicles[carid][vAngle] = Angle; ServerVehicles[carid][vColor][0] = color[0]; ServerVehicles[carid][vColor][1] = color[1]; mysql_format(SQL, szQuery, sizeof(szQuery), "INSERT INTO `svehicles` (vID, vModel, LocationX, LocationY, LocationZ, Angle, Color1, Color2) VALUES ('%d', '%d', '%f', '%f', '%f', '%f', '%d', '%d')", carid, modelid, Pos[0], Pos[1], Pos[2], ServerVehicles[carid][vAngle], color[0], color[1]); mysql_query(SQL, szQuery); format(string, sizeof(string), "Ai creat cu succes un %s (vID: %d).", aVehicleNames[modelid - 400], carid); SCM(playerid, COLOR_LGREEN, string); format(string, sizeof(string), "Acesta a fost adaugat cu succes in baza de date iar acum sunt in total %d vehicule!", GetServerVehicles()); SCM(playerid, COLOR_LGREEN, string); SCM(playerid, COLOR_LGREEN, "Daca vrei sa modifici acest vehicul, foloseste comanda /editvehicle."); return 1; } function GetServerVehicles() { new maryus[256], vehicles; format(maryus, sizeof(maryus), "SELECT * FROM `svehicles`"); new Cache: result = mysql_query(SQL, maryus); vehicles = cache_get_row_count (); cache_delete(result); return vehicles; } Quote Link to comment Share on other sites More sharing options...
Question
r3f13x
Salut All.
Am o problema.
Cand Vreau sa creez o masina pentru o factiune cu comanda /Createvehicle
Mi-o creaza direct intr-o factiune de ce?
Si cand dau restart la server masina dispare. si nici in baza de date nu se salveaza, de la ce o fi problema asta?
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.