[POMOC]Speedo


Započeo Rush, Februar 23, 2013, 16:56:09 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim:CLRP
Detaljan opis problema:Napravio sam speedo i sad stavim 100l a pokazuje 45l goriva ja stavim na 45l goriva i nikako nece da skida gorivo
Dio skripte:Dacu ako treba

Blaeks

*

Madmen




Blaeks

*

Madmen

postavis tajmer pod ongamemodeinit, on ce ti pokretati taj tvoj public za sppedo

Citat: Blaeks poslato Februar 23, 2013, 17:11:38 POSLE PODNE
postavis tajmer pod ongamemodeinit, on ce ti pokretati taj tvoj public za sppedo
Jel ovaj timer CheckStatusTimer?

Blaeks

*

Madmen

to ti je u gf modovima tajmer za kao neki sppedo

Citat: Blaeks poslato Februar 23, 2013, 17:30:42 POSLE PODNE
to ti je u gf modovima tajmer za kao neki sppedo
Kako onda da stavim?? Mozda ovako SetTimer("CheckStatus", 300, 1);??
Poslednja Izmena: Februar 23, 2013, 17:31:57 POSLE PODNE od Rush

Blaeks

*

Madmen


Citat: Blaeks poslato Februar 23, 2013, 17:35:31 POSLE PODNE
mozes svakako
Stavio sam ovako SetTimer("CheckStatus", 300, 1); i opet nece

//-----------------Speedo--------------------------
new Text:brz0[MAX_PLAYERS];
new Text:brz1[MAX_PLAYERS];
new Text:brz2[MAX_PLAYERS];
new Text:brz3[MAX_PLAYERS];
new Text:brz4[MAX_PLAYERS];
new Text:brz5[MAX_PLAYERS];
new Text:brz6[MAX_PLAYERS];
new Text:brz7[MAX_PLAYERS];
new Text:brz8[MAX_PLAYERS];
new Text:brz9[MAX_PLAYERS];
new Text:brz10[MAX_PLAYERS];
new Text:brz11[MAX_PLAYERS];
new Text:brz12[MAX_PLAYERS];
new Text:brz13[MAX_PLAYERS];
//------------------------------------------------------------------------------
new VehiclesName[][] = {
	"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","Sultan","Yankee","Caddy","Solair","Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
	"Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Hustler","ZR350","Walton","Regina",
	"Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","Cobra11 Car","Virgo","Greenwood",
	"Jetmax","Hotring","Sandking","Blista Compact","P.Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer","Hotring",
	"Bloodring","Rancher","Super GT","Elegant","Journey","Bike","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","Emperor",
	"Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car","Police Car",
	"Police Car","Police Ranger","Picador","S.W.A.T.","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer","Luggage Trailer",
	"Stair T","Boxville","Farm Plow","Utility Trailer" };


Pod OnGameModeInit
for(new i = 0; i < MAX_PLAYERS; i++)
{
brz0[i] = TextDrawCreate(635.000000, 354.000000, "_ _ _ _ _ _");//NL
TextDrawBackgroundColor(brz0[i], 255);
TextDrawFont(brz0[i], 1);
TextDrawLetterSize(brz0[i], 0.500000, 1.000000);
TextDrawColor(brz0[i], 84215041);
TextDrawSetOutline(brz0[i], 0);
TextDrawSetProportional(brz0[i], 1);
TextDrawSetShadow(brz0[i], 1);
TextDrawUseBox(brz0[i], 1);
TextDrawBoxColor(brz0[i], 80);
TextDrawTextSize(brz0[i], 452.000000, 0.000000);

brz1[i] = TextDrawCreate(461.000000, 413.000000, "_");//NL
TextDrawBackgroundColor(brz1[i], 255);
TextDrawFont(brz1[i], 1);
TextDrawLetterSize(brz1[i], 16.450027, -0.500000);
TextDrawColor(brz1[i], 255);
TextDrawSetOutline(brz1[i], 0);
TextDrawSetProportional(brz1[i], 1);
TextDrawSetShadow(brz1[i], 0);
TextDrawUseBox(brz1[i], 1);
TextDrawBoxColor(brz1[i], 255);
TextDrawTextSize(brz1[i], 629.000000, -25.000000);

brz2[i] = TextDrawCreate(636.000000, 353.000000, "_");//NL
TextDrawBackgroundColor(brz2[i], 255);
TextDrawFont(brz2[i], 1);
TextDrawLetterSize(brz2[i], 15.240019, -0.500000);
TextDrawColor(brz2[i], 255);
TextDrawSetOutline(brz2[i], 0);
TextDrawSetProportional(brz2[i], 1);
TextDrawSetShadow(brz2[i], 0);
TextDrawUseBox(brz2[i], 1);
TextDrawBoxColor(brz2[i], 255);
TextDrawTextSize(brz2[i], 453.000000, 0.000000);

brz3[i] = TextDrawCreate(558.000000, 394.000000, "N/A");//NL
TextDrawBackgroundColor(brz3[i], 255);
TextDrawFont(brz3[i], 2);
TextDrawLetterSize(brz3[i], 0.300000, 1.000000);
TextDrawColor(brz3[i], -1);
TextDrawSetOutline(brz3[i], 0);
TextDrawSetProportional(brz3[i], 1);
TextDrawSetShadow(brz3[i], 1);

brz4[i] = TextDrawCreate(626.000000, 394.000000, "_");//NL
TextDrawBackgroundColor(brz4[i], 255);
TextDrawFont(brz4[i], 0);
TextDrawLetterSize(brz4[i], 0.500000, 1.200000);
TextDrawColor(brz4[i], 255);
TextDrawSetOutline(brz4[i], 0);
TextDrawSetProportional(brz4[i], 1);
TextDrawSetShadow(brz4[i], 0);
TextDrawUseBox(brz4[i], 1);
TextDrawBoxColor(brz4[i], 4935935);
TextDrawTextSize(brz4[i], 522.000000, 0.000000);

brz5[i] = TextDrawCreate(637.000000, 354.000000, "_");//NL
TextDrawBackgroundColor(brz5[i], 255);
TextDrawFont(brz5[i], 1);
TextDrawLetterSize(brz5[i], 0.649999, 5.900009);
TextDrawColor(brz5[i], 255);
TextDrawSetOutline(brz5[i], 0);
TextDrawSetProportional(brz5[i], 1);
TextDrawSetShadow(brz5[i], 0);
TextDrawUseBox(brz5[i], 1);
TextDrawBoxColor(brz5[i], 255);
TextDrawTextSize(brz5[i], 626.000000, 0.000000);

brz6[i] = TextDrawCreate(505.000000, 367.000000, "~p~59");//NL
TextDrawBackgroundColor(brz6[i], 255);
TextDrawFont(brz6[i], 2);
TextDrawLetterSize(brz6[i], 0.649999, 2.399998);
TextDrawColor(brz6[i], -16711681);
TextDrawSetOutline(brz6[i], 0);
TextDrawSetProportional(brz6[i], 1);
TextDrawSetShadow(brz6[i], 1);

brz7[i] = TextDrawCreate(567.000000, 364.000000, "KM/H");//NL
TextDrawBackgroundColor(brz7[i], 255);
TextDrawFont(brz7[i], 2);
TextDrawLetterSize(brz7[i], 0.519999, 2.699999);
TextDrawColor(brz7[i], -1);
TextDrawSetOutline(brz7[i], 0);
TextDrawSetProportional(brz7[i], 1);
TextDrawSetShadow(brz7[i], 2);

brz8[i] = TextDrawCreate(541.000000, 355.000000, "NRG-500");//NL
TextDrawBackgroundColor(brz8[i], 255);
TextDrawFont(brz8[i], 2);
TextDrawLetterSize(brz8[i], 0.370000, 1.200000);
TextDrawColor(brz8[i], -1);
TextDrawSetOutline(brz8[i], 0);
TextDrawSetProportional(brz8[i], 1);
TextDrawSetShadow(brz8[i], 1);
/*

brz9[i] = TextDrawCreate(638.000000, 327.000000, "_");
TextDrawAlignment(brz9[i], 2);
TextDrawBackgroundColor(brz9[i], 255);
TextDrawFont(brz9[i], 1);
TextDrawLetterSize(brz9[i], 0.469999, 10.199997);
TextDrawColor(brz9[i], -1);
TextDrawSetOutline(brz9[i], 0);
TextDrawSetProportional(brz9[i], 1);
TextDrawSetShadow(brz9[i], 1);
TextDrawUseBox(brz9[i], 1);
TextDrawBoxColor(brz9[i], 848756735);
TextDrawTextSize(brz9[i], -6.000000, -3.000000);

brz10[i] = TextDrawCreate(581.000000, 342.000000, "_");
TextDrawAlignment(brz10[i], 2);
TextDrawBackgroundColor(brz10[i], 255);
TextDrawFont(brz10[i], 1);
TextDrawLetterSize(brz10[i], 0.519999, -0.300000);
TextDrawColor(brz10[i], -1);
TextDrawSetOutline(brz10[i], 0);
TextDrawSetProportional(brz10[i], 1);
TextDrawSetShadow(brz10[i], 1);
TextDrawUseBox(brz10[i], 1);
TextDrawBoxColor(brz10[i], 848756735);
TextDrawTextSize(brz10[i], 21.000000, 110.000000);

brz11[i] = TextDrawCreate(581.000000, 402.000000, "_");
TextDrawAlignment(brz11[i], 2);
TextDrawBackgroundColor(brz11[i], 255);
TextDrawFont(brz11[i], 1);
TextDrawLetterSize(brz11[i], 0.519999, -0.300000);
TextDrawColor(brz11[i], -1);
TextDrawSetOutline(brz11[i], 0);
TextDrawSetProportional(brz11[i], 1);
TextDrawSetShadow(brz11[i], 1);
TextDrawUseBox(brz11[i], 1);
TextDrawBoxColor(brz11[i], 848756735);
TextDrawTextSize(brz11[i], 21.000000, 110.000000);

brz12[i] = TextDrawCreate(522.000000, 359.000000, "-");
TextDrawBackgroundColor(brz12[i], 255);
TextDrawFont(brz12[i], 2);
TextDrawLetterSize(brz12[i], 9.810001, 1.000000);
TextDrawColor(brz12[i], -1);
TextDrawSetOutline(brz12[i], 0);
TextDrawSetProportional(brz12[i], 1);
TextDrawSetShadow(brz12[i], 1);
*/
brz13[i] = TextDrawCreate(475.000000, 355.000000, "~y~Vozilo:");//NL
TextDrawBackgroundColor(brz13[i], 255);
TextDrawFont(brz13[i], 2);
TextDrawLetterSize(brz13[i], 0.370000, 1.200000);
TextDrawColor(brz13[i], -1);
TextDrawSetOutline(brz13[i], 0);
TextDrawSetProportional(brz13[i], 1);
TextDrawSetShadow(brz13[i], 1);
}


forward CheckGas();
public CheckGas()
{
	new string[256];
	foreach (Player, i)
	{
   	    if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
   	    {
       		new vehicle = GetPlayerVehicleID(i);
        	if(Gas[vehicle] >= 1)
	   		{
	   		    if(Gas[vehicle] <= 10)
			    {
		   			PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
		   			if(gGas[i] == 0) {
		   				GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Rezervoar je skoro prazan",5000,3);
					}
			    }
	   		    if(gGas[i] == 1) {
	   		    if(IsAPlane(vehicle) || IsABoat(vehicle) || IsABike(vehicle) || IsAHarvest(vehicle) || IsNpcVehicle(vehicle))
	   		    {
	      			format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~Gorivo:~w~ N/A");
				}
				else
				{
                	format(string, sizeof(string), "~b~~n~~n~~n~~n~~n~~n~~n~~n~~n~Gorivo:~w~ %d%",Gas[vehicle]);
				}
	      		GameTextForPlayer(i,string,20500,3); }
				if(IsAPlane(vehicle) || IsNpcVehicle(vehicle) || IsABoat(vehicle) || IsABike(vehicle) || IsAHarvest(vehicle) || engineOn[vehicle] == 0) { Gas[vehicle]++; }
              	Gas[vehicle]--;
	   		}
   			else
           	{
              	NoFuel[i] = 1;
              	TogglePlayerControllable(i, 0);
	        	GameTextForPlayer(i,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Nema goriva u vozilu",1500,3);
			}
    	}
	}
	return 1;
}[/code
[code]forward CheckStatus();
public CheckStatus()
{
	foreach (Player, i)
	{
			if(IsPlayerInAnyVehicle(i))
			{
			  if(TextShow[i] == false)
				{
				        TextDrawShowForPlayer(i, brz0[i]);
                        TextDrawShowForPlayer(i, brz1[i]);
                        TextDrawShowForPlayer(i, brz2[i]);
                        TextDrawShowForPlayer(i, brz3[i]);
                        TextDrawShowForPlayer(i, brz4[i]);
                        TextDrawShowForPlayer(i, brz5[i]);
                        TextDrawShowForPlayer(i, brz6[i]);
                        TextDrawShowForPlayer(i, brz7[i]);
                        TextDrawShowForPlayer(i, brz8[i]);
						TextDrawShowForPlayer(i, brz9[i]);
                        TextDrawShowForPlayer(i, brz10[i]);
                        TextDrawShowForPlayer(i, brz11[i]);
                        TextDrawShowForPlayer(i, brz12[i]);
                        TextDrawShowForPlayer(i, brz13[i]);
						TextShow[i] = true;
				}
			    new String[128];
		        new Float:X, Float:Y, Float:Z, Float:Speed;
		        new vehicle = GetPlayerVehicleID(i);
                GetVehicleVelocity(GetPlayerVehicleID(i), X, Y, Z);
                Speed = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 50.0);
				format(String,sizeof(String),"~p~%i", floatround(Speed*2, floatround_floor));
                TextDrawSetString(brz6[i], String);
                format(String,sizeof(String),"%i L", Gas[vehicle]);
                TextDrawSetString(brz3[i], String);
                format(String,sizeof(String),"%s", VehiclesName[GetVehicleModel(vehicle)-400]);
                TextDrawSetString(brz8[i], String);

			}
			else
			{
			    if(TextShow[i] == true)
			    {
				    TextDrawHideForPlayer(i, brz0[i]);
                    TextDrawHideForPlayer(i, brz1[i]);
                    TextDrawHideForPlayer(i, brz2[i]);
                    TextDrawHideForPlayer(i, brz3[i]);
                    TextDrawHideForPlayer(i, brz4[i]);
                    TextDrawHideForPlayer(i, brz5[i]);
                    TextDrawHideForPlayer(i, brz6[i]);
                    TextDrawHideForPlayer(i, brz7[i]);
                    TextDrawHideForPlayer(i, brz8[i]);
					TextDrawHideForPlayer(i, brz9[i]);
                    TextDrawHideForPlayer(i, brz10[i]);
                    TextDrawHideForPlayer(i, brz11[i]);
                    TextDrawHideForPlayer(i, brz12[i]);
                    TextDrawHideForPlayer(i, brz13[i]);
					TextShow[i] = false;
			}
		}
	}
}


Pod public GameModeExitFunc()

    for(new i = 0; i < MAX_PLAYERS; i++)
    {
	TextDrawDestroy(Text:brz0[i]);
    TextDrawDestroy(Text:brz1[i]);
    TextDrawDestroy(Text:brz2[i]);
    TextDrawDestroy(Text:brz3[i]);
    TextDrawDestroy(Text:brz4[i]);
    TextDrawDestroy(Text:brz5[i]);
    TextDrawDestroy(Text:brz6[i]);
    TextDrawDestroy(Text:brz7[i]);
    TextDrawDestroy(Text:brz9[i]);



Blaeks

*

Madmen

mogu ja, da naucis da postujes pravila