Danke RedJoker,
ich habe jetzt nur ein problem... der Timer wird nicht gekillt... also so habe ich das beim /motor befehl gemacht...
ocmd: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, COLOR_GRAU, "Ein Fahrrad hat kein Motor.");
}
else if (Motor[car] == false)
{
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
if ( Gas[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);
KillTimer(timer[playerid]);//wird als einziges nicht ausgeführt...
Motor[car] = false;
}
}
return 1;
}