dcmd_motor(playerid, params[]) {
#pragma unused params
if(GetPlayerVehicleSeat(playerid) == 0) {
new car = GetPlayerVehicleID(playerid);
if(GetVehicleModel(car) == 509 || GetVehicleModel(car) == 481 || GetVehicleModel(car) == 510) {
SendClientMessage(playerid, FARBE_WEISS, ""#HTML_ROT""#SERVERTAG""#HTML_WEISS": Fahrräder haben keinen Motor !");
}
else if (Motor[car] == false) {
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
if ( Tank[car] >= 1 ) { Motor[car] = true; SetVehicleParamsEx(car,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective); }
else { Motor[car] = false; SetVehicleParamsEx(car,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective); GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~Der Tank ist leer!",3000,3); }
}
else {
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(car,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
Motor[car] = false;
}
}
return 1;
}
das ist der Code zum ersten und ich möchte das man ihn nur als Fahrer benutzen kann
TextDrawShowForPlayer(playerid, Tacho[playerid]);
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
if(GetVehicleModel(vehicle) == 509 || GetVehicleModel(vehicle) == 481 || GetVehicleModel(vehicle) == 510)
{
SetVehicleParamsEx(vehicle,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
}
else
{
SendClientMessage(playerid, FARBE_WEISS, "Schalte den Motor mit der rechten STRG Taste an oder aus.");
}
if ( Motor[vehicle]==false ) { SetVehicleParamsEx(vehicle,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
}
if( Tank[vehicle] < 1 )
{
Motor[vehicle]=false;
SetVehicleParamsEx(vehicle,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid,"~r~~n~~n~~n~~n~~n~~n~~n~~n~Der Tank ist leer!",3000,3);
}
}
und das sich der Tacho erst öffnet wenn der Motor gestartet ist
ich hoffe ihr könnt mir dabei helfen
//edit TextDrawShowForPlayer(playerid, Tacho[playerid]);