Vehicle windows help! - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vehicle windows help! (
/showthread.php?tid=624256)
Vehicle windows help! -
daghost111 - 13.12.2016
Hello all!I have been trying to create a code to open vehicle windows separately,but it did not work.I also searched forums but there was FS's that opens all the windows at once.
I want like /rollwindow 1 - will open driver window...,or /rollwindow 3 to open back left window and so on.If anyone can provice me the code,i would really appreciate it.Thanks
P.S Sorry if i posted at wrong section.
Re: Vehicle windows help! -
Konstantinos - 13.12.2016
pawn Код:
CMD:rollwindow(playerid, params[])
{
if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, -1, "You need to be driver to use this command.");
// or if you want passengers to be able to use the command, replace the above with the one below
// if (!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "You need to be in a vehicle to use this command.");
new window;
if (sscanf(params, "i", window))
{
SendClientMessage(playerid, -1, "Usage: /rollwindow <window>");
SendClientMessage(playerid, -1, "Windows: 1 - driver | 2 - passenger | 3 - back left | 4 - back right");
return 1;
}
if (!(1 <= window <= 4)) return SendClientMessage(playerid, -1, "The value of 'window' parameter should be between 1 and 4");
new window_state[4], vehicleid = GetPlayerVehicleID(playerid);
GetVehicleParamsCarWindows(vehicleid, window_state[0], window_state[1], window_state[2], window_state[3]);
window_state[--window] = !window_state[window];
SetVehicleParamsCarWindows(vehicleid, window_state[0], window_state[1], window_state[2], window_state[3]);
return 1;
}
Re: Vehicle windows help! -
AbyssMorgan - 13.12.2016
https://sampforum.blast.hk/showthread.php?tid=611142
PHP код:
GetVehicleWindowState(vehicleid,doorid);
SetVehicleWindowState(vehicleid,doorid,window_state);