Engine.
#1

How can I get this command:

pawn Код:
command(eon, playerid, params[])
{
    #pragma unused params
    if(GetPlayerState(playerid) == 2)
    {
        {
            new string[128], engine, lights, alarm, doors, bonnet, boot, veh, objective;
            format(string, sizeof(string), "%s has turned their engine on.", RemoveUnderScore(playerid));
            NearByMessage(playerid, PINK, string);
            veh = GetPlayerVehicleID(playerid);
            GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
            SetVehicleParamsEx(veh, 1, lights, alarm, doors, bonnet, boot, 0);
        }
    }
    else
    {
        SendClientMessage(playerid, WHITE, "You are not driving a vehicle!");
    }
    return 1;
}
So that when the person turns on the engine, they can't turn the engine on again?, because people in my server are spamming the command /eon and it get's really annoying, like is there a way to add:
SendClientMessage(playerid, GREY, "The vehicles engine is already turned on.");

If so, please can someone help?, Thanks.
Reply
#2

pawn Код:
command(eon, playerid, params[])
{
    #pragma unused params
    if(GetPlayerState(playerid) == 2)
    {
        new string[128], engine, lights, alarm, doors, bonnet, boot, veh, objective;
        GetVehicleParamsEx(veh, engine, lights, alarm, doors, bonnet, boot, objective);
        if(engine == 1) return SendClientMessage(playerid,WHITE,"blahblahblah");
        format(string, sizeof(string), "%s has turned their engine on.", RemoveUnderScore(playerid));
        NearByMessage(playerid, PINK, string);
        veh = GetPlayerVehicleID(playerid);
        SetVehicleParamsEx(veh, 1, lights, alarm, doors, bonnet, boot, 0);
        }
    }
    else
    {
        SendClientMessage(playerid, WHITE, "You are not driving a vehicle!");
    }
    return 1;
}
Reply
#3

What? :S
Reply
#4

I edited my post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)