Hallo ich brauche mal eure Hilfe bei meinem Motor Befehl. Ich habe ein Autohaus was wie folgt geladen wird
forward OnPlayerCarsLoad(playerid);
public OnPlayerCarsLoad(playerid)
{
for(new i=0; i<cache_num_rows(); i++)
{
new id = getFreeCarID();
cache_get_value_name_int(i, "id", cInfo[id][db_id] );//Integer
cache_get_value_name_int(i, "model", cInfo[id][model]);//Integer
cache_get_value_name_int(i, "besitzer", cInfo[id][besitzer]);//Integer
cache_get_value_name_float(i, "x", cInfo[id][c_x]); //Float
cache_get_value_name_float(i, "y", cInfo[id][c_y]);//Float
cache_get_value_name_float(i, "z", cInfo[id][c_z]);//Float
cache_get_value_name_float(i, "r", cInfo[id][c_r]);//Float
cache_get_value_name_int(i, "c1", cInfo[id][color1]);//Integer
cache_get_value_name_int(i, "c2", cInfo[id][color2]);//Integer
cache_get_value_name_int(i, "c3", cInfo[id][color3]);//Integer
cache_get_value_name_int(i, "c_gesperrt", cInfo[id][c_gespeert] );//Integer
if(cInfo[id][c_gespeert] == 0)
{
cInfo[id][id_x] = CreateVehicle(cInfo[id][model],cInfo[id][c_x],cInfo[id][c_y],cInfo[id][c_z],cInfo[id][c_r],cInfo[id][color1],cInfo[id][color2],cInfo[id][color3]);
}
}
return 1;
}
Gerne möchte ich nun das die User auch Ihren Motor von Ihrem Fahrzeug starten können allerdings komme ich nicht sehr weit worum ich dann um Hilfe bitte.
Hier mein aktueller Motor Befehl
ocmd:motor(playerid,params[])
{
if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)return
SendClientMessage(playerid,COLOR_RED,"Du bist nicht der Fahrer eines Fahrzeugs.");
new Vehicle = GetPlayerVehicleID(playerid), engine,lights,alarm,doors,bonnet,boot,objective;
if(IsAFahrschule(Vehicle) && (PlayerInfo[playerid][pFahrschulmotor]==0))
{
SendClientMessage(playerid,COLOR_RED,"Es findet kein Termin in der Fahrschule statt.");
return 1;
}
if(IsAFahrschule(Vehicle) && (PlayerInfo[playerid][pFahrschulmotor]==1))
{
GetVehicleParamsEx(Vehicle, engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(Vehicle,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~W~Motor ~r~aus!", 2000, 5);
DestroyVehicle(playerid);
}
else
{
SetVehicleParamsEx(Vehicle,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~W~Motor ~g~an!", 2000, 5);
format(LastDriver[Vehicle],50,"%s",getPlayerName(playerid));
PlayerInfo[playerid][pFahrschulmotor]=0;
}
}
if(IsAbus(Vehicle) && PlayerInfo[playerid][pJob] == 1)
{
GetVehicleParamsEx(Vehicle, engine,lights,alarm,doors,bonnet,boot,objective);
if(engine == VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(Vehicle,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~W~Motor ~r~aus!", 2000, 5);
}
else
{
SetVehicleParamsEx(Vehicle,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~W~Motor ~g~an!", 2000, 5);
format(LastDriver[Vehicle],30,"%s",getPlayerName(playerid));
}
}
return 1;
}