Cata12X Posted January 14, 2016 Report Share Posted January 14, 2016 Salut sunt nou pe aici si vin si eu cu o problema Daca mut o masina de pe server cu comanda /vmove dupa dau restart masina se dubleaza si nu stiu de ce , ce as putea face Multumesc Quote Link to comment Share on other sites More sharing options...
0 Voller. Posted January 14, 2016 Report Share Posted January 14, 2016 Pune comanda /vmove aici! Quote Link to comment Share on other sites More sharing options...
0 Cata12X Posted January 14, 2016 Author Report Share Posted January 14, 2016 Acum 11 minute, Cata12X a spus: ca mut o masina de pe server cu comanda /vmove dupa dau restart masina se dubleaza si nu stiu de ce , ce as putea face Multumesc PS. Nu toate masinile le dubleaza doar cele care le-am adaugat ultima data pe baza de date CMD:vmuta(playerid, params[]) { if(playerVariables[playerid][pAdminLevel] >= 4) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside the vehicle that you wish to move."); new string[42]; for(new x = 0; x < MAX_VEHICLES; x++) { if(vehicleVariables[x][vVehicleScriptID] == GetPlayerVehicleID(playerid)) { GetVehiclePos(x, vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2]); GetVehicleZAngle(x, vehicleVariables[x][vVehicleRotation]); DestroyVehicle(vehicleVariables[x][vVehicleScriptID]); vehicleVariables[x][vVehicleScriptID] = CreateVehicle(vehicleVariables[x][vVehicleModelID], vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2], vehicleVariables[x][vVehicleRotation], vehicleVariables[x][vVehicleColour][0], vehicleVariables[x][vVehicleColour][1], -1); PutPlayerInVehicle(playerid, vehicleVariables[x][vVehicleScriptID], 0); LinkVehicleToInterior(x, GetPlayerInterior(x)); SetVehicleVirtualWorld(x, 0); saveVehicle(x); Fuel[x] = 100; format(string, sizeof(string), "You have successfully moved vehicle %d.", x); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } } } return 1; } Quote Link to comment Share on other sites More sharing options...
0 Voller. Posted January 14, 2016 Report Share Posted January 14, 2016 Just now, Cata12X said: PS. Nu toate masinile le dubleaza doar cele care le-am adaugat ultima data pe baza de date CMD:vmuta(playerid, params[]) { if(playerVariables[playerid][pAdminLevel] >= 4) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be inside the vehicle that you wish to move."); new string[42]; for(new x = 0; x < MAX_VEHICLES; x++) { if(vehicleVariables[x][vVehicleScriptID] == GetPlayerVehicleID(playerid)) { GetVehiclePos(x, vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2]); GetVehicleZAngle(x, vehicleVariables[x][vVehicleRotation]); DestroyVehicle(vehicleVariables[x][vVehicleScriptID]); vehicleVariables[x][vVehicleScriptID] = CreateVehicle(vehicleVariables[x][vVehicleModelID], vehicleVariables[x][vVehiclePosition][0], vehicleVariables[x][vVehiclePosition][1], vehicleVariables[x][vVehiclePosition][2], vehicleVariables[x][vVehicleRotation], vehicleVariables[x][vVehicleColour][0], vehicleVariables[x][vVehicleColour][1], -1); PutPlayerInVehicle(playerid, vehicleVariables[x][vVehicleScriptID], 0); LinkVehicleToInterior(x, GetPlayerInterior(x)); SetVehicleVirtualWorld(x, 0); saveVehicle(x); Fuel[x] = 100; format(string, sizeof(string), "You have successfully moved vehicle %d.", x); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } } } return 1; } Cand folosesti comanda /vmove trebuie sa faci un query in care sa stergi masina din baza de date, pe urma sa o salvezi pe asta care o muti in baza de date! Quote Link to comment Share on other sites More sharing options...
0 Cata12X Posted January 14, 2016 Author Report Share Posted January 14, 2016 (edited) Acum 39 minute, Cata12X a spus: Ce este acela un query si cum pot sa il fac, daca ai putea sa-mi spui Edited January 14, 2016 by Cata12X Quote Link to comment Share on other sites More sharing options...
0 Voller. Posted January 14, 2016 Report Share Posted January 14, 2016 Just now, Cata12X said: Ce este acela un query si cum pot sa il fac, daca ai putea sa-mi spui Pune aici functia SaveVehicle din comanda /vmove! Quote Link to comment Share on other sites More sharing options...
0 Cata12X Posted January 14, 2016 Author Report Share Posted January 14, 2016 Chiar acum, Voller. a spus: Pune aici functia SaveVehicle din comanda /vmove! CMD:saveveh(playerid, params[]) { if(playerVariables[playerid][pAdminLevel] >= 4) { if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "You need to be in a vehicle to save it."); if(GetPVarInt(playerid, "sCc") == 1) { new i, queryString[255], Float: vPos[4]; // x, y, z + z angle GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]); GetVehicleZAngle(GetPlayerVehicleID(playerid), vPos[3]); format(queryString, sizeof(queryString), "INSERT INTO vehicles (vehicleModelID, vehiclePosX, vehiclePosY, vehiclePosZ, vehiclePosRotation) VALUES('%d', '%f', '%f', '%f', '%f')", GetVehicleModel(GetPlayerVehicleID(playerid)), vPos[0], vPos[1], vPos[2], vPos[3]); new Cache: resultxx = mysql_query(handle, queryString); i = cache_insert_id(); cache_delete(resultxx); SCM(playerid, COLOR_WHITE, "Vehicle saved!"); vehicleVariables[vVehicleModelID] = GetVehicleModel(GetPlayerVehicleID(playerid)); vehicleVariables[vVehiclePosition][0] = vPos[0]; vehicleVariables[vVehiclePosition][1] = vPos[1]; vehicleVariables[vVehiclePosition][2] = vPos[2]; vehicleVariables[vVehicleRotation] = vPos[3]; vehicleVariables[vVehicleGroup] = 0; vehicleVariables[vVehicleScriptID] = GetPlayerVehicleID(playerid); for(new x = 0; x < MAX_VEHICLES; x++) { if(AdminSpawnedVehicles[x] == GetPlayerVehicleID(playerid)) { AdminSpawnedVehicles[x] = 0; // If the vehicle is admin-spawned, we can remove it from the array and move it to the vehicle script enum/arrays. } } systemVariables[vehicleCounts][2]--; systemVariables[vehicleCounts][0]++; DeletePVar(playerid, "sCc"); } else { SetPVarInt(playerid, "sCc", 1); return SCM(playerid, COLOR_GREY, "Daca esti sigur ca vrei sa salvezi vehiculul, tasteaza din nou /saveveh."); } } return 1; } Quote Link to comment Share on other sites More sharing options...
0 Voller. Posted January 14, 2016 Report Share Posted January 14, 2016 Just now, Cata12X said: CMD:saveveh(playerid, params[]) { if(playerVariables[playerid][pAdminLevel] >= 4) { if(!IsPlayerInAnyVehicle(playerid)) return SCM(playerid, COLOR_GREY, "You need to be in a vehicle to save it."); if(GetPVarInt(playerid, "sCc") == 1) { new i, queryString[255], Float: vPos[4]; // x, y, z + z angle GetVehiclePos(GetPlayerVehicleID(playerid), vPos[0], vPos[1], vPos[2]); GetVehicleZAngle(GetPlayerVehicleID(playerid), vPos[3]); format(queryString, sizeof(queryString), "INSERT INTO vehicles (vehicleModelID, vehiclePosX, vehiclePosY, vehiclePosZ, vehiclePosRotation) VALUES('%d', '%f', '%f', '%f', '%f')", GetVehicleModel(GetPlayerVehicleID(playerid)), vPos[0], vPos[1], vPos[2], vPos[3]); new Cache: resultxx = mysql_query(handle, queryString); i = cache_insert_id(); cache_delete(resultxx); SCM(playerid, COLOR_WHITE, "Vehicle saved!"); vehicleVariables[vVehicleModelID] = GetVehicleModel(GetPlayerVehicleID(playerid)); vehicleVariables[vVehiclePosition][0] = vPos[0]; vehicleVariables[vVehiclePosition][1] = vPos[1]; vehicleVariables[vVehiclePosition][2] = vPos[2]; vehicleVariables[vVehicleRotation] = vPos[3]; vehicleVariables[vVehicleGroup] = 0; vehicleVariables[vVehicleScriptID] = GetPlayerVehicleID(playerid); for(new x = 0; x < MAX_VEHICLES; x++) { if(AdminSpawnedVehicles[x] == GetPlayerVehicleID(playerid)) { AdminSpawnedVehicles[x] = 0; // If the vehicle is admin-spawned, we can remove it from the array and move it to the vehicle script enum/arrays. } } systemVariables[vehicleCounts][2]--; systemVariables[vehicleCounts][0]++; DeletePVar(playerid, "sCc"); } else { SetPVarInt(playerid, "sCc", 1); return SCM(playerid, COLOR_GREY, "Daca esti sigur ca vrei sa salvezi vehiculul, tasteaza din nou /saveveh."); } } return 1;} Pai... comanda Saveveh pare a fi in regula de ce nu folosesti /saveveh si nu mai folosesti /vmove ? intri in ce masina vrei sa o muti o duci unde vrei sa o pui si dupa da-i /saveveh. format(queryString, sizeof(queryString), "INSERT INTO vehicles (vehicleModelID, vehiclePosX, vehiclePosY, vehiclePosZ, vehiclePosRotation) VALUES('%d', '%f', '%f', '%f', '%f')", GetVehicleModel(GetPlayerVehicleID(playerid)), vPos[0], vPos[1], vPos[2], vPos[3]); Asta e un query. 1 Quote Link to comment Share on other sites More sharing options...
0 Cata12X Posted January 14, 2016 Author Report Share Posted January 14, 2016 k ms de ajutor Quote Link to comment Share on other sites More sharing options...
Question
Cata12X
Salut sunt nou pe aici si vin si eu cu o problema
Daca mut o masina de pe server cu comanda /vmove dupa dau restart masina se dubleaza si nu stiu de ce , ce as putea face
Multumesc
Link to comment
Share on other sites
8 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.