02.03.2014, 14:39
Quote:
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;
}