28.01.2011, 15:34
pawn Код:
if (strcmp("/lmotor", cmdtext, true, 10) == 0)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(motor[playerid] == 0)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
motor[playerid] = 1;
SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {2F991A}Ligado!");
}
}
return 1;
}
if (strcmp("/dmotor", cmdtext, true, 10) == 0)
{
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
if(carro != INVALID_VEHICLE_ID)
{
if(motor[playerid] == 1)
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
motor[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFFAA, "Veiculo {E31919}Desligado!");
}
}
return 1;
}
pawn Код:
if((newkeys == 2) && (IsPlayerInAnyVehicle(playerid)))
{
OnPlayerCommandText(playerid,"/lmotor");
}
if((newkeys == 2) && (IsPlayerInAnyVehicle(playerid)))
{
OnPlayerCommandText(playerid,"/dmotor");
}