a kód:
stock UpdateVehicleParamsEx(vehicleid, bool: status, { _, Float }: ...)
{
new
vehicleParams[7],
vehicleParamsData[7][10] =
{
{ \"Engine\" },
{ \"Lights\" },
{ \"Alarm\" },
{ \"Doors\" },
{ \"Bonnet\" },
{ \"Boot\" },
{ \"Objective\" }
},
totalArgs = numargs()
;
if(totalArgs < 3)
{
return 0;
}
GetVehicleParamsEx(vehicleid, vehicleParams[0], vehicleParams[1], vehicleParams[2], vehicleParams[3], vehicleParams[4], vehicleParams[5], vehicleParams[6]);
for(new i = 2, j = 0, ch = \'\\0\'; i != totalArgs; ++i)
{
new
tempString[10]
;
for(j = 0; (ch = getarg(i, j)) != EOS; ++j)
{
tempString[j] = ch;
}
for(j = 0; j != sizeof(vehicleParamsData); ++j)
{
if(!strcmp(vehicleParamsData[j], tempString, true))
{
vehicleParams[j] = status;
}
}
}
SetVehicleParamsEx(vehicleid, vehicleParams[0], vehicleParams[1], vehicleParams[2], vehicleParams[3], vehicleParams[4], vehicleParams[5], vehicleParams[6]);
return 1;
}
készítő: Ryder
példa a használatra:
UpdateVehicleParamsEx(vehicleid, true, \"Alarm\", \"Bonnet\", \"Doors\", \"Boot\", \"Engine\");
ezzel elindítod a riasztót, a motort, kinyitod az ajtókat, felnyitod csomagtartót és a motorháztetőt