cristi1daubnJrr Posted January 1, 2022 Posted January 1, 2022 Salut, m am apucat de cva timp de un proiect frumos de la 0 si am ajuns la punctul masini personale, ma poate ajuta si pe mn cnv u un tutorial pentru vehicule personale? comanda /v si daca se poate si /buycar dar ma intereseaza in mare parte comanda /v si systemul in sine de masini personale. Multumesc anticipat :))
Waller. Posted January 1, 2022 Posted January 1, 2022 Salut, gasesti pe canalul lu Growy TUTS de yt. un tutorial explicativ cum sa faci sistemul de vehicule personale.
cristi1daubnJrr Posted January 1, 2022 Author Posted January 1, 2022 1 hour ago, Waller. said: Salut, gasesti pe canalul lu Growy TUTS de yt. un tutorial explicativ cum sa faci sistemul de vehicule personale. Ms mult bro, imd ma bag la creatie, lma de anu nou
cristi1daubnJrr Posted January 1, 2022 Author Posted January 1, 2022 Astept sugestii sau chiar ajutorul vostru in continuare, nu am gasit sistemul de vehicule personale pe ytb.
hanako Posted January 1, 2022 Posted January 1, 2022 https://www.youtube.com/c/GroWyTuts/playlists Le ai la "Tutoriale Pawn"
cristi1daubnJrr Posted January 1, 2022 Author Posted January 1, 2022 33 minutes ago, hanako said: https://www.youtube.com/c/GroWyTuts/playlists Le ai la "Tutoriale Pawn" Am gasit, mersi baros
cristi1daubnJrr Posted January 5, 2022 Author Posted January 5, 2022 Am inceput sa creez usor usor systemul de masini personale si am o problema cu incarcarea numelui vehicului, nu l gaseste, ma poate ajuta cnv? https://imgur.com/pqAHfBb Quote YCMD:vehicles(playerid, params[], help) { if(!Iter_Count(PlayerVehicles[playerid])) return SCM(playerid, COLOR_WHITE,"Nu ai niciun vehicul personal"); new string[2048] = "Slot\tVehicle\tStatus\tDespawn Time\n"; foreach(new i : PlayerVehicles[playerid]) { if(PersonalVehicle[i][pvSpawnedID] == INVALID_VEHICLE_ID) { format(string, 2048, "%s{ffffff}%d\t%s\tHidded\t-\n", string, (i + 1), GetVehicleName(PersonalVehicle[i][pvModel])); } else { format(string, 2048, "%s{ffffff}%d\t%s\t%s\t%d min\n", string, (i + 1), GetVehicleName(PersonalVehicle[i][pvModel]), (IsVehicleOccupied(PersonalVehicle[i][pvSpawnedID])) ? ("{ffffff}Occupied") : ("{FFFFFF}Available"), ((PersonalVehicle[i][pvDespawnTime] - gettime()) / 60)); } } new title[64]; format(title, 64, "%s's garage (%d slots)", GetName(playerid), PlayerInfo[playerid][pVehicleSlots]); ShowPlayerDialog(playerid, 0, DIALOG_STYLE_TABLIST_HEADERS, title, string, "Select","Close"); return true; }
Gabi21 Posted January 5, 2022 Posted January 5, 2022 Arată-ne funcția care încarcă vehiculele, văd că lucrezi pe iteratorii, probabil nu ai băgat vehiculul corect în iteratoriul PlayerVehicles.
cristi1daubnJrr Posted January 6, 2022 Author Posted January 6, 2022 function LoadPersonalVehicles(playerid) { if(!chache_num_rows()) return true; new id, string[64]; for(new i = 1; i < (cache_num_rows() + 1); i++) { id = Iter_Free(TotalPlayerVehicles); PersonalVehicle[id][pvID] = cache_get_field_content_int(i - 1, "ID", mysql); PersonalVehicle[id][pvModelID] = cache_get_field_content_int(i - 1, "ModelID", mysql); PersonalVehicle[id][pvOwnerID] = cache_get_field_content_int(i - 1, "OwnerID", mysql); PersonalVehicle[id][pvColorOne] = cache_get_field_content_int(i - 1, "ColorOne", mysql); PersonalVehicle[id][pvColorTwo] = cache_get_field_content_int(i - 1, "ColorTwo", mysql); PersonalVehicle[id][pvX] = cache_get_field_content_float(i - 1, "X", mysql); PersonalVehicle[id][pvY] = cache_get_field_content_float(i - 1, "Y", mysql); PersonalVehicle[id][pvZ] = cache_get_field_content_float(i - 1, "Z", mysql); PersonalVehicle[id][pvAngle] = cache_get_field_content_float(i - 1, "Angle", mysql); PersonalVehicle[id][pvOdometer] = cache_get_field_content_float(i - 1, "Odometer", mysql); PersonalVehicle[id][pvFuel] = cache_get_field_contentfloatt(i - 1, "Fuel", mysql); PersonalVehicle[id][pvAge] = cache_get_field_content_int(i - 1, "Age", mysql); PersonalVehicle[id][pvInsurancePoints] = cache_get_field_content_int(i - 1, "InsurancePoints", mysql); PersonalVehicle[id][pvLock] = cache_get_field_content_int(i - 1, "LockStatus", mysql); PersonalVehicle[id][pvSpawnedID] = INVALID_VEHICLE_ID; PersonalVehicle[id][pvDespawnTime] = 0; cache_get_field_content(i - 1, "CarPlate", PersonalVehicle[id][pvCarPlate], mysql, 12); cache_get_field_content(i - 1, "Components", string, mysql, 64); sscanf(string, "p<|>ddddddddddddddddd", PersonalVehicle[id][pvComponents][0], PersonalVehicle[id][pvComponents][1], PersonalVehicle[id][pvComponents][2], PersonalVehicle[id][pvComponents][3], PersonalVehicle[id][pvComponents][4], PersonalVehicle[id][pvComponents][5], PersonalVehicle[id][pvComponents][6], PersonalVehicle[id][pvComponents][7], PersonalVehicle[id][pvComponents][8], PersonalVehicle[id][pvComponents][9], PersonalVehicle[id][pvComponents][10], PersonalVehicle[id][pvComponents][11], PersonalVehicle[id][pvComponents][12], PersonalVehicle[id][pvComponents][13], PersonalVehicle[id][pvComponents][14], PersonalVehicle[id][pvComponents][15], PersonalVehicle[id][pvComponents][16]); Iter_Add(TotalPlayerVehicles, id); Iter_Add(PlayerVehicles[playerid], id); } return printf("[Account] %s loaded %d vehicles.", GetName(playerid),Iter_count(PlayerVehicles[playerid])); } function LoadPersonalVehicles(playerid) { new Cache: db = mysql_query (SQL, "SELECT * FROM `cars` ORDER BY `cars`.`ID` ASC"); new id, string[64]; for (new i, j = cache_get_row_count (); i != j; ++i) { cars ++; id = Iter_Free(TotalPlayerVehicles); PersonalVehicle[id][pvID] = cache_get_field_content_int(i - 1, "ID", SQL); PersonalVehicle[id][pvModel] = cache_get_field_content_int(i - 1, "Model", SQL); PersonalVehicle[id][pvOwnerID] = cache_get_field_content_int(i - 1, "OwnerID", SQL); PersonalVehicle[id][pvColorOne] = cache_get_field_content_int(i - 1, "ColorOne", SQL); PersonalVehicle[id][pvColorTwo] = cache_get_field_content_int(i - 1, "ColorTwo", SQL); PersonalVehicle[id][pvX] = cache_get_field_content_float(i - 1, "X", SQL); PersonalVehicle[id][pvY] = cache_get_field_content_float(i - 1, "Y", SQL); PersonalVehicle[id][pvZ] = cache_get_field_content_float(i - 1, "Z", SQL); PersonalVehicle[id][pvAngle] = cache_get_field_content_float(i - 1, "Angle", SQL); PersonalVehicle[id][pvOdometer] = cache_get_field_content_float(i - 1, "Odometer", SQL); PersonalVehicle[id][pvFuel] = cache_get_field_content_float(i - 1, "Fuel", SQL); PersonalVehicle[id][pvAge] = cache_get_field_content_int(i - 1, "Age", SQL); PersonalVehicle[id][pvInsurancePoints] = cache_get_field_content_int(i - 1, "InsurancePoints", SQL); PersonalVehicle[id][pvLock] = cache_get_field_content_int(i - 1, "LockStatus", SQL); PersonalVehicle[id][pvSpawnedID] = INVALID_VEHICLE_ID; PersonalVehicle[id][pvDespawnTime] = 0; cache_get_field_content(i - 1, "CarPlate", PersonalVehicle[id][pvCarPlate], SQL, 12); cache_get_field_content(i - 1, "Owner", PersonalVehicle[id][pvOwner], SQL, 32); cache_get_field_content(i - 1, "Components", string, SQL, 64); sscanf(string, "p<|>ddddddddddddddddd", PersonalVehicle[id][pvComponents][0], PersonalVehicle[id][pvComponents][1], PersonalVehicle[id][pvComponents][2], PersonalVehicle[id][pvComponents][3], PersonalVehicle[id][pvComponents][4], PersonalVehicle[id][pvComponents][5], PersonalVehicle[id][pvComponents][6], PersonalVehicle[id][pvComponents][7], PersonalVehicle[id][pvComponents][8], PersonalVehicle[id][pvComponents][9], PersonalVehicle[id][pvComponents][10], PersonalVehicle[id][pvComponents][11], PersonalVehicle[id][pvComponents][12], PersonalVehicle[id][pvComponents][13], PersonalVehicle[id][pvComponents][14], PersonalVehicle[id][pvComponents][15], PersonalVehicle[id][pvComponents][16]); Iter_Add(TotalPlayerVehicles, id); Iter_Add(PlayerVehicles[playerid], id); } printf("[SERVER]: %d personal cars loaded.", cars); cache_delete(db); return 1; } Prima functie este cea standard pe care am scris o din tutoialul lui Growy iar a doua functie am adaptato ca cea de la loadhouse dar nu ar cam aveam nicio treaba deoarece stiu ca systemul de masini trebuie facut pe iteratori.
Hiro Posted February 21, 2022 Posted February 21, 2022 Salut stiu ca este cam vechi acest topic dar am sa imi spun opinia parerea mea sincera este ca daca noi iti dam sistemul intreg tu nu ai sa inveti niciodata cum se face daca cauti pe youtube sau daca iti bati putin capul Web Developer My portfolio: Click
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now