11.11.2012, 13:49
O que eu devo fazer para sу o motorista ligar o veiculo ?
pawn Код:
if(strcmp("/motor",cmdtext,true,6)==0)
{
if(!IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid,COLOR_GREY,"Vocк precisa estar em um veнculo!");
return 1;
}
new mot, lu, alar, por, cap, porma, ob;
new carro = GetPlayerVehicleID(playerid);
new vid = GetPlayerVehicleID(playerid);
if(Gas[vid] == 0)
return SendClientMessage(playerid,COLOR_GRAD2," Veiculo sem Combustivel");
if(LigadoDesligado2[vid] == 1)
{
motor[playerid] = 1;
}
if(LigadoDesligado2[vid] == 0)
{
motor[playerid] = 0;
}
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;
LigadoDesligado2[carro] = 1;
SendClientMessage(playerid, COLOR_WHITE, "Motor do veiculo {00eaff}ligado");
}
else
{
GetVehicleParamsEx(carro, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(carro, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
motor[playerid] = 0;
LigadoDesligado2[carro] = 0;
SendClientMessage(playerid, COLOR_WHITE, "Motor do veiculo {00eaff}desligado");
}
}
return 1;
}