29.03.2014, 22:02
Why at this command when I turn engine OFF it doesn't send the message?
This msg:
pawn Код:
if(strcmp(cmdtext, "/engine", true) == 0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new e,l,a,d,b,bo,o;
GetVehicleParamsEx(vehicleid,e,l,a,d,b,bo,o);
GetPlayerName(playerid, sendername, sizeof(sendername));
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1,"{FF6A22}INFO: {FFFFFF}You need to be in vehicle to use this command.");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1,"{FF6A22}INFO: {FFFFFF}You need to be driver to use this command.");
if(Carinfo[vehicleid][F] < 1) return SendClientMessage(playerid, -1,"{FF6A22}INFO: {FFFFFF}This vehicle is out of fuel.");
if(ES[playerid] == 1) return SendClientMessage(playerid, -1,"{FF6A22}INFO: {FFFFFF}You are already starting your engine.");
if(NoFuel(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid, -1,"{FF6A22}INFO: {FFFFFF}You can't do that on this vehicle.");
if(e == 1) {
KillTimer(GasTimer[playerid]);
SetVehicleParamsEx(vehicleid,0,l,a,d,b,bo,o);
TextDrawHideForPlayer(playerid, vName[playerid]);
TextDrawHideForPlayer(playerid, vSpeed[playerid]);
TextDrawHideForPlayer(playerid, vGear[playerid]);
TextDrawHideForPlayer(playerid, vHP[playerid]);
TextDrawHideForPlayer(playerid, vFuel[playerid]);
TextDrawHideForPlayer(playerid, HP[playerid]);
TextDrawHideForPlayer(playerid, Speed[playerid]);
TextDrawHideForPlayer(playerid, Gear[playerid]);
TextDrawHideForPlayer(playerid, Veh[playerid]);
TextDrawHideForPlayer(playerid, Fuel[playerid]);
if(Masked[playerid] == 1) format(string, sizeof(string), "Stranger_%d spins the key and turns engine off.",maskid[playerid]);
else format(string, sizeof(string), "%s spins the key and turns engine off.",sendername);
return 1;
} else {
if(Masked[playerid] == 1) format(string, sizeof(string), "Stranger_%d inserts a key in ingition and twists it, turning engine on.",maskid[playerid]);
else format(string, sizeof(string), "*%s inserts a key in ingition and twists it, turning engine on.", sendername);
ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
ES[playerid] = 1;
EngTimer[playerid] = SetTimerEx("EngStart", 4000, false, "d", playerid);
return 1;
}
}
pawn Код:
if(Masked[playerid] == 1) format(string, sizeof(string), "Stranger_%d spins the key and turns engine off.",maskid[playerid]);
else format(string, sizeof(string), "%s spins the key and turns engine off.",sendername);