-
Posts
10 -
Joined
-
Last visited
Content Type
Profiles
Forums
News
Documentation
Posts posted by cristi1daubnJrr
-
-
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.
-
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?
QuoteYCMD: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;
} -
33 minutes ago, hanako said:
https://www.youtube.com/c/GroWyTuts/playlists
Le ai la "Tutoriale Pawn"
Am gasit, mersi baros
-
Astept sugestii sau chiar ajutorul vostru in continuare, nu am gasit sistemul de vehicule personale pe ytb.
-
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
-
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 :))
-
Man, tu in folder-ul unde ai tde-ul trebuie sa pui si scriptfiles din samp037_svr_R2-1-1_win32.zip
Uite link de unde poti lo-a samp037_svr_R2-1-1_win32.zip!
Cu placere!
-
Mane ma poti ajuta?imi da o eroare la compilare.
C:\Users\Crist\Desktop\********(by SuNNeR (2)\********(by SuNNeR\gamemodes\backup 9 57.pwn(17) : fatal error 100: cannot read from file: "geolocation"
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
1 Error.
-
Mane are bugul la login,mi sa connectat la baza de date dar tot are bugul la login
Succes
Ma ajuti?
Respawn masini
in Ajutor Scripting
Posted
incearca SendClientMessage(playerid, COLOR_WHITE, "Masina a fost respawnata cu succes!");
sau incearca sa formatezi mesajul, format(string, sizeof(string), "%s si-a respawnat masina!", GetName(playerid));