27.03.2014, 21:38
Why this keep saying a message that I turned engine ON even if my engine is already turned ON ? (it should say that I turned it off...)
Then next problem is if I write any cmd that does not exist it will say "USAGE: /csg....." above /csg is this cmd:
pawn Code:
if(strcmp(cmdtext, "/engine", true) == 0) {
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(engine == 1) {
KillTimer(GasTimer[playerid]);
SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
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, turning vehicle engine off.", maskid[playerid]);
ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
return 1;
}
else
{
format(string, sizeof(string), "*%s spins the key, turning vehicle engine off.", sendername);
ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
return 1;
}
}
else if(engine == 0)
{
if(Masked[playerid] == 1)
{
format(string, sizeof(string), "*Stranger_%d inserts the key in ignition and spins it, turning vehicle engine on.", maskid[playerid]);
ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
return 1;
}
else
{
format(string, sizeof(string), "*%s inserts the key in ignition and spins it, turning vehicle 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 Code:
if (strcmp("/sb", cmdtext, true, 10) == 0)
{
if(SeatBelt[playerid] == 0 && IsPlayerInAnyVehicle(playerid))
{
SeatBelt[playerid] = 1;
if(Masked[playerid] == 1)
{
format(string, sizeof(string), "*Stranger_%d grabs the seatbelt as he pulls it and adjust it over his body and buckles it up.", maskid[playerid]);
ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
return 1;
}
else
{
format(string, sizeof(string), "*%s grabs the seatbelt as he pulls it and adjust it over his body and buckles it up.", sendername);
ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
}
return 1;
}
else if (SeatBelt[playerid] == 1 && IsPlayerInAnyVehicle(playerid))
{
SeatBelt[playerid] = 0;
if(Masked[playerid] == 1)
{
format(string, sizeof(string), "*Stranger_%d unbuckles his seatbelt.", maskid[playerid]);
ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
return 1;
}
else
{
format(string, sizeof(string), "*%s unbuckles his seatbelt.", sendername);
ProxDetector(8.0, playerid, string,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
}
return 1;
}
else
{
SendClientMessage(playerid, -1, "You're not in any vehicle!");
return 1;
}
}

