Role Play problem.
#5

Quote:
Originally Posted by Hipflop
View Post
Try this:

Put this on top
pawn Code:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
This in OnPlayerCommandText
pawn Code:
dcmd(engine, 6, cmdtext);
And finally, somewhere where you want:
pawn Code:
dcmd_engine(playerid, params[])
{
    #pragma unused params
    if(IsPlayerInAnyVehicle(playerid))
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
            if(engine == 1)
            {
                SetVehicleParamsEx(vehicleid, 0, lights, alarm, doors, bonnet, boot, objective);
                SendClientMessage(playerid, COLOR_WHITE, "The vehicle's engine stopped succesfully.");
            }
            else
            {
                SetVehicleParamsEx(vehicleid, 1, lights, alarm, doors, bonnet, boot, objective);
                SendClientMessage(playerid, COLOR_WHITE, "The vehicle's engine started succesfully.");
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not at the driver's seat!");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not in a vehicle!");
    }
    return 1;
}
Can you look my gammode and fix thath probl plz? Myb that problem is beacuse i can start the engine with SHIFT button
Reply


Messages In This Thread
Role Play problem. - by Stuf - 07.07.2011, 18:28
Re: Role Play problem. - by Hipflop - 07.07.2011, 19:48
Re: Role Play problem. - by [MG]Dimi - 07.07.2011, 20:27
Re: Role Play problem. - by Hipflop - 07.07.2011, 20:29
Re: Role Play problem. - by Stuf - 08.07.2011, 07:49
Re: Role Play problem. - by Hipflop - 08.07.2011, 07:51
Re: Role Play problem. - by Stuf - 08.07.2011, 17:04

Forum Jump:


Users browsing this thread: 1 Guest(s)