Guten Abend.
Ich habe das Problem dass der stock nicht korrekt funktioniert.
Der Motor geht an aber nicht wieder aus.
stock:
stock Motor(playerid)
{
new engine,lights,alarm,doors,bonnet,boot,objective;
new vid = GetPlayerVehicleID(playerid);
if(vid != INVALID_VEHICLE_ID)
{
if(engine == VEHICLE_PARAMS_ON)
{
SetVehicleParamsEx(vid,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(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~W~Motor ~g~an!", 2000, 5);
}
}
}
Befehl:
f(strcmp("/m", cmdtext, true, 10) == 0)
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return 1;
new engine,lights,alarm,doors,bonnet,boot,objective;
new vid = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
for(new i = 0; sizeof(LieferantenH) > i; i++){
if(GetPlayerVehicleID(playerid) == LieferantenH[i]){
if(SpielerInfo[playerid][Fraktion] == 1){return SendClientMessage(playerid,Rot,"Du hast den nötigen Schlüssel nicht.");}
else{Motor(playerid);}
}
}
Motor(playerid);
return 1;
}