Samp command help
#1

How can i make it where if im around a car i can use /cartrunk instead of being inside of the car?

CMD:
pawn Код:
CMD:cartrunk(playerid, params[])
{
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        new vehicle = GetPlayerVehicleID(playerid);
        new string[128];
        new pname[MAX_PLAYER_NAME];
        if(Boot[vehicle] == 0)
        {
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            GetPlayerName(playerid, pname, sizeof(pname));
            format(string, sizeof(string), "%s Has opened his/her's vehicle's trunk", pname);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            SCM(playerid, COLOR_WHITE, "You have vehicle's trunk to {00FF00}[OPEN]");
            Boot[vehicle] = 1;
            SetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, 1, objective);
        }
        else if(Boot[vehicle] == 1)
        {
            new engine, lights, alarm, doors, bonnet, boot, objective;
            GetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, boot, objective);
            Boot[vehicle] = 0;
            SetVehicleParamsEx(vehicle, engine, lights, alarm, doors, bonnet, 0, objective);
            GetPlayerName(playerid, pname, sizeof(pname));
            format(string, sizeof(string), "%s Has pulled down his/her's vehicle's trunk", pname);
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            SCM(playerid, COLOR_WHITE, "You have vehicle's trunk to {FF0000}[CLOSED]");
        }
    }
    return 1;
}
Reply


Messages In This Thread
Samp command help - by San1 - 22.06.2013, 17:44
Re: Samp command help - by IstuntmanI - 22.06.2013, 17:59
Re: Samp command help - by CountyRP - 22.06.2013, 18:00
Re: Samp command help - by RedFusion - 22.06.2013, 18:12

Forum Jump:


Users browsing this thread: 1 Guest(s)