Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new Text:ServerTextDrawOne;
- new Text:ServerTextDrawTwo;
- new Text:ServerTextDrawThree[MAX_PLAYERS];
- new Text:ServerTextDrawFour[MAX_PLAYERS];
- new Text:ServerTextDrawFive[MAX_PLAYERS];
- new Text:ServerTextDrawSix[MAX_PLAYERS];
- new Text:ServerTextDrawSeven[MAX_PLAYERS];
- new Text:ServerTextDrawEight[MAX_PLAYERS];
- new ServerTimerOne;
- new VehicleNames[][] =
- {
- {"Landstalker"},
- {"Bravura"},
- {"Buffalo"},
- {"Linerunner"},
- {"Perrenial"},
- {"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 1"},
- {"Previon"},
- {"Coach"},
- {"Cabbie"},
- {"Stallion"},
- {"Rumpo"},
- {"RC Bandit"},
- {"Romero"},
- {"Packer"},
- {"Monster 1"},
- {"Admiral"},
- {"Squalo"},
- {"Seasparrow"},
- {"Pizzaboy"},
- {"Tram"},
- {"Trailer 2"},
- {"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"},
- {"ZR-350"},
- {"Walton"},
- {"Regina"},
- {"Comet"},
- {"BMX"},
- {"Burrito"},
- {"Camper"},
- {"Marquis"},
- {"Baggage"},
- {"Dozer"},
- {"Maverick"},
- {"News Chopper"},
- {"Rancher 1"},
- {"FBI Rancher"},
- {"Virgo"},
- {"Greenwood"},
- {"Jetmax"},
- {"Hotring Racer 1"},
- {"Sandking"},
- {"Blista Compact"},
- {"Police Maverick"},
- {"Boxville"},
- {"Benson"},
- {"Mesa"},
- {"RC Goblin"},
- {"Hotring Racer 2"},
- {"Hotring Racer 3"},
- {"Bloodring Banger"},
- {"Rancher 2"},
- {"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 LA"},
- {"Hustler"},
- {"Intruder"},
- {"Primo"},
- {"Cargobob"},
- {"Tampa"},
- {"Sunrise"},
- {"Merit"},
- {"Utility"},
- {"Nevada"},
- {"Yosemite"},
- {"Windsor"},
- {"Monster 2"},
- {"Monster 3"},
- {"Uranus"},
- {"Jester"},
- {"Sultan"},
- {"Stratum"},
- {"Elegy"},
- {"Raindance"},
- {"RC Tiger"},
- {"Flash"},
- {"Tahoma"},
- {"Savanna"},
- {"Bandito"},
- {"Freight Flat"},
- {"Streak Carriage"},
- {"Kart"},
- {"Mower"},
- {"Duneride"},
- {"Sweeper"},
- {"Broadway"},
- {"Tornado"},
- {"AT-400"},
- {"DFT-30"},
- {"Huntley"},
- {"Stafford"},
- {"BF-400"},
- {"Newsvan"},
- {"Tug"},
- {"Trailer 3"},
- {"Emperor"},
- {"Wayfarer"},
- {"Euros"},
- {"Hotdog"},
- {"Club"},
- {"Freight Carriage"},
- {"Trailer 4"},
- {"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 1"},
- {"Luggage Trailer 2"},
- {"Stair Trailer"},
- {"Boxville"},
- {"Farm Plow"},
- {"Utility Trailer"}
- };
- forward PlayerUpdate();
- stock VehicleSpeed(Vehicle)
- {
- new Float:X;
- new Float:Y;
- new Float:Z;
- GetVehicleVelocity(Vehicle,X,Y,Z);
- new Float:Speed;
- Speed = floatsqroot(floatpower(floatabs(X),2.0) + floatpower(floatabs(Y),2.0) + floatpower(floatabs(Z),2.0)) * 200.0;
- return floatround(Speed);
- }
- public OnFilterScriptInit()
- {
- ServerTextDrawOne = TextDrawCreate(560.000000,120.000000,"-");
- TextDrawAlignment(ServerTextDrawOne,2);
- TextDrawBackgroundColor(ServerTextDrawOne,80);
- TextDrawFont(ServerTextDrawOne,1);
- TextDrawLetterSize(ServerTextDrawOne,15.000000,50.000000);
- TextDrawColor(ServerTextDrawOne,80);
- TextDrawSetOutline(ServerTextDrawOne,0);
- TextDrawSetProportional(ServerTextDrawOne,1);
- TextDrawSetShadow(ServerTextDrawOne,1);
- ServerTextDrawTwo = TextDrawCreate(560.000000,370.000000,"~W~~H~Status Pojazdu");
- TextDrawAlignment(ServerTextDrawTwo,2);
- TextDrawBackgroundColor(ServerTextDrawTwo,255);
- TextDrawFont(ServerTextDrawTwo,3);
- TextDrawLetterSize(ServerTextDrawTwo,0.500000,1.000000);
- TextDrawColor(ServerTextDrawTwo,-1);
- TextDrawSetOutline(ServerTextDrawTwo,1);
- TextDrawSetProportional(ServerTextDrawTwo,1);
- for(new Player; Player < GetMaxPlayers(); Player++)
- {
- ServerTextDrawThree[Player] = TextDrawCreate(490.000000,380.000000," ");
- TextDrawBackgroundColor(ServerTextDrawThree[Player],255);
- TextDrawFont(ServerTextDrawThree[Player],2);
- TextDrawLetterSize(ServerTextDrawThree[Player],0.200000,1.000000);
- TextDrawColor(ServerTextDrawThree[Player],-1);
- TextDrawSetOutline(ServerTextDrawThree[Player],1);
- TextDrawSetProportional(ServerTextDrawThree[Player],1);
- ServerTextDrawFour[Player] = TextDrawCreate(490.000000,390.000000," ");
- TextDrawBackgroundColor(ServerTextDrawFour[Player],255);
- TextDrawFont(ServerTextDrawFour[Player],2);
- TextDrawLetterSize(ServerTextDrawFour[Player],0.200000,1.000000);
- TextDrawColor(ServerTextDrawFour[Player],-1);
- TextDrawSetOutline(ServerTextDrawFour[Player],1);
- TextDrawSetProportional(ServerTextDrawFour[Player],1);
- ServerTextDrawFive[Player] = TextDrawCreate(490.000000,400.000000," ");
- TextDrawBackgroundColor(ServerTextDrawFive[Player],255);
- TextDrawFont(ServerTextDrawFive[Player],2);
- TextDrawLetterSize(ServerTextDrawFive[Player],0.200000,1.000000);
- TextDrawColor(ServerTextDrawFive[Player],-1);
- TextDrawSetOutline(ServerTextDrawFive[Player],1);
- TextDrawSetProportional(ServerTextDrawFive[Player],1);
- ServerTextDrawSix[Player] = TextDrawCreate(490.000000,410.000000," ");
- TextDrawBackgroundColor(ServerTextDrawSix[Player],255);
- TextDrawFont(ServerTextDrawSix[Player],2);
- TextDrawLetterSize(ServerTextDrawSix[Player],0.200000,1.000000);
- TextDrawColor(ServerTextDrawSix[Player],-1);
- TextDrawSetOutline(ServerTextDrawSix[Player],1);
- TextDrawSetProportional(ServerTextDrawSix[Player],1);
- ServerTextDrawSeven[Player] = TextDrawCreate(490.000000,420.000000," ");
- TextDrawBackgroundColor(ServerTextDrawSeven[Player],255);
- TextDrawFont(ServerTextDrawSeven[Player],2);
- TextDrawLetterSize(ServerTextDrawSeven[Player],0.200000,1.000000);
- TextDrawColor(ServerTextDrawSeven[Player],-1);
- TextDrawSetOutline(ServerTextDrawSeven[Player],1);
- TextDrawSetProportional(ServerTextDrawSeven[Player],1);
- ServerTextDrawEight[Player] = TextDrawCreate(490.000000,430.000000," ");
- TextDrawBackgroundColor(ServerTextDrawEight[Player],255);
- TextDrawFont(ServerTextDrawEight[Player],2);
- TextDrawLetterSize(ServerTextDrawEight[Player],0.200000,1.000000);
- TextDrawColor(ServerTextDrawEight[Player],-1);
- TextDrawSetOutline(ServerTextDrawEight[Player],1);
- TextDrawSetProportional(ServerTextDrawEight[Player],1);
- }
- ServerTimerOne = SetTimer("PlayerUpdate",1000,1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- TextDrawDestroy(ServerTextDrawOne);
- TextDrawDestroy(ServerTextDrawTwo);
- for(new Player; Player < GetMaxPlayers(); Player++)
- {
- TextDrawDestroy(ServerTextDrawThree[Player]);
- TextDrawDestroy(ServerTextDrawFour[Player]);
- TextDrawDestroy(ServerTextDrawFive[Player]);
- TextDrawDestroy(ServerTextDrawSix[Player]);
- TextDrawDestroy(ServerTextDrawSeven[Player]);
- TextDrawDestroy(ServerTextDrawEight[Player]);
- }
- KillTimer(ServerTimerOne);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TextDrawHideForPlayer(playerid,ServerTextDrawOne);
- TextDrawHideForPlayer(playerid,ServerTextDrawTwo);
- TextDrawHideForPlayer(playerid,ServerTextDrawThree[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawFour[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawFive[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawSix[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawSeven[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawEight[playerid]);
- TextDrawSetString(ServerTextDrawThree[playerid]," ");
- TextDrawSetString(ServerTextDrawFour[playerid]," ");
- TextDrawSetString(ServerTextDrawFive[playerid]," ");
- TextDrawSetString(ServerTextDrawSix[playerid]," ");
- TextDrawSetString(ServerTextDrawSeven[playerid]," ");
- TextDrawSetString(ServerTextDrawEight[playerid]," ");
- return 1;
- }
- public OnPlayerDisconnect(playerid,reason)
- {
- TextDrawHideForPlayer(playerid,ServerTextDrawOne);
- TextDrawHideForPlayer(playerid,ServerTextDrawTwo);
- TextDrawHideForPlayer(playerid,ServerTextDrawThree[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawFour[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawFive[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawSix[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawSeven[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawEight[playerid]);
- TextDrawSetString(ServerTextDrawThree[playerid]," ");
- TextDrawSetString(ServerTextDrawFour[playerid]," ");
- TextDrawSetString(ServerTextDrawFive[playerid]," ");
- TextDrawSetString(ServerTextDrawSix[playerid]," ");
- TextDrawSetString(ServerTextDrawSeven[playerid]," ");
- TextDrawSetString(ServerTextDrawEight[playerid]," ");
- return 1;
- }
- public OnPlayerStateChange(playerid,newstate,oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
- {
- TextDrawShowForPlayer(playerid,ServerTextDrawOne);
- TextDrawShowForPlayer(playerid,ServerTextDrawTwo);
- TextDrawShowForPlayer(playerid,ServerTextDrawThree[playerid]);
- TextDrawShowForPlayer(playerid,ServerTextDrawFour[playerid]);
- TextDrawShowForPlayer(playerid,ServerTextDrawFive[playerid]);
- TextDrawShowForPlayer(playerid,ServerTextDrawSix[playerid]);
- TextDrawShowForPlayer(playerid,ServerTextDrawSeven[playerid]);
- TextDrawShowForPlayer(playerid,ServerTextDrawEight[playerid]);
- TextDrawSetString(ServerTextDrawThree[playerid]," ");
- TextDrawSetString(ServerTextDrawFour[playerid]," ");
- TextDrawSetString(ServerTextDrawFive[playerid]," ");
- TextDrawSetString(ServerTextDrawSix[playerid]," ");
- TextDrawSetString(ServerTextDrawSeven[playerid]," ");
- TextDrawSetString(ServerTextDrawEight[playerid]," ");
- }
- if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
- {
- TextDrawHideForPlayer(playerid,ServerTextDrawOne);
- TextDrawHideForPlayer(playerid,ServerTextDrawTwo);
- TextDrawHideForPlayer(playerid,ServerTextDrawThree[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawFour[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawFive[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawSix[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawSeven[playerid]);
- TextDrawHideForPlayer(playerid,ServerTextDrawEight[playerid]);
- TextDrawSetString(ServerTextDrawThree[playerid]," ");
- TextDrawSetString(ServerTextDrawFour[playerid]," ");
- TextDrawSetString(ServerTextDrawFive[playerid]," ");
- TextDrawSetString(ServerTextDrawSix[playerid]," ");
- TextDrawSetString(ServerTextDrawSeven[playerid]," ");
- TextDrawSetString(ServerTextDrawEight[playerid]," ");
- }
- return 1;
- }
- public PlayerUpdate()
- {
- for(new Player; Player < GetMaxPlayers(); Player++)
- {
- if(IsPlayerConnected(Player) && IsPlayerInAnyVehicle(Player))
- {
- new String[100];
- format(String,sizeof(String),"~G~~H~Model Pojazdu: ~W~~H~%d",GetVehicleModel(GetPlayerVehicleID(Player)));
- TextDrawSetString(ServerTextDrawThree[Player],String);
- format(String,sizeof(String),"~G~~H~Nazwa Pojazdu: ~W~~H~%s",VehicleNames[GetVehicleModel(GetPlayerVehicleID(Player)) - 400]);
- TextDrawSetString(ServerTextDrawFour[Player],String);
- new Float:Health;
- GetVehicleHealth(GetPlayerVehicleID(Player),Health);
- if(Health < 0.0) Health = 0.0;
- if(Health > 1000.0) Health = 1000.0;
- format(String,sizeof(String),"~G~~H~Stan Pojazdu: ~W~~H~%d %",floatround(Health / 10));
- TextDrawSetString(ServerTextDrawFive[Player],String);
- format(String,sizeof(String),"~G~~H~Predkosc Pojazdu: ~W~~H~%d KM/H",VehicleSpeed(GetPlayerVehicleID(Player)));
- TextDrawSetString(ServerTextDrawSix[Player],String);
- new Float:X;
- new Float:Y;
- new Float:Z;
- GetVehiclePos(GetPlayerVehicleID(Player),X,Y,Z);
- format(String,sizeof(String),"~G~~H~Wysokosc: ~W~~H~%d Metrow",floatround(Z));
- TextDrawSetString(ServerTextDrawSeven[Player],String);
- new Engine;
- new Lights;
- new Alarm;
- new Doors;
- new Bonnet;
- new Boot;
- new Objective;
- GetVehicleParamsEx(GetPlayerVehicleID(Player),Engine,Lights,Alarm,Doors,Bonnet,Boot,Objective);
- format(String,sizeof(String),"~G~~H~Zamkniety: ~W~~H~%s",(Doors == 1) ? ("Tak") : ("Nie"));
- TextDrawSetString(ServerTextDrawEight[Player],String);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement