Hey liebe Brotfische,
ich habe mir das Tacho (http://forum.sa-mp.de/san-andreas-multip…ystem-by-azure/ ) gedownloadet!
Nun habe ich es eingefügt, wie ich es glaube und habe folgende Warnings !
Warnings:
C:\Users\Birga\Desktop\Selfmade Reallife Projekt\gamemodes\selfmade.pwn(246) : warning 225: unreachable code
C:\Users\Birga\Desktop\Selfmade Reallife Projekt\gamemodes\selfmade.pwn(246) : warning 217: loose indentation
C:\Users\Birga\Desktop\Selfmade Reallife Projekt\gamemodes\selfmade.pwn(402) : warning 217: loose indentation
C:\Users\Birga\Desktop\Selfmade Reallife Projekt\gamemodes\selfmade.pwn(500) : warning 217: loose indentation
C:\Users\Birga\Desktop\Selfmade Reallife Projekt\gamemodes\selfmade.pwn(545) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
5 Warnings.
Durch diese Warnings wird das Tacho nicht folständig angezeigt!!!
Mein Script:
// Allgemeine Server-Includes ____________________________________________________________________________________________________________________________________________________________
#include <a_samp>
// Ende___________________________________________________________________________________________________________________________________________________________________________________
// Tacho + Tank + Motorsystem
new Fahrzeugname[][] = {
"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 Truck",
"Admiral",
"Squalo",
"Seasparrow",
"Pizzaboy",
"Tram",
"Trailer",
"Turismo",
"Speeder",
"Reefer",
"Tropic",
"Flatbed",
"Yankee",
"Caddy",
"Solair",
"RC Van",
"Skimmer",
"PCJ-600",
"Roller",
"Freeway",
"RC Baron",
"RC Raider",
"Glendale",
"Oceanic",
"Sanchez",
"Sparrow",
"Patriot",
"Quad",
"Coastguard",
"Dinghy",
"Hermes",
"Sabre",
"Rustler",
"ZR-350",
"Walton",
"Regina",
"Comet",
"Fahrrad",
"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",
"Hotring Racer",
"Bloodring Banger",
"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",
"Traktor",
"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 Truck",
"Monster Truck",
"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",
"Trailer",
"Andromada",
"Dodo",
"RC Cam",
"Launch",
"Polizeiwagen",
"Polizeiwagen",
"Polizeiwagen",
"Cop Ranger",
"Picador",
"SWAT Van",
"Alpha",
"Phoenix",
"Glendale",
"Sadler",
"Luggage Trailer",
"Luggage Trailer",
"Stair Trailer",
"Boxville",
"Farm Plow",
"Utility Trailer"
};
enum Tachosystem
{
Text:Tachoanzeige[13]
}
new Tachospeedanzeige[Tachosystem];
new Tachoaktiv[MAX_PLAYERS];
new Text:Tacho[MAX_PLAYERS][6];
new Text:Tachoautomarke[MAX_PLAYERS];
new Text:Autozustand[MAX_PLAYERS];
new motor,lichter,objektiv,boot,bonnet,doors,alarm;
new bool:Motor[MAX_VEHICLES]=false;
public OnGameModeInit()
{
AddStaticVehicleEx(596,2097.6716,1309.7776,10.8203,67.1057,-1,1,-1);
AddStaticVehicle(510,2517.6934,-1672.3337,13.7218,65.8160,39,39);
SetGameModeText("Selfmade Reallife Projekt by Domi");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
//-------------------------------------Tacho------------------------------------------------
Tachospeedanzeige[Tachoanzeige][0] = TextDrawCreate(440.000000,400.000000,"~b~10");
Tachospeedanzeige[Tachoanzeige][1] = TextDrawCreate(430.000000,380.000000,"~b~20");
Tachospeedanzeige[Tachoanzeige][2] = TextDrawCreate(430.000000,360.000000,"~b~30");
Tachospeedanzeige[Tachoanzeige][3] = TextDrawCreate(432.000000,340.000000,"~b~40");
Tachospeedanzeige[Tachoanzeige][4] = TextDrawCreate(440.000000,320.000000,"~b~50");
Tachospeedanzeige[Tachoanzeige][5] = TextDrawCreate(460.000000,300.000000,"~b~60");
Tachospeedanzeige[Tachoanzeige][6] = TextDrawCreate(489.000000,290.000000,"~b~70");
Tachospeedanzeige[Tachoanzeige][7] = TextDrawCreate(530.000000,291.000000,"~b~80");
Tachospeedanzeige[Tachoanzeige][8] = TextDrawCreate(562.000000,304.000000,"~b~90");
Tachospeedanzeige[Tachoanzeige][9] = TextDrawCreate(580.000000,320.000000,"~b~100");
Tachospeedanzeige[Tachoanzeige][10] = TextDrawCreate(593.000000,340.000000,"~b~110");
Tachospeedanzeige[Tachoanzeige][11] = TextDrawCreate(600.000000,360.000000,"~b~120");
Tachospeedanzeige[Tachoanzeige][12] = TextDrawCreate(602.000000,379.000000,"~b~130");
for(new i; i < 13; i++)
{
TextDrawSetShadow(Tachospeedanzeige[Tachoanzeige][i], 1);
TextDrawSetOutline(Tachospeedanzeige[Tachoanzeige][i], 0);
}
//------------------------------Tank und Motorsystem-------------------------------------------------
ManualVehicleEngineAndLights();
for (new i=0; i< MAX_VEHICLES; i++)
{
GetVehicleParamsEx(i,motor,lichter,objektiv,boot,bonnet,doors,alarm);
SetVehicleParamsEx(i,VEHICLE_PARAMS_OFF,lichter,objektiv,boot,bonnet,doors,alarm);
Motor[i] = false;
}
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
Autozustand[playerid] = TextDrawCreate(500.000000,402.000000,"Autohp:");
TextDrawLetterSize(Autozustand[playerid],0.500000,1.200000);
TextDrawColor(Autozustand[playerid], -1);
TextDrawSetOutline(Autozustand[playerid], 1);
TextDrawUseBox(Autozustand[playerid],1);
Tachoautomarke[playerid] = TextDrawCreate(500.000000,417.000000,"Marke:");
TextDrawLetterSize(Tachoautomarke[playerid], 0.500000, 1.200000);
TextDrawColor(Tachoautomarke[playerid], -1);
TextDrawSetOutline(Tachoautomarke[playerid], 1);
TextDrawUseBox(Tachoautomarke[playerid],1);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
GetVehicleParamsEx(vehicleid,motor,lichter,objektiv,boot,bonnet,doors,alarm);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_OFF,lichter,objektiv,boot,bonnet,doors,alarm);
Motor[vehicleid] = false;
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/motor",cmdtext,true,10) == 0)
{
if(GetPlayerVehicleSeat(playerid) == 0)
{
new car = GetPlayerVehicleID(playerid);
if(GetVehicleModel(car) == 481 || GetVehicleModel(car) == 510 || GetVehicleModel(car) == 509)
{
SendClientMessage(playerid,0xFF0000FF,"Ein Fahrrad besitzt kein Motor!");
}
else if (Motor[car] == false)
{
GetVehicleParamsEx(car,motor,lichter,objektiv,boot,bonnet,doors,alarm);
SetVehicleParamsEx(car,VEHICLE_PARAMS_ON,lichter,objektiv,boot,bonnet,doors,alarm);
Motor[car] = true;
GameTextForPlayer(playerid,"~w~Motor ~g~an",500,1);
}
else
{
GetVehicleParamsEx(car,motor,lichter,objektiv,boot,bonnet,doors,alarm);
SetVehicleParamsEx(car,VEHICLE_PARAMS_OFF,lichter,objektiv,boot,bonnet,doors,alarm);
Motor[car] = false;
GameTextForPlayer(playerid,"~w~Motor ~g~aus",500,1);
}
}
}
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 510)
{
GetVehicleParamsEx(vehicleid,motor,lichter,objektiv,boot,bonnet,doors,alarm);
SetVehicleParamsEx(vehicleid,VEHICLE_PARAMS_ON,lichter,objektiv,boot,bonnet,doors,alarm);
}
return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER && !Tachoaktiv[playerid])
{
for(new i; i < 13; i++)
TextDrawShowForPlayer(playerid, Tachospeedanzeige[Tachoanzeige][i]);
for(new i; i < 6; i++)
Tacho[playerid][i] = TextDrawCreate(516.0,350.0, "~r~ |");
}
else
{
for(new i; i < 6; i++)
TextDrawHideForPlayer(playerid, Tacho[playerid][i]);
for(new i; i < 13; i++)
TextDrawHideForPlayer(playerid, Tachospeedanzeige[Tachoanzeige][i]);
TextDrawHideForPlayer(playerid, Tachoautomarke[playerid]);
TextDrawHideForPlayer(playerid, Autozustand[playerid]);
}
if(newstate == PLAYER_STATE_DRIVER)
{
TextDrawShowForPlayer(playerid,Tachospeedanzeige[Tachoanzeige][playerid]);
TextDrawShowForPlayer(playerid,Tachoautomarke[playerid]);
TextDrawShowForPlayer(playerid,Autozustand[playerid]);
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveCheckpoint(playerid)
{
return 1;
}
public OnPlayerEnterRaceCheckpoint(playerid)
{
return 1;
}
public OnPlayerLeaveRaceCheckpoint(playerid)
{
return 1;
}
public OnRconCommand(cmd[])
{
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
return 1;
}
public OnObjectMoved(objectid)
{
return 1;
}
public OnPlayerObjectMoved(playerid, objectid)
{
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
return 1;
}
public OnVehicleMod(playerid, vehicleid, componentid)
{
return 1;
}
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
return 1;
}
public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
return 1;
}
public OnPlayerSelectedMenuRow(playerid, row)
{
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
return 1;
}
public OnPlayerUpdate(playerid)
{
new Float:fPos[3];
new Float:Pos[6][6];
new Float:sSpeed;
new string1[256];
new string2[256];
new Float:FahrzeugLeben;
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && !Tachoaktiv[playerid])
{
GetVehicleVelocity(GetPlayerVehicleID(playerid), fPos[0], fPos[1], fPos[2]);
sSpeed = floatsqroot(floatpower(fPos[0], 2) + floatpower(fPos[1], 2) +
floatpower(fPos[2], 2)) * 200;
new Float:alpha = 320 - sSpeed;
if(alpha < 70)
alpha = 70;
for(new i; i < 6; i++)
{
TextDrawHideForPlayer(playerid, Tacho[playerid][i]);
TextDrawDestroy(Tacho[playerid][i]);
Speed(516,350, Pos[i][0], Pos[i][1], alpha, (i + 1) * 8);
Tacho[playerid][i] = TextDrawCreate(Pos[i][0], Pos[i][1], "~r~ |");
TextDrawLetterSize(Tacho[playerid][i],0.9,3.0);
TextDrawSetOutline(Tacho[playerid][i], 0);
TextDrawSetShadow(Tacho[playerid][i], 1);
TextDrawShowForPlayer(playerid, Tacho[playerid][i]);
GetVehicleHealth(GetPlayerVehicleID(i), FahrzeugLeben);
if(FahrzeugLeben > 800)
{
format(string2,sizeof(string2),"~b~Autohp: ~y~%d%",floatround(FahrzeugLeben));
TextDrawSetString(Autozustand[i],string2);
}
else if(FahrzeugLeben > 500)
{
format(string2,sizeof(string2),"~b~Autohp: ~r~%d%",floatround(FahrzeugLeben));
TextDrawSetString(Autozustand[i],string2);
}
else
{
format(string2,sizeof(string2),"~b~Autohp: ~r~%d%",floatround(FahrzeugLeben));
TextDrawSetString(Autozustand[i],string2);
}
}
format(string1,sizeof(string1),"~b~Marke: ~y~%s",Fahrzeugname[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
TextDrawSetString(Tachoautomarke[playerid], string1);
TextDrawShowForPlayer(playerid, Tachoautomarke[playerid]);
}
return 1;
}
public OnPlayerStreamIn(playerid, forplayerid)
{
return 1;
}
public OnPlayerStreamOut(playerid, forplayerid)
{
return 1;
}
public OnVehicleStreamIn(vehicleid, forplayerid)
{
return 1;
}
public OnVehicleStreamOut(vehicleid, forplayerid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
//______________________________________________ S T O C K S __________________________________________________________________________________________________
stock Speed(Float:StartPosX, Float:StartPosY, &Float:NewX, &Float:NewY, Float:alpha, Float:dist)
{
NewX = StartPosX + (dist * floatsin(alpha, degrees));
NewY = StartPosY + (dist * floatcos(alpha, degrees));
}