[pawn]
new engine, lights, alarm, doors, bonnet, boot, objective;
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
[/pawn]
Kiegészíteném:
[pawn]#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, \"\")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1[/pawn]
[pawn]public OnPlayerCommandText(playerid,cmdtext[])
{
dcmd(e,1,cmdtext);
return 0;
}[/pawn]
[pawn]dcmd_e(playerid,params[])
{
new engine, lights, alarm, doors, bonnet, boot, objective;
if(!strlen(params)) return SendClientMessage(playerid, 0xF6BB0AA, \"Használat: /E [on/off]\");
if(strcmp(params,\"off\",true) == 0)
{
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 0, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid,0xFF9900,\"INFO: Motor leállítva!\");
}
else if(strcmp(params,\"on\",true) == 0)
{
GetVehicleParamsEx(GetPlayerVehicleID(playerid), engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(GetPlayerVehicleID(playerid), 1, lights, alarm, doors, bonnet, boot, objective);
SendClientMessage(playerid,0xFF9900,\"INFO: Motor beindítva!\");
}
else SendClientMessage(playerid, 0xF6BB0AA, \"Használat: /E [on/off]\");
return 1;
}[/pawn]