Liebe Community,
ocmd:motor(playerid,params[])
{
new status[4];
if(sscanf(params,"s",status))return SendClientMessage(playerid,0xFF0000,"Info: /motor [an/aus]");
new engine,lights,alarm,doors,bonnet,boot,objective;
if(IsPlayerInAnyVehicle(playerid))
{
new vid = GetPlayerVehicleID(playerid);
if(strcmp(status,"an",true) == 0)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
motor[vid] = true;
SendClientMessage(playerid,0xFF0000,"Du hast den Motor gestartet!");
}
else
if(strcmp(status,"aus",true) == 0)
{
GetVehicleParamsEx(vid,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(vid,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
motor[vid] = false;
SendClientMessage(playerid,0xFF0000,"Du hast den Motor abgewürgt!");
}
}
return 1;
}
Wie mach ich das nur mit einen Befehl?
Also man gibt /motor an der motor startet wenn man nocheinmal angibt dann ist er aus.