CMD:getcar(playerid, params[]){new jarmuid;if(sscanf(params, \"d\", jarmuid)) return SendClientMessage(playerid, -1, \"(( Használat: /gotocar [DBID] ))\");if(jarmuid >= 1 && jarmuid <= SzSettings[Max_Vehicle]){new vehicleid = VehicleInfo[jarmuid-1][DBID];new Float:pX, Float:pY, Float:pZ;GetPlayerPos(playerid, pX, pY, pZ);SetVehiclePos(vehicleid, pX, pY+3, pZ+0.5 ); }
Hát én így gondolkoztam, de nem jó: CMD:getcar(playerid, params[]){new jarmuid;if(sscanf(params, \"d\", jarmuid)) return SendClientMessage(playerid, -1, \"(( Használat: /gotocar [DBID] ))\");if(jarmuid >= 0 && jarmuid <= SzSettings[Max_Vehicle]){new vehicleid = -1; new i; while(vehicleid == -1) { if(VehicleInfo[DBID] == jarmuid) vehicleid = i; else i++; }new Float:pX, Float:pY, Float:pZ;GetPlayerPos(playerid, pX, pY, pZ);SetVehiclePos(vehicleid, pX, pY+3, pZ+0.5 ); }
CMD:getcar(playerid, params[]){new jarmuid;if(sscanf(params, \"d\", jarmuid)) return SendClientMessage(playerid, -1, \"(( Használat: /gotocar [DBID] ))\");if(jarmuid >= 0 && jarmuid <= SzSettings[Max_Vehicle]){new vehicleid = -1; new i; while(vehicleid == -1) { if(VehicleInfo[DBID] == jarmuid) vehicleid = i; else i++; }new Float:pX, Float:pY, Float:pZ;GetPlayerPos(playerid, pX, pY, pZ);SetVehiclePos(vehicleid, pX, pY+3, pZ+0.5 ); }
public VehicleLoad(){ new sorok, mezok; cache_get_data(sorok, mezok, kapcs);new vehtulaj[MAX_PLAYER_NAME] , plate[64];new vehicleid;if(sorok == 0){print(\"Nincsen kocsi az adatbázisban!\");}else{for(new i = 0; i < sorok; i++){ new VehID = cache_get_row_int(i, 0, kapcs); cache_get_row(i, 1, vehtulaj, kapcs, sizeof(vehtulaj)); new model = cache_get_row_int(i, 2, kapcs ); new Float: VehX = cache_get_row_float(i, 3, kapcs); new Float: VehY = cache_get_row_float(i, 4, kapcs); new Float: VehZ = cache_get_row_float(i, 5, kapcs); new Float: VehA = cache_get_row_float(i, 6, kapcs); new Float: VehHP = cache_get_row_float(i, 7, kapcs); new szin1 = cache_get_row_int(i, 8, kapcs); new szin2 = cache_get_row_int(i, 9, kapcs); cache_get_row(i, 10, plate, kapcs, sizeof(plate)); new Uzemenyagtiups = cache_get_row_int(i, 11, kapcs); new Uzemanyagszint = cache_get_row_int(i, 12, kapcs); VehicleInfo[DBID] = VehID; VehicleInfo[Owner] = vehtulaj; VehicleInfo[ModID] = model; VehicleInfo[spawn][0] = VehX; VehicleInfo[spawn][1] = VehY; VehicleInfo[spawn][2] = VehZ; VehicleInfo[spawn][3] = VehA; VehicleInfo[HP] = VehHP; VehicleInfo[color][0] = szin1; VehicleInfo[color][1] = szin2; VehicleInfo[rendszam] = plate; VehicleInfo[FuelType] = Uzemenyagtiups; VehicleInfo[FuelLevel] = Uzemanyagszint; VehicleInfo[DLID] = i+1; SzSettings[Max_Vehicle] += 1; Letrehozva = true; if(i != INVALID_VEHICLE_ID) { vehicleid = AddStaticVehicle(model, VehX, VehY, VehZ, VehA, szin1, szin2); SetVehicleHealth(vehicleid, VehHP); SetVehicleNumberPlate(vehicleid, plate); }}}return 1;}
CMD:getcar(playerid, params[]){ new jarmuid; if(sscanf(params, \"d\", jarmuid)) return SendClientMessage(playerid, -1, \"(( Használat: /gotocar [DBID] ))\"); if(jarmuid >= 0 && jarmuid <= SzSettings[Max_Vehicle]) { new vehicleid = -1; new i; while(vehicleid == -1) { if(VehicleInfo[DBID] == jarmuid) vehicleid = i+1; else i++; } new Float:pX, Float:pY, Float:pZ; GetPlayerPos(playerid, pX, pY, pZ); SetVehiclePos(vehicleid, pX, pY+3, pZ+0.5 ); }return 1;}
if(VehicleInfo[DBID] == jarmuid) vehicleid = i+1;