Itt az enyém, ez parancsokra van, de ezt átkell konfigurálnod.
Amúgy az ilyen megoldással egyszerre a motorháztetõt és a csomagtartót nem lehet kinyitni, mivel a GetVehicleParamsEx a boot & bonnet-al 0-val tér vissza mindig. ( SA-MP Bug :S )
CMD:veh(playerid, params[])
{
new
engine,
alarm,
bonnet,
boot,
objective;
if(sscanf(params, \"s[\" #STR_SIZE \"]\", i_str)) return SendClientMessage(playerid, COLOR_RED, \"HASZNÁLAT: /veh <Engine/Lights/Alarm/Doors/Bonnet/Boot>\");
vID = GetPlayerVehicleID(playerid);
GetVehicleParamsEx(vID, engine, lights, alarm, doors, bonnet, boot, objective);
if(!strcmp(i_str, \"engine\", true))
{
if(engine == 0)
{
SetVehicleParamsEx(vID, VEHICLE_PARAMS_ON, lights, alarm, doors, bonnet, boot, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~motorja ~g~~h~bekapcsolva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
else if(engine == -1 || engine == 1)
{
SetVehicleParamsEx(vID, VEHICLE_PARAMS_OFF, lights, alarm, doors, bonnet, boot, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~motorja ~r~kikapcsolva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
}
else if(!strcmp(i_str, \"lights\", true))
{
if(lights == 0 || lights == -1)
{
SetVehicleParamsEx(vID, engine, VEHICLE_PARAMS_ON, alarm, doors, bonnet, boot, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~villanya ~g~~h~bekapcsolva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
else
{
SetVehicleParamsEx(vID, engine, VEHICLE_PARAMS_OFF, alarm, doors, bonnet, boot, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~villanya ~r~kikapcsolva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
}
else if(!strcmp(i_str, \"alarm\", true))
{
if(alarm == 0 || alarm == -1)
{
SetVehicleParamsEx(vID, engine, lights, VEHICLE_PARAMS_ON, doors, bonnet, boot, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~riasztólya ~g~~h~bekapcsolva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
else
{
SetVehicleParamsEx(vID, engine, lights, VEHICLE_PARAMS_OFF, doors, bonnet, boot, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~riasztólya ~r~kikapcsolva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
}
else if(!strcmp(i_str, \"doors\", true))
{
if(doors == -1 || doors == 0)
{
SetVehicleParamsEx(vID, engine, lights, alarm, VEHICLE_PARAMS_ON, bonnet, boot, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~ajtajai ~g~~h~kinyitva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
else
{
SetVehicleParamsEx(vID, engine, lights, alarm, VEHICLE_PARAMS_OFF, bonnet, boot, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~ajtajai ~r~becsukva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
}
else if(!strcmp(i_str, \"bonnet\", true))
{
if(bonnet == 0 || bonnet == -1)
{
SetVehicleParamsEx(vID, engine, lights, alarm, doors, VEHICLE_PARAMS_ON, boot, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~ajtajai ~g~~h~kinyitva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
else
{
SetVehicleParamsEx(vID, engine, lights, alarm, doors, VEHICLE_PARAMS_OFF, boot, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~kapotája ~r~becsukva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
}
else if(!strcmp(i_str, \"boot\", true))
{
if(boot == -1 || boot == 0)
{
SetVehicleParamsEx(vID, engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_ON, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~csomagtartója ~g~~h~kinyitva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
else
{
SetVehicleParamsEx(vID, engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_OFF, objective);
format(tmp, sizeof(tmp), \"~y~~h~%s ~b~~h~csomagtartója ~r~becsukva~w~!\", VehicleNames[GetVehicleModel(vID) - 400]);
InfoTD_MSG(playerid, MESSAGE_TIME, tmp);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, \"HASZNÁLAT: /veh <Engine/Lights/Alarm/Doors/Bonnet/Boot>\");
}
return 1;
}