SA-MP Forums Archive
Engine. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Engine. (/showthread.php?tid=274222)



Engine. - iGetty - 05.08.2011

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.


Re: Engine. - =WoR=Varth - 05.08.2011

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;
}



Re: Engine. - iGetty - 05.08.2011

What? :S


Re: Engine. - =WoR=Varth - 05.08.2011

I edited my post.