How to make this?
#6

Quote:
Originally Posted by Clad
Посмотреть сообщение
It's very simple, Use radius and define if windows closed or not, It is already in some RP Servers
pawn Код:
enum Car
{
    Float:F, // Fuel - don't mind this right now...
    VehWin, // Windows
}
pawn Код:
if(!strcmp(cmdtext, "/windows", true) || !strcmp(cmdtext, "/wi", true))
    {
        new string[128];
        new playercar = GetPlayerVehicleID(playerid);
        GetPlayerName(playerid, Name, sizeof(Name));
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1,"{FF6A22}INFO: {FFFFFF}You need to be a driver to use this command.");
            if(IsModelAPlane(playercar) || IsModelABike(playercar) || IsModelAHeli(playercar) || IsModelABoat(playercar) || IsModelASpecial(playercar))
            {
                SendClientMessage(playerid, -1, "{FF6A22}INFO: {FFFFFF}This vehicle doesn't have the window to roll.");
                return 1;
            }
            if(Carinfo[vehicleid][VehWin] == 0) // if windows are closed we will open them
            {
                Carinfo[vehicleid][VehWin] = 1;
                format(string, sizeof(string), "* %s rolls down the window.", Name);
                ProxDetector(30.0, playerid, string, COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE);
                return 1;
            }
            else if(Carinfo[vehicleid][VehWin] == 1) // if windows are open we will close them
            {
                Carinfo[vehicleid][VehWin] = 0;
                format(string, sizeof(string), "* %s rolls up the window.", Name);
                ProxDetector(30.0, playerid, string, COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE,COLOR_DBLUE);
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "{FF6A22}INFO: {FFFFFF}You need to be in the vehicle to use this function!");
            return 1;
        }
        return 1;
    }
This is what I'm currently using but idk how to combine all this in OnPlayerText .. I will need some help hah :P thanks for answers also
Reply


Messages In This Thread
How to make this? - by Lajko1 - 02.03.2014, 14:29
Re: How to make this? - by Bashur - 02.03.2014, 14:31
Re: How to make this? - by Avi Raj - 02.03.2014, 14:31
Re: How to make this? - by Clad - 02.03.2014, 14:35
Re: How to make this? - by Lajko1 - 02.03.2014, 14:36
Re: How to make this? - by Lajko1 - 02.03.2014, 14:39
Re: How to make this? - by Clad - 02.03.2014, 14:41
Re: How to make this? - by Clad - 02.03.2014, 14:43

Forum Jump:


Users browsing this thread: 2 Guest(s)