29.01.2016, 15:33
PHP код:
CMD:janelas(playerid, params[])
{
new vehicleid = GetPlayerVehicleID(playerid);
new string[124];
new driver, passenger, backleft, backright;
GetVehicleParamsCarWindows(vehicleid, driver, passenger, backleft, backright);
// 0 = Janela aberta, 1 = Janela fechada
if (!IsWindowedVehicle(vehicleid))
return SendErrorMessage(playerid, "Este veнculo nгo possui janelas.");
switch (CoreVehicles[vehicleid][vehWindowsDown])
{
case false:
{
CoreVehicles[vehicleid][vehWindowsDown] = true;
ShowPlayerFooter(playerid, "Voce ~g~abaixou as janelas~w~ do veiculo!");
format(string, sizeof(string), "** %s pressiona um botгo e abaixa as janelas do veнculo.", ReturnName(playerid, 0));
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 10000);
SetVehicleParamsCarWindows(vehicleid, 0, passenger, backleft, backright);
// No caso sу alterei a janela do passageiro, mas se quiser que abram todas sу colocar o valor 0 em todas
}
case true:
{
CoreVehicles[vehicleid][vehWindowsDown] = false;
ShowPlayerFooter(playerid, "Voce ~r~fechou as janelas~w~ do veiculo!");
format(string, sizeof(string), "** %s pressiona um botгo e fecha as janelas do veнculo.", ReturnName(playerid, 0));
SetPlayerChatBubble(playerid, string, COLOR_PURPLE, 30.0, 10000);
SetVehicleParamsCarWindows(vehicleid, 1, passenger, backleft, backright);
}
}
return 1;
}