Ezzel a script-el a jármûvek ajtaját lehet nyitni/zárni
function onPlayerDisconnect(playerid, reason)
{
oldvehicleid[playerid] = false;
return 1;
}
addEvent(\"playerDisconnect\", onPlayerDisconnect);
function onPlayerEnterVehicle(playerid, vehicleid, seatid)
{
if(seatid == 0 && oldvehicleid[playerid] != false && oldvehicleid[playerid] != vehicleid && getVehicleLocked(oldvehicleid[playerid]).tointeger() == 1)
{
setVehicleLocked(oldvehicleid[playerid], 0);
if(getVehicleLocked(oldvehicleid[playerid]) == 0)
{
oldvehicleid[playerid] = vehicleid;
sendPlayerMessage(playerid, \"Amelyik jármûbõl utoljára kiszálltál, automatikusan kinyílik neked!\", White);
}
}
if(seatid == 0)
{
oldvehicleid[playerid] = vehicleid;
}
return 1;
}
addEvent(\"playerEnterVehicle\", onPlayerEnterVehicle);
function onPlayerCommand(playerid, command)
{
local cmd = split(command, \" \");
if(cmd[0] == \"/lock\")
{
local vehicleid = getPlayerVehicleId(playerid);
if(isPlayerInAnyVehicle && getPlayerSeatId (playerid) == 0)
{
setVehicleLocked(vehicleid, 1);
sendPlayerMessage(playerid, \"A jármû bezárva!\", White);
}
return 1;
}
if(cmd[0] == \"/unlock\")
{
local vehicleid = getPlayerVehicleId(playerid);
if(isPlayerInAnyVehicle && getPlayerSeatId (playerid) == 0)
{
setVehicleLocked(vehicleid, 0);
sendPlayerMessage(playerid, \"A jármû kinyitva!\", White);
}
if(oldvehicleid[playerid] != false)
{
if(getVehicleLocked(oldvehicleid[playerid]) == 1)
{
setVehicleLocked(oldvehicleid[playerid], 0);
sendPlayerMessage(playerid, \"A jármû kinyitva!\", White);
}
}
return 1;
}
return 0;
}
addEvent(\"playerCommand\", onPlayerCommand);
A scriptet nem én készítettem, csak lefordítottam.
A script készítõje: THE[GOD]FATHER