Several players are experiencing this issue, we will be looking into it sometime soon.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menumexui.window(x, y, w, h, title, styles);
window.button(x, y, w, h, text, styles, callback);
window.character(x, y, w, h, text, styles, callback);
window.characters(x, y, w, h, text, styles, callback);
window.checkBox(x, y, w, h, text, styles, callback);
window.day(x, y, w, h, text, styles, callback);
window.date(x, y, w, h, text, styles, callback);
window.digit(x, y, w, h, text, styles, callback);
window.digits(x, y, w, h, text, styles, callback);
window.dropDown(x, y, w, h, text, styles, callback);
window.grid(x, y, w, h, styles);
window.hour(x, y, w, h, text, styles, callback);
window.image(x, y, w, h, filePath, styles);
window.integer(x, y, w, h, text, styles, callback);
window.letter(x, y, w, h, text, styles, callback);
window.letters(x, y, w, h, text, styles, callback);
window.letterDigit(x, y, w, h, text, styles, callback);
window.lettersDigits(x, y, w, h, text, styles, callback);
window.line(x, y, w, h, styles, callback);
window.list(x, y, w, h, styles, callback);
window.minute(x, y, w, h, text, styles, callback);
window.month(x, y, w, h, text, styles, callback);
window.number(x, y, w, h, text, styles, callback);
window.password(x, y, w, h, text, styles, callback);
window.progressBar(x, y, w, h, text, styles);
window.radioButton(x, y, w, h, text, groupId, styles, callback);
window.rangedInteger(x, y, w, h, text, min, max, styles, callback);
window.rangedNumber(x, y, w, h, text, min, max, styles, callback);
window.rectangle(x, y, w, h, styles, callback);
window.scrollBar(x, y, w, h, isVertical, styles, callback);
window.second(x, y, w, h, text, styles, callback);
window.slider(x, y, w, h, isVertical, text, minText, maxText, styles, callback);
window.tabPanel(x, y, w, h, styles, callback);
window.text(x, y, w, h, text, styles);
window.textArea(x, y, w, h, text, styles, callback);
window.textInput(x, y, w, h, text, styles, callback);
window.time(x, y, w, h, text, styles, callback);
window.tree(x, y, w, h, styles, callback);
window.week(x, y, w, h, text, styles, callback);
window.year(x, y, w, h, text, styles, callback);
element.bindTo(element);
{
main: {
backgroundColour: toColour(0, 0, 0, 255),
textColour: toColour(255, 255, 255, 255),
hover: {
backgroundColour: toColour(255, 255, 255, 255),
textColour: toColour(0, 0, 0, 255),
transitionTime: 500,
transitionDelay: 0,
}
}
}
traffic = {}
traffic.sidewalk = {}
traffic.sidewalk.nodes = {}
traffic.sidewalk.nodeGroups = {}
traffic.road = {}
traffic.road.nodes = {}
traffic.road.nodeGroups = {}
traffic.water = {}
traffic.water.nodes = {}
traffic.water.nodeGroups = {}
addEventHandler('OnResourceStart', function(event, resource)
if resource ~= thisResource then return end
-- load ped nodes into server memory
print('Loading traffic data..')
local file = openFile('nodes/paths.ipl')
local data = file:readBytes(1171556)
file:close()
local lines = explode("rn", data)
local groupType, node
local groupNodes_sidewalk, groupNodes_road, groupNodes_water = {}, {}, {}
for i,v in ipairs(lines) do
if v:find(',', 0, true) then
if v:len() <= 8 then
-- group type
if #groupNodes_sidewalk > 0 then table.insert(traffic.sidewalk.nodes, groupNodes_sidewalk) end
if #groupNodes_road > 0 then table.insert(traffic.road.nodes, groupNodes_road) end
if #groupNodes_water > 0 then table.insert(traffic.water.nodes, groupNodes_water) end
groupNodes_sidewalk = {}
groupNodes_road = {}
groupNodes_water = {}
groupType = tonumber(v:sub(1, 1))
else
-- node type
node = explode(',', v)
for i2,v2 in ipairs(node) do
node[i2] = tonumber(v2)
end
node[4] = node[4] / 16.0
node[5] = node[5] / 16.0
node[6] = node[6] / 16.0
if groupType == 0 then -- sidewalk
table.insert(groupNodes_sidewalk, node)
traffic.sidewalk.nodeGroups[node] = groupNodes_sidewalk
elseif groupType == 1 then -- road
table.insert(groupNodes_road, node)
traffic.road.nodeGroups[node] = groupNodes_road
elseif groupType == 2 then -- water
table.insert(groupNodes_water, node)
traffic.water.nodeGroups[node] = groupNodes_water
end
end
end
end
if #groupNodes_sidewalk > 0 then table.insert(traffic.sidewalk.nodes, groupNodes_sidewalk) end
if #groupNodes_road > 0 then table.insert(traffic.road.nodes, groupNodes_road) end
if #groupNodes_water > 0 then table.insert(traffic.water.nodes, groupNodes_water) end
print('Done.')
end)
function explode(div,str) -- credit: http://richard.warburton.it
-- http://lua-users.org/wiki/MakingLuaLikePhp
if (div=='') then return false end
local pos,arr = 0,{}
-- for each divider found
for st,sp in function() return string.find(str,div,pos,true) end do
table.insert(arr,string.sub(str,pos,st-1)) -- Attach chars left of current divider
pos = sp + 1 -- Jump past current divider
end
table.insert(arr,string.sub(str,pos)) -- Attach chars right of last divider
return arr
end
var intervaledMessages = {};
intervaledMessages.enabled = true;
intervaledMessages.messages = [];
intervaledMessages.messageIndex = 0;
intervaledMessages.messageInterval = 60000;
intervaledMessages.messages[0] = 'Message 1';
intervaledMessages.messages[1] = 'Message 2';
intervaledMessages.messages[2] = 'Message 3';
if(intervaledMessages.enabled && intervaledMessages.messages.length != 0)
{
setInterval(function(){
outputChatBox(intervaledMessages.messages[intervaledMessages.messageIndex], COLOUR_BLUE);
if(intervaledMessages.messageIndex == (intervaledMessages.messages.length - 1))
intervaledMessages.messageIndex = 0;
else
intervaledMessages.messageIndex++;
}, intervaledMessages.messageInterval);
}
var admin = {};
admin.playerNamesData = {};
admin.connectedPlayersData = {};
admin.commandLevels = {};
// players
admin.playerNamesData['username1'] = {};
admin.playerNamesData['username1'].level = 10;
admin.playerNamesData['username1'].password = 'abc';
admin.playerNamesData['secondUsername'] = {};
admin.playerNamesData['secondUsername'].level = 10;
admin.playerNamesData['secondUsername'].password = 'abc';
// commands
admin.commandLevels['commanda'] = 5;
admin.commandLevels['commandb'] = 10;
admin.commandLevels['commandc'] = 11;
// code
function checkPlayerCommandLevel(client, commandName)
{
if(admin.commandLevels[commandName])
{
if(!admin.connectedPlayersData[client.player.name].loggedIn || admin.playerNamesData[client.player.name].level < admin.commandLevels[commandName])
{
outputChatBox("You do not have high enough admin level to use this command!", COLOUR_RED, client);
return false;
}
}
return true;
}
addEventHandler("OnPlayerJoined", (event,client) => {
admin.connectedPlayersData[client.player.name] = {};
});
addEventHandler("OnPlayerQuit", (event,client,reason) => {
admin.connectedPlayersData[client.player.name] = null;
});
addCommandHandler("login", (commandName, args, client) => {
if(admin.playerNamesData[client.player.name])
{
if(args == admin.playerNamesData[client.player.name].password)
{
admin.connectedPlayersData[client.player.name].loggedIn = true;
outputChatBox("You have logged in!", COLOUR_BLUE, client);
}
else
{
outputChatBox("Incorrect password!", COLOUR_RED, client);
}
}
else
{
outputChatBox("Account does not exist!", COLOUR_RED, client);
}
});
addCommandHandler("commanda", (commandName, args, client) => {
if(!checkPlayerCommandLevel(client, commandName))
{
return;
}
outputChatBox("Command a", COLOUR_BLUE, client);
});
addCommandHandler("commandb", (commandName, args, client) => {
if(!checkPlayerCommandLevel(client, commandName))
{
return;
}
outputChatBox("Command b", COLOUR_BLUE, client);
});
addCommandHandler("commandc", (commandName, args, client) => {
if(!checkPlayerCommandLevel(client, commandName))
{
return;
}
outputChatBox("Command c", COLOUR_BLUE, client);
});
addCommandHandler("s",function(commandName,code,client) -- expressions
if code == '' then
outputChatBox(client.player.name..", you must type some server code to run! Syntax /s <code>", CHAT_TYPE_INFO)
else
local returns = { pcall(load("return "..code)) }
local status = table.remove(returns, 1)
if not status then
local _error = returns[1]
outputChatBox(client.player.name.."'s server code had an error!", CHAT_TYPE_INFO)
outputChatBox("Code: "..code, CHAT_TYPE_INFO)
outputChatBox("Error: ".._error, CHAT_TYPE_INFO)
else
outputChatBox(client.player.name.." ran server code: "..code, CHAT_TYPE_INFO)
local argsStr = getArgsString(table.unpack(returns))
outputChatBox("Returns: "..argsStr, CHAT_TYPE_INFO)
end
end
end)
addCommandHandler("s2",function(commandName,code,client) -- statements
if code == '' then
outputChatBox(client.player.name..", you must type some server code to run! Syntax /s2 <code>", CHAT_TYPE_INFO)
else
local status, _error = pcall(load(code))
if not status then
outputChatBox(client.player.name.."'s server code had an error!", CHAT_TYPE_INFO)
outputChatBox("Code: "..code, CHAT_TYPE_INFO)
outputChatBox("Error: ".._error, CHAT_TYPE_INFO)
else
outputChatBox(client.player.name.." ran server code: "..code, CHAT_TYPE_INFO)
end
end
end)
function ocb(...)
outputChatBox(getArgsString(...), CHAT_TYPE_INFO)
end
function getArgsString(...)
local arg = {...}
local Values, Value, Type = {}
for i,v in ipairs(arg) do
Type = type(v)
if Type == "number" then Value = v
elseif Type == "boolean" then Value = (v) and "true" or "false"
elseif Type == "string" then Value = [[']]..replace(replace(v, [[]], [[\]]), [[']], [[']])..[[']]
elseif Type == "table" then Value = getTableString(v)
elseif Type == "function" then Value = "function"
elseif Type == "userdata" then Value = "userdata: "..tostring(v)
elseif Type == "nil" then Value = "nil"
else Value = (Type) and ""..Type.."" or "unknown data type"
end
table.insert(Values, Value)
end
return (Values[1]) and table.concat(Values, ", ") or "nil"
end
function replace(String, LookFor, ReplaceWith)
if not String or not LookFor or not ReplaceWith then return end
String, LookFor, ReplaceWith = tostring(String), tostring(LookFor), tostring(ReplaceWith)
local NewString = ""
local OccuranceStartPos = string.find(String, LookFor, 1, true)
if not OccuranceStartPos then return String end
if OccuranceStartPos > 1 then
NewString = NewString..string.sub(String, 1, OccuranceStartPos - 1)
end
local OccuranceEndPos
while OccuranceStartPos do
OccuranceEndPos = OccuranceStartPos + (string.len(LookFor) - 1)
NewString = NewString..ReplaceWith
OccuranceStartPos = string.find(String, LookFor, OccuranceEndPos + 1, true)
if (OccuranceStartPos or 0) - 1 > OccuranceEndPos then
NewString = NewString..string.sub(String, OccuranceEndPos + 1, OccuranceStartPos - 1)
end
end
if OccuranceEndPos < string.len(String) then
NewString = NewString..string.sub(String, OccuranceEndPos + 1)
end
return NewString
end
function getTableString(Table)
local String, IntKey, Element = {}, (isTableIntKey(Table)) and true or false
table.insert(String, '{')
for i,v in _G[((IntKey) and 'i' or '')..'pairs'](Table) do
Element = { i, v }
for j,w in ipairs(Element) do
if j == 1 then table.insert(String, ((#String > 1) and ',' or '')..((IntKey) and '' or '[')) end
if not IntKey or j == 2 then
Type = type(w)
if Type == 'number' then table.insert(String, w)
elseif Type == 'boolean' then table.insert(String, ((w) and 'true' or 'false'))
elseif Type == 'string' then table.insert(String, [[']]..replace(replace(w, [[]], [[\]]), [[']], [[']])..[[']])
elseif Type == 'table' then table.insert(String, getTableString(w))
elseif Type == 'function' then table.insert(String, 'function')
elseif Type == 'userdata' then table.insert(String, 'userdata: '..tostring(w))
elseif Type == 'nil' then table.insert(String, 'nil')
else table.insert(String, 'unknown data type')
end
end
if j == 1 then table.insert(String, ((IntKey) and '' or ']=')) end
end
end
table.insert(String, '}')
return table.concat(String)
end
function isTableIntKey(Table)
local b = 0
for i,v in pairs(Table) do b = b + 1 end
for a=1, b do
if Table[a] == nil then return false end
end
return true
end
addCommandHandler("c",function(commandName,code) -- expressions
if code == '' then
outputChatBox(localPlayer.name..", you must type some client code to run! Syntax /c <code>", CHAT_TYPE_INFO)
else
local returns = { pcall(load("return "..code)) }
local status = table.remove(returns, 1)
if not status then
local _error = returns[1]
outputChatBox(localPlayer.name.."'s client code had an error!", CHAT_TYPE_INFO)
outputChatBox("Code: "..code, CHAT_TYPE_INFO)
outputChatBox("Error: ".._error, CHAT_TYPE_INFO)
else
outputChatBox(localPlayer.name.." ran client code: "..code, CHAT_TYPE_INFO)
local argsStr = getArgsString(table.unpack(returns))
outputChatBox("Returns: "..argsStr, CHAT_TYPE_INFO)
end
end
end)
addCommandHandler("c2",function(commandName,code) -- statements
if code == '' then
outputChatBox(localPlayer.name..", you must type some client code to run! Syntax /c2 <code>", CHAT_TYPE_INFO)
else
local status, _error = pcall(load(code))
if not status then
outputChatBox(localPlayer.name.."'s client code had an error!", CHAT_TYPE_INFO)
outputChatBox("Code: "..code, CHAT_TYPE_INFO)
outputChatBox("Error: ".._error, CHAT_TYPE_INFO)
else
outputChatBox(localPlayer.name.." ran client code: "..code, CHAT_TYPE_INFO)
end
end
end)
function ocb(...)
outputChatBox(getArgsString(...), CHAT_TYPE_INFO)
end
function getArgsString(...)
local arg = {...}
local Values, Value, Type = {}
for i,v in ipairs(arg) do
Type = type(v)
if Type == "number" then Value = v
elseif Type == "boolean" then Value = (v) and "true" or "false"
elseif Type == "string" then Value = [[']]..replace(replace(v, [[]], [[\]]), [[']], [[']])..[[']]
elseif Type == "table" then Value = getTableString(v)
elseif Type == "function" then Value = "function"
elseif Type == "userdata" then Value = "userdata: "..tostring(v)
elseif Type == "nil" then Value = "nil"
else Value = (Type) and ""..Type.."" or "unknown data type"
end
table.insert(Values, Value)
end
return (Values[1]) and table.concat(Values, ", ") or "nil"
end
function replace(String, LookFor, ReplaceWith)
if not String or not LookFor or not ReplaceWith then return end
String, LookFor, ReplaceWith = tostring(String), tostring(LookFor), tostring(ReplaceWith)
local NewString = ""
local OccuranceStartPos = string.find(String, LookFor, 1, true)
if not OccuranceStartPos then return String end
if OccuranceStartPos > 1 then
NewString = NewString..string.sub(String, 1, OccuranceStartPos - 1)
end
local OccuranceEndPos
while OccuranceStartPos do
OccuranceEndPos = OccuranceStartPos + (string.len(LookFor) - 1)
NewString = NewString..ReplaceWith
OccuranceStartPos = string.find(String, LookFor, OccuranceEndPos + 1, true)
if (OccuranceStartPos or 0) - 1 > OccuranceEndPos then
NewString = NewString..string.sub(String, OccuranceEndPos + 1, OccuranceStartPos - 1)
end
end
if OccuranceEndPos < string.len(String) then
NewString = NewString..string.sub(String, OccuranceEndPos + 1)
end
return NewString
end
function getTableString(Table)
local String, IntKey, Element = {}, (isTableIntKey(Table)) and true or false
table.insert(String, '{')
for i,v in _G[((IntKey) and 'i' or '')..'pairs'](Table) do
Element = { i, v }
for j,w in ipairs(Element) do
if j == 1 then table.insert(String, ((#String > 1) and ',' or '')..((IntKey) and '' or '[')) end
if not IntKey or j == 2 then
Type = type(w)
if Type == 'number' then table.insert(String, w)
elseif Type == 'boolean' then table.insert(String, ((w) and 'true' or 'false'))
elseif Type == 'string' then table.insert(String, [[']]..replace(replace(w, [[]], [[\]]), [[']], [[']])..[[']])
elseif Type == 'table' then table.insert(String, getTableString(w))
elseif Type == 'function' then table.insert(String, 'function')
elseif Type == 'userdata' then table.insert(String, 'userdata: '..tostring(w))
elseif Type == 'nil' then table.insert(String, 'nil')
else table.insert(String, 'unknown data type')
end
end
if j == 1 then table.insert(String, ((IntKey) and '' or ']=')) end
end
end
table.insert(String, '}')
return table.concat(String)
end
function isTableIntKey(Table)
local b = 0
for i,v in pairs(Table) do b = b + 1 end
for a=1, b do
if Table[a] == nil then return false end
end
return true
end