Peršokti į turinį
  • ŽAIDIMAI
  • , ŽAIDIMAI
  • ŽAIDIMAI

Ši tema yra neaktyvi. Paskutinis pranešimas šioje temoje buvo prieš 4886 dienas (-ų). Patariame sukurti naują temą, o ne rašyti naują pranešimą.

Už neaktyvių temų prikėlimą galite sulaukti įspėjimo ir pranešimo pašalinimo!

Recommended Posts

Pradėkim:

1 Punktas

Viršuje GM prie kitų NEW rašome tokias eilutes:

new Text:spidometras[MAX_PLAYERS];

new Text:SPEEDOS[MAX_PLAYERS];

new bool: ShiftInfo[MAX_PLAYERS] = true;

new ShiftTimer[MAX_PLAYERS];

Šios eilutės sukuris spidometro kintamuosius.

2 Punktas

Susirandame callback'ą Public OnPlayerConnect Po juo rašome:

spidometras[playerid] = TextDrawCreate(285.000000, 390.000000, "spidometras");

TextDrawFont(spidometras[playerid], 3);

TextDrawLetterSize(spidometras[playerid], 0.390000, 0.899999);

TextDrawColor(spidometras[playerid], -1);

TextDrawSetOutline(spidometras[playerid], 1);

TextDrawSetProportional(spidometras[playerid], 1);

TextDrawTextSize(spidometras[playerid], 405.000000, 0.000000);

SPEEDOS[playerid] = TextDrawCreate(254.000000, 389.000000, " ");

TextDrawBackgroundColor(SPEEDOS[playerid], 0x000000bb);

TextDrawFont(SPEEDOS[playerid], 2);

TextDrawLetterSize(SPEEDOS[playerid], 0.2300, 0.8999);

TextDrawColor(SPEEDOS[playerid], -1);

TextDrawSetOutline(SPEEDOS[playerid], 1);

TextDrawSetProportional(SPEEDOS[playerid], 1);

TextDrawUseBox(SPEEDOS[playerid], 1);

TextDrawBoxColor(SPEEDOS[playerid], 0x00000055);

TextDrawTextSize(SPEEDOS[playerid], 405.000000, 0.000000);

ShiftInfo[playerid] = (ShiftInfo[playerid] == false) ? (true) : (true);

ShiftTimer[playerid] = SetTimerEx("Speedometer", 200, true, "e", playerid);

Šios eilutės sukuria spidometro TextDraw'us.

3 Punktas

GM viršuje prie kitų forward rašome forward Speedometer(playerid);

Tada pačio modo apčioje dedame:

public Speedometer(playerid)

{

new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;

vehicleid = GetPlayerVehicleID(playerid);

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

{

new VehicleNames[212][] = {

"Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",

"Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",

"Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",

"Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",

"Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",

"Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",

"Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",

"Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",

"Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",

"Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",

"Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",

"Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",

"Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",

"Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",

"Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",

"Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",

"Stair Trailer","Boxville","Farm Plow","Utility Trailer" };

new masinosbukle[10];

new Float:health;

GetVehicleHealth(vehicleid, health);

if(health >900)

{

format(masinosbukle, sizeof(masinosbukle), "~g~%.1f%", health/10);

}

else if(health >800)

{

format(masinosbukle, sizeof(masinosbukle), "~g~%.1f%", health/10);

}

else if(health >700)

{

format(masinosbukle, sizeof(masinosbukle), "~g~%.1f%", health/10);

}

else if(health >600)

{

format(masinosbukle, sizeof(masinosbukle), "~y~%.1f%", health/10);

}

else if(health >500)

{

format(masinosbukle, sizeof(masinosbukle), "~y~%.1f%", health/10);

}

else if(health >400)

{

format(masinosbukle, sizeof(masinosbukle), "~y~%.1f%", health/10);

}

else if(health >300)

{

format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

}

else if(health >200)

{

format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

}

else if(health >100)

{

format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

}

else if(health <100)

{

format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

}

new model = GetVehicleModel(vehicleid);

GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);

final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*216.666667; // 136.666667 = kmph // 85.4166672= mph

final_speed_int = floatround(final_speed,floatround_round);

vehicleDB[vehicleid][prav] += final_speed;

if(ShiftInfo[playerid] == true)

{

format(speed_string,156,"~n~~n~ ~y~Transportas: ~w~%s~n~ ~g~Greitis: ~w~%i KM/h~n~ ~r~Bukle: ~w~%s~n~ ~b~Degalai: ~w~%dL~n~ ~p~Pravaziuota: ~w~%.2fKm", VehicleNames[model-400], final_speed_int, masinosbukle, vehicleDB[vehicleid][gas], vehicleDB[vehicleid][prav]/100000);

TextDrawSetString(SPEEDOS[playerid], speed_string);

TextDrawShowForPlayer(playerid, spidometras[playerid]);

TextDrawShowForPlayer(playerid, SPEEDOS[playerid]);

}else{

TextDrawHideForPlayer(playerid, spidometras[playerid]);

TextDrawHideForPlayer(playerid, SPEEDOS[playerid]);

}

}else{

TextDrawHideForPlayer(playerid, spidometras[playerid]);

TextDrawHideForPlayer(playerid, SPEEDOS[playerid]);

}

return 1;

}

Kaikurie paaiškinimai

new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;

vehicleid = GetPlayerVehicleID(playerid);

if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)

Šis kodas sukuria "Stringus"

new VehicleNames[212][] = {

"Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",

"Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",

"Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",

"Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",

"Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",

"Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",

"Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",

"Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",

"Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",

"Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",

"Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",

"Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",

"Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",

"Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",

"Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",

"Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",

"Stair Trailer","Boxville","Farm Plow","Utility Trailer" };

Šis kodas gauna mašinos varda kurioje jus sėdite.

new masinosbukle[10];

new Float:health;

GetVehicleHealth(vehicleid, health);

if(health >900)

{

format(masinosbukle, sizeof(masinosbukle), "~g~%.1f%", health/10);

}

else if(health >800)

{

format(masinosbukle, sizeof(masinosbukle), "~g~%.1f%", health/10);

}

else if(health >700)

{

format(masinosbukle, sizeof(masinosbukle), "~g~%.1f%", health/10);

}

else if(health >600)

{

format(masinosbukle, sizeof(masinosbukle), "~y~%.1f%", health/10);

}

else if(health >500)

{

format(masinosbukle, sizeof(masinosbukle), "~y~%.1f%", health/10);

}

else if(health >400)

{

format(masinosbukle, sizeof(masinosbukle), "~y~%.1f%", health/10);

}

else if(health >300)

{

format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

}

else if(health >200)

{

format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

}

else if(health >100)

{

format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

}

else if(health <100)

{

format(masinosbukle, sizeof(masinosbukle), "~r~%.1f%", health/10);

}

Šis kodas gauna mašinos būklę.

new model = GetVehicleModel(vehicleid);

GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);

final_speed = floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*216.666667; // 136.666667 = kmph // 85.4166672= mph

final_speed_int = floatround(final_speed,floatround_round);

vehicleDB[vehicleid][prav] += final_speed;

Šis kodas išgauna mašinos greiti kurioje jūs sėdite.

if(ShiftInfo[playerid] == true)

{

format(speed_string,156,"~n~~n~ ~y~Transportas: ~w~%s~n~ ~g~Greitis: ~w~%i KM/h~n~ ~r~Bukle: ~w~%s~n~ ~b~Degalai: ~w~%dL~n~ ~p~Pravaziuota: ~w~%.2fKm", VehicleNames[model-400], final_speed_int, masinosbukle, vehicleDB[vehicleid][gas], vehicleDB[vehicleid][prav]/100000);

TextDrawSetString(SPEEDOS[playerid], speed_string);

TextDrawShowForPlayer(playerid, spidometras[playerid]);

TextDrawShowForPlayer(playerid, SPEEDOS[playerid]);

}else{

TextDrawHideForPlayer(playerid, spidometras[playerid]);

TextDrawHideForPlayer(playerid, SPEEDOS[playerid]);

}

}else{

TextDrawHideForPlayer(playerid, spidometras[playerid]);

TextDrawHideForPlayer(playerid, SPEEDOS[playerid]);

}

Šis kodas sukuria TextDraw'ą įsėdus į mašina bei rodo mašinos buklę, ridą, greitį, bei panaikina spidometrą jums išlipus iš mašinos.

Spidometro Nuotrauka

http://www.part.lt/img/671f3824873bd8397f254d6d449393bc189.bmp

Jei meta kokių nors error'ų būtinai rašykite čia.

jei galite rep ^^ tiek manes nesmerkite :)

http://www.ls-ramos.tk

Modifikacijų tinklapis.

  • Farming simulator 2011
  • Farming simulator 2011
  • Euro Truck simulator 2

Greitu metu, bus paskelbtas konkursas (pagal modifikacijų įkėlimo skaičių), kuriame galėsite laimėti FS 2013/2011 MP kodus arba originalų ETS2 kodą (bus pilnas žaidimas, nereikės iš lempos įvedinėti iš naujo kodo ir panašiai).

Laukiami visi!

Registruokitės.

Ši tema yra neaktyvi. Paskutinis pranešimas šioje temoje buvo prieš 4886 dienas (-ų). Patariame sukurti naują temą, o ne rašyti naują pranešimą.

Už neaktyvių temų prikėlimą galite sulaukti įspėjimo ir pranešimo pašalinimo!

Prisijungti prie diskusijos

Palikti atsakymą galite iš karto, o užsiregistruoti vėliau. Jeigu jau turite paskyrą mūsų forume, Prisijunkite.

Svečias
Atsakyti šioje temoje...

×   Įklijuotas tekstas turi teksto formatavimą.   Pašalinti teksto formatavimą

  Galimi tik 75 veidukai.

×   Nuoroda buvo automatiškai įterpta.   Įterpti nuorodą paprastai

×   Jūsų ankstesnis pranešimas buvo atkurtas.   Išvalyti redaktorių

×   Jūs negalite įkelti nuotraukas tiesiogiai.Įkelkite arba įdėkite nuotraukas iš URL.

  • Šiame puslapyje naršo:   0 nariai

    • Nėra registruotų narių peržiūrinčių šį forumą.

×
×
  • Sukurti naują...