aScreen_ = { guiGetScreenSize ( ) }
aBoolean = false
aSkinsBoolean = false
isEventHandlerAdded = function ( sEventName, pElementAttachedTo, func )
if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then
local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
for i, v in ipairs( aAttachedFunctions ) do
if v == func then
return true
end
end
end
end
return false
end
aWindowC_ = guiCreateWindow ( ( aScreen_ [ 1 ] - 240 ) / 2, ( aScreen_ [ 2 ] - 102) / 2, 240, 102, ".: Metal Gaming :.", false)
guiWindowSetSizable(aWindowC_, false)
guiSetAlpha(aWindowC_, 0.75)
guiSetVisible ( aWindowC_ , false )
ButtonShow = guiCreateButton(10, 26, 220, 30, "Show Intro", false, aWindowC_)
guiSetAlpha(ButtonShow, 0.85)
guiSetFont(ButtonShow, "default-bold-small")
guiSetProperty(ButtonShow, "NormalTextColour", "FFADFE00")
ButtonSkip = guiCreateButton(9, 61, 220, 30, "Skip Intro", false, aWindowC_)
guiSetAlpha(ButtonSkip, 0.85)
guiSetFont(ButtonSkip, "default-bold-small")
guiSetProperty(ButtonSkip, "NormalTextColour", "FFFD2900")
function dxDrawAnimPicture( Link , width , height , anim , aRot )
local x,y = guiGetScreenSize()
btwidth , btheight = width , height/20
local now = getTickCount ( )
local elapsedTime = now - start
local endTime = start + 1500
local duration = endTime - start
local progress = elapsedTime / duration
local x1, y1, z1 = interpolateBetween ( 0, 0, 0, width, height, 255, progress, anim)
local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btwidth, btheight, btheight/11, progress, anim)
posx = (x/2)-(x1/2)
posy = (y/2)-(y1/2)
dxDrawImage ( posx, posy, x1, y1, Link , aRot )
end
function dxDrawAnimText( Text , width , height , anim )
local x,y = guiGetScreenSize()
btwidth , btheight = width , height/20
local now = getTickCount ( )
local elapsedTime = now - start
local endTime = start + 1500
local duration = endTime - start
local progress = elapsedTime / duration
local x1, y1, z1 = interpolateBetween ( 0, 0, 0, width, height, 255, progress, anim)
local x2, y2, z2 = interpolateBetween ( 0, 0, 0, btwidth, btheight, btheight/11, progress, anim)
posx = (x/2)-(x1/2)
posy = (y/2)-(y1/2)
dxDrawRectangle((aScreen_ [ 1 ] - 524) / 2, (aScreen_ [ 2 ]- 33) / 2, x2, y2 , tocolor(0, 0, 0, 224), false)
dxDrawText( Text , (aScreen_ [ 1 ] - 508) / 2, (aScreen_ [ 2 ]- 20) / 2, ((aScreen_ [ 1 ] - 508) / 2) + 508, ( (aScreen_ [ 2 ]- 20) / 2) + 20, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "top", false, false, false, false, false)
end
function convertNumber ( number )
local formatted = number
while true do
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if ( k==0 ) then
break
end
end
return formatted
end
addEventHandler ( 'onClientElementDataChange', getRootElement ( ) ,
function ( aData )
if ( aData == 'WantLvl' ) then
if ( getElementData( localPlayer , aData ) ) then
triggerServerEvent ( 'SetWn' , localPlayer )
end
end
end )
Banker , Bank , aTableB = { } , { } , {
{ 2812.3, 1288.61, 10.75 },
{ 2804.22, 1299.17, 10.75 },
{ 2788.66, 1297.16, 10.75 },
{ 2778.01, 1287.35, 10.75 },
{ 2769.38, 1274.79, 10.75 },
{ 2770.75, 1259.67, 10.75 },
{ 2792.11, 1253.33, 11.31 },
{ 2815.34, 1252.63, 11.31 },
{ 2830.43, 1246.67, 10.77 },
{ 2825.66, 1348.79, 10.76 },
{ 2819.28, 1356.75, 10.75 }
}
function OutPut ( aText_ )
exports['guimessages']:outputClient ( '#3CFF00'..aText_..'', 255, 255, 255 )
end
aManagerAccounts = guiCreateWindow((aScreen_[1] - 487) / 2, (aScreen_[2] - 613) / 2, 487, 613, "Accounts Manager .:Metal Gaming:.", false)
guiWindowSetSizable(aManagerAccounts, false)
guiSetAlpha(aManagerAccounts, 1.00)
guiSetVisible ( aManagerAccounts , false )
ButtonDeleteAccount = guiCreateButton(11, 501, 153, 23, "Delete Account", false, aManagerAccounts)
guiSetFont(ButtonDeleteAccount, "default-bold-small")
guiSetProperty(ButtonDeleteAccount, "NormalTextColour", "FFFF0000")
ButtonCopyInfo = guiCreateButton(174, 501, 299, 23, "Copy Info", false, aManagerAccounts)
guiSetFont(ButtonCopyInfo, "default-bold-small")
guiSetProperty(ButtonCopyInfo, "NormalTextColour", "FF06DAE2")
ButtonChingPassword = guiCreateButton(323, 542, 150, 23, "Set Password", false, aManagerAccounts)
guiSetFont(ButtonChingPassword, "default-bold-small")
guiSetProperty(ButtonChingPassword, "NormalTextColour", "FF00E941")
aEditCPassword = guiCreateEdit(11, 540, 306, 25, "", false, aManagerAccounts)
aEditOwner = guiCreateEdit(11, 575, 306, 25, "", false, aManagerAccounts)
ButtonSetSerialOwner = guiCreateButton(323, 577, 149, 23, "Set Serial Owner", false, aManagerAccounts)
guiSetFont(ButtonSetSerialOwner, "default-bold-small")
guiSetProperty(ButtonSetSerialOwner, "NormalTextColour", "FF00E941")
aLabed_ = guiCreateLabel(13, 479, 460, 16, "__________________________________________________________________________", false, aManagerAccounts)
guiSetFont(aLabed_, "default-bold-small")
guiLabelSetColor(aLabed_, 199, 31, 114)
aGridListAccounts = guiCreateGridList(10, 68, 463, 401, false, aManagerAccounts)
guiGridListAddColumn(aGridListAccounts, "Owner", 0.55)
guiGridListAddColumn(aGridListAccounts, "User", 0.1)
guiGridListAddColumn(aGridListAccounts, "Pasword", 0.1)
guiGridListAddColumn(aGridListAccounts, "Y", 0.1)
guiGridListAddColumn(aGridListAccounts, "M", 0.1)
guiGridListAddColumn(aGridListAccounts, "D", 0.1)
aEditSech = guiCreateEdit(68, 30, 405, 23, "", false, aManagerAccounts)
aLabelds_ = guiCreateLabel(13, 34, 45, 14, "Serial", false, aManagerAccounts)
guiSetFont(aLabelds_, "default-bold-small")
Banker['aWindow'] = guiCreateWindow((aScreen_[1] - 215) / 2, (aScreen_[2] - 182) / 2, 215, 182, "Bank System .: Soking :.", false)
guiWindowSetSizable(Banker['aWindow'], false)
guiSetVisible ( Banker['aWindow'] , false )
Banker['aLabel1'] = guiCreateLabel(10, 28, 195, 16, "Banker : What do you want to do ?", false, Banker['aWindow'])
guiSetFont(Banker['aLabel1'], "default-bold-small")
Banker['aButtonJoinPIN'] = guiCreateButton(9, 70, 196, 24, "Create a PIN ", false, Banker['aWindow'])
guiSetFont(Banker['aButtonJoinPIN'], "default-bold-small")
guiSetProperty(Banker['aButtonJoinPIN'], "NormalTextColour", "FF42FC01")
Banker['aLabel2'] = guiCreateLabel(10, 44, 195, 16, "_______________________________________", false, Banker['aWindow'])
guiSetFont(Banker['aLabel2'], "default-bold-small")
guiLabelSetColor(Banker['aLabel2'], 254, 5, 0)
Banker['OpenMyBank'] = guiCreateButton(9, 104, 196, 24, "Open My Bank Account", false, Banker['aWindow'])
guiSetFont(Banker['OpenMyBank'], "default-bold-small")
guiSetProperty(Banker['OpenMyBank'], "NormalTextColour", "FFFEE900")
Banker['CloseWindow'] = guiCreateButton(9, 138, 196, 24, "Close Window", false, Banker['aWindow'])
guiSetFont(Banker['CloseWindow'], "default-bold-small")
guiSetProperty(Banker['CloseWindow'], "NormalTextColour", "FFFE0000")
Bank['Window'] = guiCreateWindow((aScreen_[1] - 323) / 2, (aScreen_[2] - 381) / 2, 323, 381, "Bank System .: Soking :.", false)
guiWindowSetSizable(Bank['Window'], false)
guiSetVisible ( Bank['Window'] , false )
Bank['MoneyHand'] = guiCreateLabel(11, 28, 343, 21, "Money in Your Hand : ", false, Bank['Window'])
guiSetFont(Bank['MoneyHand'], "default-bold-small")
guiLabelSetColor(Bank['MoneyHand'], 25, 173, 57)
Bank['MoneyBank'] = guiCreateLabel(11, 59, 343, 21, "Money in Your Bank : ", false, Bank['Window'])
guiSetFont(Bank['MoneyBank'], "default-bold-small")
guiLabelSetColor(Bank['MoneyBank'], 25, 173, 57)
addEventHandler ( 'onClientElementDataChange' , getRootElement ( ) ,
function ( aData_ )
if ( aData_ == 'Money' ) then
guiSetText ( Bank['MoneyHand'] , 'Money in Your Hand : $'..convertNumber ( getElementData ( localPlayer , 'Money' ) ) )
end
end )
Bank['Label1'] = guiCreateLabel(11, 90, 343, 21, "_______________________________________________________", false, Bank['Window'])
guiSetFont(Bank['Label1'], "default-bold-small")
Bank['Label_'] = guiCreateLabel(10, 121, 55, 24, "Amount :", false, Bank['Window'])
guiSetFont(Bank['Label_'], "default-bold-small")
guiLabelSetColor(Bank['Label_'], 31, 250, 202)
Bank['aEditBoxAmount'] = guiCreateEdit(69, 121, 241, 24, "", false, Bank['Window'])
Bank['Deposit'] = guiCreateButton(10, 155, 300, 25, "Deposit", false, Bank['Window'])
guiSetFont(Bank['Deposit'], "default-bold-small")
guiSetProperty(Bank['Deposit'], "NormalTextColour", "FF1C62B9")
Bank['DepositAll'] = guiCreateButton(10, 190, 300, 25, "Deposit All", false, Bank['Window'])
guiSetFont(Bank['DepositAll'], "default-bold-small")
guiSetProperty(Bank['DepositAll'], "NormalTextColour", "FFCC0AA1")
Bank['Withdraw'] = guiCreateButton(10, 225, 300, 25, "Withdraw", false, Bank['Window'])
guiSetFont(Bank['Withdraw'], "default-bold-small")
guiSetProperty(Bank['Withdraw'], "NormalTextColour", "FF1C62B9")
Bank['WithdrawAll'] = guiCreateButton(10, 260, 300, 25, "Withdraw All", false, Bank['Window'])
guiSetFont(Bank['WithdrawAll'], "default-bold-small")
guiSetProperty(Bank['WithdrawAll'], "NormalTextColour", "FFCC0AA1")
Bank['ButtonSend'] = guiCreateButton(218, 295, 95, 25, "Send !", false, Bank['Window'])
guiSetFont(Bank['ButtonSend'], "default-bold-small")
guiSetProperty(Bank['ButtonSend'], "NormalTextColour", "FF0297D5")
Bank['aEditBoxPIN'] = guiCreateEdit(79, 295, 129, 25, "", false, Bank['Window'])
Bank['LabelPIN'] = guiCreateLabel(10, 299, 65, 15, "PIN Player :", false, Bank['Window'])
guiSetFont(Bank['LabelPIN'], "default-bold-small")
guiLabelSetColor(Bank['LabelPIN'], 214, 196, 2)
Bank['Label2'] = guiCreateLabel(0, 320, 343, 21, "_______________________________________________________", false, Bank['Window'])
guiSetFont(Bank['Label2'], "default-bold-small")
Bank['ButtonClose'] = guiCreateButton(10, 341, 300, 25, "Close Window", false, Bank['Window'])
guiSetFont(Bank['ButtonClose'], "default-bold-small")
guiSetProperty(Bank['ButtonClose'], "NormalTextColour", "FFD90000")
Bank['aWindowPIN'] = guiCreateWindow((aScreen_[1] - 264) / 2, (aScreen_[2] - 168) / 2, 264, 168, "Bank System .: Soking :.", false)
guiWindowSetSizable(Bank['aWindowPIN'], false)
guiSetAlpha(Bank['aWindowPIN'], 0.87)
guiSetVisible ( Bank['aWindowPIN'] , false )
Bank['Label_Create'] = guiCreateLabel(88, 24, 71, 15, "Create a PIN", false, Bank['aWindowPIN'])
guiSetFont(Bank['Label_Create'], "default-bold-small")
guiLabelSetColor(Bank['Label_Create'], 243, 59, 189)
Bank['Price_'] = guiCreateLabel(10, 56, 242, 15, "Price : $100,000", false, Bank['aWindowPIN'])
guiSetFont(Bank['Price_'], "default-bold-small")
guiLabelSetColor(Bank['Price_'], 0, 217, 204)
Bank['ButtonCreatePIN'] = guiCreateButton(12, 83, 240, 25, "Create a PIN", false, Bank['aWindowPIN'])
guiSetFont(Bank['ButtonCreatePIN'], "default-bold-small")
guiSetProperty(Bank['ButtonCreatePIN'], "NormalTextColour", "FF07F63F")
Bank['CloseWindow'] = guiCreateButton(10, 118, 240, 25, "Close a Window", false, Bank['aWindowPIN'])
guiSetFont(Bank['CloseWindow'], "default-bold-small")
guiSetProperty(Bank['CloseWindow'], "NormalTextColour", "FFD90000")
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == Bank['Withdraw'] ) then
triggerServerEvent ( 'Bank:WithdrawnMoney' , localPlayer , tonumber ( guiGetText ( Bank['aEditBoxAmount'] ) ) )
end
end )
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == Bank['WithdrawAll'] ) then
triggerServerEvent ( 'Bank:WithdrawnAllMoney' , localPlayer )
elseif ( source == Bank['DepositAll'] ) then
triggerServerEvent ( 'Bank:DepositAllMoney' , localPlayer )
elseif ( source == Bank['ButtonSend'] ) then
triggerServerEvent ( 'Bank:SendMoney' , localPlayer , tonumber ( guiGetText ( Bank['aEditBoxAmount'] ) ) , tonumber ( guiGetText ( Bank['aEditBoxPIN'] ) ) )
end
end )
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == Bank['Deposit'] ) then
triggerServerEvent ( 'Bank:DepositMoney' , localPlayer , tonumber ( guiGetText ( Bank['aEditBoxAmount'] ) ) )
end
end )
addEvent ( 'Bank:RefreshLabels' , true )
addEventHandler ( 'Bank:RefreshLabels' , getRootElement ( ) ,
function ( )
guiSetText ( Bank['MoneyHand'] , 'Money in Your Hand : $'..convertNumber ( getElementData ( localPlayer , 'Money' ) ) )
guiSetText ( Bank['MoneyBank'] , 'Money in Your Bank : $'..convertNumber ( getElementData ( localPlayer , 'Bank' ) ) )
end )
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == Bank['ButtonCreatePIN'] ) then
triggerServerEvent ( 'Bank:CreatePIN' , localPlayer )
end
end )
addEvent ( 'Bank:aCloseWindow' , true )
addEventHandler ( 'Bank:aCloseWindow' , getRootElement ( ) ,
function ( )
for _,Windows in ipairs ( getElementsByType ( 'gui-window' , resourceRoot ) ) do
guiSetVisible ( Windows , false )
end
end )
addEvent ( 'Bank:aPlaySound' , true )
addEventHandler ( 'Bank:aPlaySound' , getRootElement ( ) ,
function ( )
fadeCamera ( true )
showCursor ( false )
playSound ( 'mission_accomplished.mp3' )
end )
addEvent ( 'Bank:OpenWindow' , true )
addEventHandler ( 'Bank:OpenWindow' , getRootElement ( ) ,
function ( aBool_ )
guiSetVisible ( Banker['aWindow'] , true )
showCursor ( true )
guiSetEnabled ( Banker['OpenMyBank'] , aBool_ )
guiSetEnabled ( Banker['aButtonJoinPIN'] , not aBool_ )
guiSetText ( Bank['MoneyHand'] , 'Money in Your Hand : $'..convertNumber ( getElementData ( localPlayer , 'Money' ) ) )
guiSetText ( Bank['MoneyBank'] , 'Money in Your Bank : $'..convertNumber ( getElementData ( localPlayer , 'Bank' ) ) )
end )
function convertNumber ( number )
local formatted = ( number or 0 )
while true do
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if ( k==0 ) then
break
end
end
return formatted
end
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == Banker['CloseWindow'] ) then
guiSetVisible ( Banker['aWindow'] , false )
showCursor ( false )
elseif ( source == Banker['aButtonJoinPIN'] ) then
guiSetVisible ( Banker['aWindow'] , false )
guiSetVisible ( Bank['aWindowPIN'] , true )
elseif ( source == Banker['OpenMyBank'] ) then
guiSetVisible ( Bank['Window'] , true )
guiSetVisible ( Bank['aWindowPIN'] , false )
guiSetVisible ( Banker['aWindow'] , false )
guiSetText ( Bank['MoneyHand'] , 'Money in Your Hand : $'..convertNumber ( getElementData ( localPlayer , 'Money' ) ) )
elseif ( source == Bank['CloseWindow'] ) then
guiSetVisible ( Bank['aWindowPIN'] , false )
showCursor ( false )
elseif ( source == Bank['ButtonClose'] ) then
guiSetVisible ( Bank['Window'] , false )
showCursor ( false )
end
end )
setElementData ( localPlayer , 'Money' , 0 )
GUIEditor = {
label = {}
}
aWindowLog = guiCreateWindow((aScreen_[1] - 438) / 2, (aScreen_[2] - 201) / 2, 435, 237, "Log in and set up an account .:Metal Gaming :.", false)
guiWindowSetSizable(aWindowLog, false)
guiSetVisible ( aWindowLog , false )
GUIEditor.label[1] = guiCreateLabel(13, 34, 77, 21, "Username :", false, aWindowLog)
guiSetFont(GUIEditor.label[1], "default-bold-small")
guiLabelSetColor(GUIEditor.label[1], 249, 119, 41)
GUIEditor.label[2] = guiCreateLabel(13, 65, 77, 21, "Password :", false, aWindowLog)
guiSetFont(GUIEditor.label[2], "default-bold-small")
guiLabelSetColor(GUIEditor.label[2], 249, 119, 41)
aEditUsername = guiCreateEdit(88, 32, 340, 23, "", false, aWindowLog)
aEditPassword = guiCreateEdit(88, 65, 340, 23, "", false, aWindowLog)
GUIEditor.label[3] = guiCreateLabel(13, 88, 415, 15, "___________________________________________________________", false, aWindowLog)
ButtonLogin = guiCreateButton(12, 113, 130, 25, "Login", false, aWindowLog)
guiSetFont(ButtonLogin, "default-bold-small")
ButtonCreateAccount = guiCreateButton(152, 113, 130, 25, "Create an Account", false, aWindowLog)
guiSetFont(ButtonCreateAccount, "default-bold-small")
ButtonViewIntro = guiCreateButton(298, 113, 130, 25, "View Intro", false, aWindowLog)
guiSetFont(ButtonViewIntro, "default-bold-small")
ButtonViewInfo = guiCreateButton(12, 148, 130, 25, "View Info", false, aWindowLog)
guiSetFont(ButtonViewInfo, "default-bold-small")
ButtonShowHidePasswords = guiCreateButton(152, 148, 276, 25, "Show / Hide Password", false, aWindowLog)
guiSetFont(ButtonShowHidePasswords, "default-bold-small")
aButtonAccountRecovery = guiCreateButton(12, 183, 416, 25, "Account Recovery ", false, aWindowLog )
guiSetFont(aButtonAccountRecovery, "default-bold-small")
aWindowVehicleSystem = guiCreateWindow((aScreen_[1] - 203) / 2, (aScreen_[2] - 330) / 2, 203, 330, "Vehicle System .: Soking :.", false)
guiWindowSetSizable(aWindowVehicleSystem, false)
guiSetVisible ( aWindowVehicleSystem , false )
aGridListVehicles = guiCreateGridList(10, 27, 180, 213, false, aWindowVehicleSystem)
guiGridListAddColumn(aGridListVehicles, "Vehicles", 0.9)
aButtonCreateVehicle = guiCreateButton(11, 250, 179, 25, "Create ", false, aWindowVehicleSystem)
guiSetFont(aButtonCreateVehicle, "default-bold-small")
guiSetProperty(aButtonCreateVehicle, "NormalTextColour", "FF12FE00")
CloseVehicle = guiCreateButton(11, 285, 179, 25, "Close", false, aWindowVehicleSystem)
guiSetFont(CloseVehicle, "default-bold-small")
guiSetProperty(CloseVehicle, "NormalTextColour", "FFFD0000")
aTableVehiclesID = { 'Savanna' , 'Sanchez' , 'Sadler' , 'Hustler' }
aTableMarkers = {
--[[{ 2505.6, -1694.93, 13.56 },
{ 1416.43, -1649.27, 13.38 },
{ 1181.69, -1308.75, 13.63 },
{ 335.63, -1806.57, 4.55 },
{ 2286.91, -1114.81, 37.98 },
{ 2224.75, -1342.26, 23.98 },
{ 1803.46, -1914.13, 13.4 }]]
}
function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha)
local x, y, z = getElementPosition(TheElement)
local x2, y2, z2 = getElementPosition(localPlayer)
local distance = distance or 20
local height = height or 1
local width = width or 1
local checkBuildings = checkBuildings or true
local checkVehicles = checkVehicles or false
local checkPeds = checkPeds or false
local checkObjects = checkObjects or true
local checkDummies = checkDummies or true
local seeThroughStuff = seeThroughStuff or false
local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false
local ignoredElement = ignoredElement or nil
if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
local sx, sy = getScreenFromWorldPosition(x, y, z+height)
if(sx) and (sy) then
local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
if(distanceBetweenPoints < distance) then
dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255))
end
end
end
end
for v in ipairs ( aTableMarkers ) do
local aMarkers = createMarker ( aTableMarkers[v][1] , aTableMarkers[v][2] , aTableMarkers[v][3] - 1.5 , 'cylinder' , 2 , 255 ,255 ,255 ,255 )
addEventHandler ( 'onClientMarkerHit' , root ,
function ( aPlayer )
if ( source == aMarkers and aPlayer == localPlayer and not isPedInVehicle ( aPlayer ) and getElementDimension ( aPlayer ) == 0 ) then
setElementFrozen ( aPlayer , true )
guiGridListClear ( aGridListVehicles )
for v in ipairs ( aTableVehiclesID ) do
local Row = guiGridListAddRow ( aGridListVehicles )
guiGridListSetItemText ( aGridListVehicles , Row , 1 , aTableVehiclesID[v] , false , false )
end
guiSetVisible ( aWindowVehicleSystem , true )
showCursor ( true )
end
end )
addEventHandler ( 'onClientMarkerLeave' , root ,
function ( aPlayer )
if ( aPlayer == localPlayer and source == aMarkers) then
setElementFrozen ( aPlayer , false )
guiSetVisible ( aWindowVehicleSystem , false )
showCursor ( false )
end
end )
end
aTableVehiclesIDPolice = { 'Police LS' , 'Police LV' , 'Police Maverick' , 'Police Ranger' , 'Police SF' , 'HPV1000' }
aTableMarkersPolice = {
--[[{ 1550.66, -1612.2, 13.6 },
{ 1558.86, -1612.21, 13.6 },
{ 1568.2, -1612.26, 13.6 }]]
}
aTag = dxCreateTexture("police.png")
for v in ipairs ( aTableMarkersPolice ) do
local aMarkez_ = createMarker ( aTableMarkersPolice[v][1] , aTableMarkersPolice[v][2] , aTableMarkersPolice[v][3] , 'corona' , 2 , 0 ,0 ,255 ,255 )
--[[addEventHandler('onClientPreRender', getRootElement ( ) ,
function ( )
dxDrawImageOnElement( aMarkez_ , aTag , 40 , 0 )
end )]]
addEventHandler ( 'onClientMarkerHit' , root ,
function ( aPlayer )
if ( source == aMarkez_ and aPlayer == localPlayer and not isPedInVehicle ( aPlayer ) and getElementDimension ( aPlayer ) == 0 and getPlayerTeam ( aPlayer ) == getTeamFromName ( 'Police' ) ) then
setElementFrozen ( aPlayer , true )
guiGridListClear ( aGridListVehicles )
for v in ipairs ( aTableVehiclesIDPolice ) do
local Row = guiGridListAddRow ( aGridListVehicles )
guiGridListSetItemText ( aGridListVehicles , Row , 1 , aTableVehiclesIDPolice[v] , false , false )
end
guiSetVisible ( aWindowVehicleSystem , true )
showCursor ( true )
end
end )
addEventHandler ( 'onClientMarkerLeave' , root ,
function ( aPlayer )
if ( source == aMarkez_ and aPlayer == localPlayer ) then
setElementFrozen ( aPlayer , false )
guiSetVisible ( aWindowVehicleSystem , false )
showCursor ( false )
end
end )
end
addEventHandler ( 'onClientGUIClick' , CloseVehicle ,
function ( )
guiSetVisible ( aWindowVehicleSystem , false )
showCursor ( false )
setElementFrozen ( localPlayer , false )
end , false )
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == aButtonCreateVehicle ) then
if ( guiGridListGetSelectedItem ( aGridListVehicles ) == -1 ) then return end
triggerServerEvent ( 'createVehicle_' , localPlayer , guiGridListGetItemText ( aGridListVehicles , guiGridListGetSelectedItem ( aGridListVehicles ) , 1 ) )
showCursor ( false )
guiSetVisible ( aWindowVehicleSystem , false )
setElementFrozen ( localPlayer , false )
end
end )
aValue = true
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == ButtonShowHidePasswords ) then
guiEditSetMasked ( aEditPassword , not aValue )
end
aValue = not aValue
end )
RecoveryAccount = { }
function ShowRegister ( )
if ( isElement ( RecoveryAccount['ButtonRecovery'] ) ) then destroyElement ( RecoveryAccount['ButtonRecovery'] ) end
if ( isElement ( RecoveryAccount['Mo'] ) ) then destroyElement ( RecoveryAccount['Mo'] ) end
if ( isElement ( RecoveryAccount['Day'] ) ) then destroyElement ( RecoveryAccount['Day'] ) end
if ( isElement ( RecoveryAccount['EditPassword'] ) ) then destroyElement ( RecoveryAccount['EditPassword'] ) end
if ( isElement ( RecoveryAccount['asd'] ) ) then destroyElement ( RecoveryAccount['asd'] ) end
if ( isElement ( RecoveryAccount['Label1'] ) ) then destroyElement ( RecoveryAccount['Label1'] ) end
if ( isElement ( RecoveryAccount['Label2'] ) ) then destroyElement ( RecoveryAccount['Label2'] ) end
if ( isElement ( RecoveryAccount['Label3'] ) ) then destroyElement ( RecoveryAccount['Label3'] ) end
if ( isElement ( RecoveryAccount['OldSerial'] ) ) then destroyElement ( RecoveryAccount['OldSerial'] ) end
if ( isElement ( RecoveryAccount['EditAccount'] ) ) then destroyElement ( RecoveryAccount['EditAccount'] ) end
if ( isElement ( RecoveryAccount['Year'] ) ) then destroyElement ( RecoveryAccount['Year'] ) end
if ( isElement ( aEditRePassword ) ) then destroyElement ( aEditRePassword ) end
if ( isElement ( Memo ) ) then destroyElement ( Memo ) end
if ( isElement ( aEditReUserName ) ) then destroyElement ( aEditReUserName ) end
if ( isElement ( aButtonRecovery ) ) then destroyElement ( aButtonRecovery ) end
if ( isElement ( aLabelErrorCoPass ) ) then destroyElement ( aLabelErrorCoPass ) end
if ( isElement ( ButtonCreateAnAccount ) ) then destroyElement ( ButtonCreateAnAccount ) end
if ( isElement ( aLabelErrorDayz ) ) then destroyElement ( aLabelErrorDayz ) end
if ( isElement ( aEditDay ) ) then destroyElement ( aEditDay ) end
if ( isElement ( aEditCPassword ) ) then destroyElement ( aEditCPassword ) end
if ( isElement ( aLabelErrorUserName ) ) then destroyElement ( aLabelErrorUserName ) end
if ( isElement ( aLabelErrorPassowrd ) ) then destroyElement ( aLabelErrorPassowrd ) end
if ( isElement ( aEditConfrmPassword ) ) then destroyElement ( aEditConfrmPassword ) end
if ( isElement ( aEditYear ) ) then destroyElement ( aEditYear ) end
if ( isElement ( aEditMo ) ) then destroyElement ( aEditMo ) end
for Index = 4 , 8 do
if ( isElement ( aLabel_ [ Index ] ) ) then destroyElement ( aLabel_ [ Index ] ) end
end
end
local sm = {}
sm.moov = 0
sm.object1,sm.object2 = nil,nil
local function removeCamHandler()
if(sm.moov == 1)then
sm.moov = 0
end
end
local function camRender()
if (sm.moov == 1) then
local x1,y1,z1 = getElementPosition(sm.object1)
local x2,y2,z2 = getElementPosition(sm.object2)
setCameraMatrix(x1,y1,z1,x2,y2,z2)
end
end
addEventHandler("onClientRender",root,camRender)
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)
if( sm.moov == 1 )then return false end
sm.object1 = createObject(1337,x1,y1,z1)
sm.object2 = createObject(1337,x1t,y1t,z1t)
setElementAlpha(sm.object1,0)
setElementAlpha(sm.object2,0)
setObjectScale(sm.object1,0.01)
setObjectScale(sm.object2,0.01)
moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad")
moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad")
sm.moov = 1
setTimer(removeCamHandler,time,1)
setTimer(destroyElement,time,1,sm.object1)
setTimer(destroyElement,time,1,sm.object2)
return true
end
Rot = 0
local function aMain_ ( )
aSound = playSound ( 'intro.mp3' )
setTimer ( function ( )
start = getTickCount ( )
function Loop1( ) dxDrawAnimPicture ( "Random1.png" , aScreen_[1], aScreen_[2] , "OutElastic" , 0 ) end
addEventHandler ( "onClientRender", getRootElement ( ) , Loop1 )
setTimer ( function ( )
removeEventHandler ( "onClientRender", getRootElement ( ) , Loop1 )
start = getTickCount ( )
function Loop2( ) dxDrawAnimPicture ( "Random2.png" , aScreen_[1], aScreen_[2] , "OutInBounce" , 0 ) end
addEventHandler ( "onClientRender", getRootElement ( ) , Loop2 )
setTimer ( function ( )
removeEventHandler ( "onClientRender", getRootElement ( ) , Loop2 )
start = getTickCount ( )
function Loop3( ) dxDrawAnimPicture ( "iMage3.png" , aScreen_[1], aScreen_[2] , "OutInQuad" , 0 ) end
addEventHandler ( "onClientRender", getRootElement ( ) , Loop3 )
setTimer ( function ( )
Anim , iMage_ = 'SineCurve' , 'iMage4.png'
function Loop4( ) dxDrawAnimPicture ( iMage_, aScreen_[1], aScreen_[2] , Anim , Rot ) end
function Loop4_ ( ) Rot = Rot + 3 end
removeEventHandler ( "onClientRender", getRootElement ( ) , Loop3 )
start = getTickCount ( )
addEventHandler ( "onClientRender", getRootElement ( ) , Loop4 )
addEventHandler ( "onClientRender", getRootElement ( ) , Loop4_ )
setTimer ( function ( ) start = getTickCount ( ) Anim , iMage_ = 'CosineCurve' , 'iMage2.png'
setTimer ( function ( ) start = getTickCount ( ) removeEventHandler ( "onClientRender", getRootElement ( ) , Loop4_ ) Rot = 0 Anim , iMage_ = 'OutInBounce' , 'iMage1.png'
setTimer ( function ( ) start = getTickCount ( ) Anim , iMage_ = 'OutElastic' , 'iMage3.png'
setTimer ( function ( ) setTimer ( function ( ) local Random = math.random ( 1 , 11 ) start = getTickCount ( ) Anim , iMage_ = 'OutBack' , 'Random'..Random..'.png' end , 1500 , 7 ) setTimer ( function ( ) start = getTickCount ( ) Anim = 'InBounce' end , 1500 * 4 , 1 ) start = getTickCount ( ) Anim = 'InBounce' end , 1500 , 1 )
setTimer ( function ( )
removeEventHandler ( "onClientRender", getRootElement ( ) , Loop4 )
function Text__ ( )
start = getTickCount ( )
function FunctionText1 ( )
dxDrawAnimText( '#[Metal Gaming] <3' , 524 , 600 , "OutElastic" )
end addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 )
setTimer ( function ( )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 )
Text ( )
end , 4000 , 1 )
end
Text__ ( )
setCameraMatrix ( 1493 ,-1668 ,77 ,1585 ,-1670 ,38 )
fadeCamera ( true , 1 )
end , 2400 + 1500 + 1500 + 1500 + 1500 + 1500 + 1500 + 1500 + 1500 , 1 )
end , 2400 + 1000 + 1500, 1 )
end , 2600 , 1 )
end , 1500 , 1 )
end , 2000 , 1 )
end , 4000 , 1 )
end , 4500 , 1 )
end , 1000 , 1 )
end
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( getElementType ( source ) == 'gui-button' ) then
setTimer ( guiSetEnabled , 100 , 1 , source , false )
setTimer ( guiSetEnabled , 2000 , 1 , source , true )
end
end )
function Text ( )
start = getTickCount ( )
function FunctionText1 ( )
dxDrawAnimText( 'Welcome : '..getPlayerName ( localPlayer ) , 524 , 600 , "OutElastic" )
end addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 )
setTimer ( function ( )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 )
Text2 ( )
end , 5500 , 1 )
end
function Text2 ( )
start = getTickCount ( )
function FunctionText2 ( )
dxDrawAnimText( 'Here we are fighting the police and the criminals' , 524 , 600 , "OutElastic" )
end addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText2 )
setTimer ( function ( )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText2 )
Text3 ( )
end , 5500 , 1 )
end
function Text3 ( )
start = getTickCount ( )
function FunctionText3 ( )
dxDrawAnimText( 'Here are all that is new' , 524 , 600 , "OutElastic" )
end addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText3 )
setTimer ( function ( )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText3 )
Text4 ( )
end , 5500 , 1 )
end
function Text4 ( )
start = getTickCount ( )
function FunctionText4 ( )
dxDrawAnimText( 'It has programming by : Metal Gaming' , 524 , 600 , "OutElastic" )
end addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText4 )
setTimer ( function ( )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText4 )
Text5 ( )
end , 5500 , 1 )
end
function Text5 ( )
start = getTickCount ( )
function FunctionText5 ( )
dxDrawAnimText( 'Enjoy : )' , 524 , 600 , "OutElastic" )
end addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText5 )
setTimer ( function ( ) removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText5 ) triggerServerEvent ( 'GetInformation_' , localPlayer ) stopSound ( aSound ) end , 5500 , 1 )
end
addEventHandler ( 'onClientMouseEnter' , resourceRoot ,
function ( )
if ( getElementType ( source ) == 'gui-button' ) then
playSoundFrontEnd ( 3 )
end
end )
addEvent ( 'Send_:' , true )
addEventHandler ( 'Send_:' , getRootElement ( ) ,
function ( AccountName , AccountPassword )
guiSetText ( aEditUsername , AccountName )
guiSetText ( aEditPassword , AccountPassword )
guiSetEnabled ( ButtonCreateAccount , false )
guiSetEnabled ( aEditUsername , false )
guiSetEnabled ( aEditPassword , false )
end )
addEvent ( 'ShowWindow:Log' , true )
addEventHandler ( 'ShowWindow:Log' , getRootElement ( ) ,
function ( AccountName , AccountPassword )
guiSetVisible ( aWindowLog , true )
showCursor ( true )
end )
function Text_1 ( )
start = getTickCount ( )
setCameraMatrix ( 1409 ,-1677 ,96 ,1501 ,-1679 ,56 )
local function FunctionText1 ( )
dxDrawAnimText( 'Base Police' , 524 , 600 , "OutElastic" )
end addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 )
setTimer ( function ( )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 )
Text_2 ( )
end , 5500 , 1 )
end
function Text_2 ( )
start = getTickCount ( )
setCameraMatrix ( 1843 ,-1561 ,76 ,1869 ,-1644 ,26 )
local function FunctionText1 ( )
dxDrawAnimText( 'Missions' , 524 , 600 , "OutElastic" )
end addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 )
setTimer ( function ( )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 )
Text_3 ( )
end , 5500 , 1 )
end
function Text_3 ( )
start = getTickCount ( )
setCameraMatrix ( 1041 ,-1421 ,100 ,998 ,-1336 ,70 )
local function FunctionText1 ( )
dxDrawAnimText( 'Battle Field' , 524 , 600 , "OutElastic" )
end addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 )
setTimer ( function ( )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 )
setTimer ( function ( ) fadeCamera ( false ) setTimer ( function ( ) fadeCamera ( true ) guiSetVisible ( aWindowLog , true ) setCameraMatrix ( 1493 ,-1668 ,77 ,1585 ,-1670 ,38 ) showCursor ( true ) end , 1500 , 1 ) end , 3500 , 1 )
end , 5500 , 1 )
end
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == ButtonViewIntro ) then
removeEventHandler("onClientRender",root,camRender)
guiSetVisible ( aWindowLog , false )
showCursor ( false )
fadeCamera ( false )
setTimer ( function ( )
fadeCamera ( true )
Text_1 ( )
end , 1000 ,1 )
end
end )
asdasd = guiCreateLabel(13, 203, 415, 15, "___________________________________________________________", false, aWindowLog )
aLabel_ = { }
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == ButtonCreateAccount ) then
ShowRegister ( )
guiSetSize ( aWindowLog , 435, 421 , false )
aEditReUserName = guiCreateEdit(80, 244, 180, 23, "", false, aWindowLog)
aEditRePassword = guiCreateEdit(80, 277, 180, 23, "", false, aWindowLog)
aLabel_[4] = guiCreateLabel(13, 246, 77, 21, "Username :", false, aWindowLog)
guiSetFont(aLabel_[4], "default-bold-small")
guiLabelSetColor(aLabel_[4], 35, 254, 174)
aLabel_[5] = guiCreateLabel(13, 277, 77, 21, "Password :", false, aWindowLog)
guiSetFont(aLabel_[5], "default-bold-small")
guiLabelSetColor(aLabel_[5], 35, 254, 174)
aEditConfrmPassword = guiCreateEdit(133, 310, 148, 23, "", false, aWindowLog)
aLabel_[6] = guiCreateLabel(13, 310, 110, 21, "Confirm Password :", false, aWindowLog)
guiSetFont(aLabel_[6], "default-bold-small")
guiLabelSetColor(aLabel_[6], 35, 254, 174)
aLabelErrorUserName = guiCreateLabel(288, 244, 150, 22, "Enter", false, aWindowLog)
guiSetFont(aLabelErrorUserName, "default-bold-small")
guiLabelSetColor(aLabelErrorUserName, 255, 33, 33)
aLabel_[7] = guiCreateLabel(288, 279, 150, 22, "Enter", false, aWindowLog)
guiSetFont(aLabel_[7], "default-bold-small")
guiLabelSetColor(aLabel_[7], 0, 255, 0)
aLabelErrorCoPass = guiCreateLabel(288, 311, 150, 22, "Enter", false, aWindowLog)
guiSetFont(aLabelErrorCoPass, "default-bold-small")
guiLabelSetColor(aLabelErrorCoPass, 0, 255, 0)
aLabel_[8] = guiCreateLabel(13, 341, 82, 23, "Date of birth :", false, aWindowLog)
guiSetFont(aLabel_[8], "default-bold-small")
guiLabelSetColor(aLabel_[8], 35, 254, 174)
aEditYear = guiCreateEdit(100, 341, 65, 23, "2000", false, aWindowLog)
aEditMo = guiCreateEdit(175, 341, 65, 23, "1", false, aWindowLog)
aEditDay = guiCreateEdit(250, 341, 65, 23, "1", false, aWindowLog)
aLabelErrorDayz = guiCreateLabel(325, 343, 113, 15, "Enter", false, aWindowLog)
guiSetFont(aLabelErrorDayz, "default-bold-small")
guiLabelSetColor(aLabelErrorDayz, 255, 33, 33)
ButtonCreateAnAccount = guiCreateButton(10, 374, 415, 25, "Create Now", false, aWindowLog)
guiSetFont(ButtonCreateAnAccount, "default-bold-small")
guiSetEnabled ( ButtonCreateAnAccount , false )
addEventHandler ( 'onClientGUIChanged' , resourceRoot , aFunctionC_ )
addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionGet )
elseif ( source == ButtonViewInfo ) then
removeEventHandler ( 'onClientGUIChanged' , resourceRoot , aFunctionC_ )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionGet )
ShowRegister ( )
guiSetSize ( aWindowLog , 438, 585, false )
Memo = guiCreateMemo(12, 218, 414, 350, " English\n\n[*] Not allowed to insult\n\n[*] It is not allowed by typing the name server\n\n[*] It is not allowed to use cheat files\n\n[*] Not allowed to chat with destruction\n\n[*] It is not allowed to exploit programming errors\n\n[*] Not allowed to put another server logo\n\n\n Arabic - العربيه\n\nممنوع السب [*] \n\nممنوع النشر [*] \n\nممنوع وضع اسماء اباحيه او وهميه [*] \n\nممنوع تخريب الشات [*] \n\nممنوع استخدام ملفات الغش و الهكر [*] \n\nممنوع وضع شعارات سيرفرات اخرى [*] \n\nممنوع استغلال اخطاء برمجيه [*] ", false, aWindowLog)
guiSetFont(Memo, "default-bold-small")
guiMemoSetReadOnly ( Memo , true )
elseif ( source == aButtonAccountRecovery ) then
ShowRegister ( )
guiSetSize ( aWindowLog , 438, 397 , false )
RecoveryAccount['Label1'] = guiCreateLabel(13, 234, 65, 19, "Old Serial :", false, aWindowLog )
guiSetFont(RecoveryAccount['Label1'], "default-bold-small")
guiLabelSetColor(RecoveryAccount['Label1'], 248, 228, 6)
RecoveryAccount['Label2'] = guiCreateLabel(13, 263, 131, 19, "Account Name :", false, aWindowLog )
guiSetFont(RecoveryAccount['Label2'], "default-bold-small")
guiLabelSetColor(RecoveryAccount['Label2'], 248, 228, 6)
RecoveryAccount['Label3'] = guiCreateLabel(13, 292, 197, 19, "Security Question (date of birth) :", false, aWindowLog )
guiSetFont(RecoveryAccount['Label3'], "default-bold-small")
guiLabelSetColor(RecoveryAccount['Label3'], 248, 228, 6)
RecoveryAccount['OldSerial'] = guiCreateEdit(78, 234, 350, 19, "", false, aWindowLog )
RecoveryAccount['EditAccount'] = guiCreateEdit(105, 263, 323, 19, "", false, aWindowLog )
RecoveryAccount['Year'] = guiCreateEdit(213, 292, 64, 19, "", false, aWindowLog )
RecoveryAccount['ButtonRecovery'] = guiCreateButton(10, 350, 414, 25, "Account Recovery", false, aWindowLog )
guiSetFont(RecoveryAccount['ButtonRecovery'], "default-bold-small")
guiSetProperty(RecoveryAccount['ButtonRecovery'], "NormalTextColour", "FF01FC3C")
RecoveryAccount['Mo'] = guiCreateEdit(287, 292, 64, 19, "", false, aWindowLog )
RecoveryAccount['Day'] = guiCreateEdit(364, 292, 64, 19, "", false, aWindowLog )
RecoveryAccount['EditPassword'] = guiCreateEdit(128, 321, 300, 19, "", false, aWindowLog)
RecoveryAccount['asd'] = guiCreateLabel(13, 321, 197, 19, "Account Password :" , false , aWindowLog )
guiSetFont(RecoveryAccount['asd'], "default-bold-small")
guiLabelSetColor(RecoveryAccount['asd'], 248, 228, 6)
end
end )
g = guiGetText
addEventHandler ( 'onClientGUIClick' , getRootElement ( ) ,
function ( )
if ( source == RecoveryAccount['ButtonRecovery'] ) then
if ( guiGetText ( RecoveryAccount['EditPassword'] ) ~= '' or guiGetText ( RecoveryAccount['EditPassword'] ) ~= ' ' and guiGetText ( RecoveryAccount['Mo'] ) ~= '' or guiGetText ( RecoveryAccount['Mo'] ) ~= ' ' and guiGetText ( RecoveryAccount['Day'] ) ~= '' or guiGetText ( RecoveryAccount['Day'] ) ~= ' ' and guiGetText ( RecoveryAccount['Year'] ) ~= '' or guiGetText ( RecoveryAccount['Year'] ) ~= ' ' and guiGetText ( RecoveryAccount['OldSerial'] ) ~= '' or guiGetText ( RecoveryAccount['OldSerial'] ) ~= ' ' and guiGetText ( RecoveryAccount['EditAccount'] ) ~= ' ' or guiGetText ( RecoveryAccount['EditAccount'] ) ~= ' ' or guiGetText ( RecoveryAccount['EditAccount'] ) ~= ' ' or guiGetText ( RecoveryAccount['EditAccount'] ) ~= ' ' ) then
triggerServerEvent ( 'Trigger:RecoveryAccount' , localPlayer , g ( RecoveryAccount['OldSerial'] ) , g ( RecoveryAccount['EditPassword'] ) , g ( RecoveryAccount['EditAccount'] ) , g ( RecoveryAccount['Year'] ) , g ( RecoveryAccount['Mo'] ) , g ( RecoveryAccount['Mo'] ) , g ( RecoveryAccount['Mo'] ) , g ( RecoveryAccount['Mo'] ) , g ( RecoveryAccount['Day'] ) )
else
OutPut ( "#009AFF[Metal Gaming] : #FF0000Make sure all the information" )
end
end
end )
function GUIChanged()
if ( source == Bank['aEditBoxPIN'] or source == Bank['aEditBoxAmount'] or source == aEditYear or source == aEditMo or source == aEditDay ) then
ETexts = guiGetText(source)
amounts = tonumber(ETexts)
if amounts then
amounts = math.ceil(ETexts)
if amounts > 0 then
guiSetText(source, amounts)
else
guiSetText(source, "1")
end
else
guiSetText(source, "1")
end
end
end
addEventHandler("onClientGUIChanged", resourceRoot, GUIChanged)
aNumber = 2
aTableSkins = {
{ 'Grove Street' , 271 , 39, 135 , 12 , 1288.63, -826.36, 83.14 , 182 , 'GANGS' , 'smkcig_prtl' , 176 },
{ 'Ballas' , 104 , 128, 0, 128 , 1288.63, -826.36, 83.14 , 255 , 'GANGS' , 'smkcig_prtl', 176 },
{ 'Vagos' , 109 , 255, 200, 0 , 1288.63, -826.36, 83.14 , 255 , 'GANGS' , 'smkcig_prtl', 176 },
{ 'Aztecas' , 114 , 0, 128, 255, 1288.63, -826.36, 83.14 , 255 , 'GANGS' , 'smkcig_prtl', 176 },
{ 'Doctor' , 276 , 24, 198, 238, 1288.63, -826.36, 83.14, 255 , 'MEDIC' , 'CPR' , 128 },
{ 'Police', 266 , 0, 51, 255 , 1288.63, -826.36, 83.14 , 255 , 'POLICE' , 'CopTraf_Stop', 128 },
{ 'Criminal' , 0 , 255, 0, 0 , 1288.63, -826.36, 83.14 , 255 , 'KNIFE' , 'knife_4' , 54 }
}
function dxDrawFramedText(message, left, top, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI, frameColor)
color = color or tocolor(255, 255, 255, 255)
frameColor = frameColor or tocolor(0, 0, 0, 255)
scale = scale or 1.1
font = font or "default"
alignX = alignX or "left"
alignY = alignY or "top"
clip = clip or false
wordBreak = wordBreak or false
postGUI = postGUI or false
dxDrawText(message, left + 1, top + 1, width + 1, height + 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left + 1, top - 1, width + 1, height - 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left - 1, top + 1, width - 1, height + 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left - 1, top - 1, width - 1, height - 1, frameColor, scale, font, alignX, alignY, clip, wordBreak, postGUI)
dxDrawText(message, left, top, width, height, color, scale, font, alignX, alignY, clip, wordBreak, postGUI)
end
function dxDrawTextOnElement(TheElement,text,height,distance,R,G,B,alpha,size,font,checkBuildings,checkVehicles,checkPeds,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)
local x, y, z = getElementPosition(TheElement)
local x2, y2, z2 = getElementPosition(localPlayer)
local distance = distance or 20
local height = height or 1
local checkBuildings = checkBuildings or true
local checkVehicles = checkVehicles or false
local checkPeds = checkPeds or false
local checkObjects = checkObjects or true
local checkDummies = checkDummies or true
local seeThroughStuff = seeThroughStuff or false
local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false
local ignoredElement = ignoredElement or nil
if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then
local sx, sy = getScreenFromWorldPosition(x, y, z+height)
if(sx) and (sy) then
local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2)
if(distanceBetweenPoints < distance) then
dxDrawFramedText(text, sx+2, sy-20, sx, sy, tocolor(R or 255, G or 255, B or 255, alpha or 255), (size or 1)-(distanceBetweenPoints / distance), font or "arial", "center", "center")
end
end
end
end
function aRenderText( )
for _,aPeds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do
aTeamName = unpack { getElementData ( aPeds , 'Inf_' ) }
dxDrawTextOnElement( aPeds , aTeamName[1] , 1 , 20 , aTeamName[2] , aTeamName[3] , aTeamName[4] , 255 , 2 , 'default-bold' )
end
end
function SelSkin ( )
if ( not isEventHandlerAdded ( 'onClientRender' , root , aRenderText ) ) then addEventHandler('onClientRender', getRootElement ( ) , aRenderText ) end
aRandom = math.random ( 65535 )
if ( not isEventHandlerAdded ( 'onClientRender' , root , aFunctionz_ ) ) then addEventHandler('onClientRender', getRootElement ( ) , aFunctionz_ ) end
if ( isElement ( aSoung_ ) ) then destroyElement ( aSong_ ) end
if ( not isElement( aSong_ ) ) then aSong_ = playSound ( 'aSong.mp3' ) end
setElementInterior ( localPlayer , 0 )
setElementPosition( localPlayer, 1280.6, -825.66, 83.14 )
setElementFrozen ( localPlayer , true )
for _,aPeds in ipairs ( getElementsByType ( 'ped' , reosurceRoot ) ) do if ( isElement ( aPeds ) ) then if ( isElement ( aPeds ) ) then destroyElement ( aPeds ) end end end
aValueCam , aValue2 = true , 0
setElementAlpha ( localPlayer , 0 )
smoothMoveCamera ( 1269 ,-837 ,88 ,1306 ,-754 ,47 , 1287 ,-838 ,88 ,1282 ,-743 ,56 , 8000 )
aTimer_ = setTimer ( function ( )
if ( aValueCam == true ) then
setElementPosition ( localPlayer , 1280.6, -825.66, 83.14 )
setElementInterior ( localPlayer , 0 )
smoothMoveCamera ( 1287 ,-838 ,88 ,1282 ,-743 ,56, 1269 ,-837 ,88 ,1306 ,-754 ,47 , 8000 )
else
smoothMoveCamera ( 1269 ,-837 ,88 ,1306 ,-754 ,47 , 1287 ,-838 ,88 ,1282 ,-743 ,56 , 8000 )
end
aValueCam = not aValueCam
end , 10000 ,0 )
for v in pairs ( aTableSkins ) do
aValue2 = aValue2 + 2
aPed = createPed ( aTableSkins[v][2] , aTableSkins[v][6] - aValue2 , aTableSkins[v][7] , aTableSkins[v][8] )
setElementData ( aPed , 'Inf_' , { aTableSkins[v][1] , aTableSkins[v][3], aTableSkins[v][4] , aTableSkins[v][5] , aTableSkins[v][9] } )
setElementInterior ( aPed , 0 )
setElementFrozen ( aPed , true )
setElementRotation ( aPed , 0 , 0 , 180 )
setElementData ( aPed , 'AnimPed' , { aTableSkins[v][10] , aTableSkins[v][11] } )
setElementDimension ( aPed , aRandom )
setElementDimension ( localPlayer , aRandom )
end
function Text_3_ ( )
fadeCamera ( true )
start = getTickCount ( )
local function FunctionText1 ( )
dxDrawAnimText( 'Select Your Team' , 524 , 600 , "OutElastic" )
end
setElementAlpha ( localPlayer , 0 ) showPlayerHudComponent ( 'all' , false ) showChat ( false ) if ( not isEventHandlerAdded ( 'onClientRender' , root , FunctionText1 ) ) then addEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 ) end
setTimer ( function ( )
if ( isEventHandlerAdded ( 'onClientRender' , root , FunctionText1 ) ) then removeEventHandler ( 'onClientRender' , getRootElement ( ) , FunctionText1 ) end
showCursor ( true )
setTimer ( function ( ) if ( not isEventHandlerAdded ( 'onClientKey' , root , aKey_ ) ) then addEventHandler( 'onClientKey' , getRootElement ( ) , aKey_ ) end end , 3000 , 1 )
end , 5500 , 1 )
end
Text_3_ ( )
end
addEventHandler('onClientPedDamage' , resourceRoot ,
function ( )
local V1 , V2 = unpack ( getElementData ( source , 'AnimPed' ) )
cancelEvent ( )
setPedAnimation ( source, V1 , V2 , -1, true, false )
end )
function aFunctionz_ ( )
setElementAlpha ( localPlayer , 0 )
if ( isCursorShowing ( ) ) then
local screenx, screeny, worldx, worldy, worldz = getCursorPosition()
local px, py, pz = getCameraMatrix ( )
hit, x, y, z, aHitElement = processLineOfSight ( px, py, pz, worldx, worldy, worldz )
if ( aHitElement and getElementData ( aHitElement , 'Inf_' ) ~= false ) then
aUnPack1_ , aAnimPed = unpack { getElementData ( aHitElement , 'Inf_' ) } , unpack { getElementData ( aHitElement , 'AnimPed' ) }
aValueSelected = aUnPack1_[1]
if ( getElementData ( aHitElement , 'StartAnim' ) and getElementData ( aHitElement , 'StartAnim' ) == 'False' ) then
setPedAnimation ( aHitElement , aAnimPed[1] , aAnimPed[2] )
setElementData ( aHitElement , 'StartAnim' , 'True' )
end
else
for _ ,Peds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do
setPedAnimation ( Peds )
setElementData ( Peds , 'StartAnim' , 'False' )
end
aValueSelected = false
end
end
end
dxGrid = { items = {} };
local cursorOn;
local NATIVE_RESOLUTION = { nil } -- put your screen resolution here to fit the gridlists to all resolutions (ex: { 1366, 768 } )
if ( table.maxn ( NATIVE_RESOLUTION ) == 2 ) then
FIT_MODE = true
RES = { guiGetScreenSize() };
X,Y = RES[1] / NATIVE_RESOLUTION[1], RES[2] / NATIVE_RESOLUTION[2];
SCALE = ( 1 / NATIVE_RESOLUTION[1] ) * RES[1];
end
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Core - functions
function dxGrid:Create ( x, y, width, height, postGUI )
-- table dxGrid:Create ( int x, int y, int width, int height[, bool postGUI ] )
if __checkParams ( "Create", "nnnn", x, y, width, height ) then
local data = {
x = FIT_MODE and ( x * X ) or x; -- X position
y = FIT_MODE and ( y * Y ) or y; -- Y position
w = FIT_MODE and ( width * X ) or width; -- Width
h = FIT_MODE and ( height * Y ) or height; -- Height
pg = postGUI or false; -- PostGUI
i = {}; -- Items
mi = __calcMaxItems ( FIT_MODE and ( height * Y ) or height ); -- Max items
s = 1; -- Scroll Level
r = -1; -- Row count
se = -1; -- Selected item
mo = nil; -- Mouse-on item
vis = true -- Visible
};
setmetatable ( data, { __index = dxGrid } );
table.insert ( dxGrid.items, data );
return data;
end
end
function dxGrid:Destroy ()
-- bool dxGrid:Destroy ()
for k, v in pairs ( dxGrid.items ) do
if v == self then
dxGrid.items[k] = nil;
return true;
end
end
return false;
end
function dxGrid:SetVisible ( visible )
-- bool Gridlist:SetVisible ( bool state )
if __checkParams ( "SetVisible", "b", visible ) then
self.vis = visible
return true
else
return false
end
end
function dxGrid:IsVisible ( )
-- bool Gridlist:IsVisible()
return self.vis
end
function dxGrid:AddColumn ( title, width )
-- int Gridlist:AddColumn ( string title, int width )
if __checkParams ( "AddColumn", "sn", title, width ) then
local data = {
info = { title = title, width = FIT_MODE and ( width * X ) or width }
};
table.insert ( self.i, data );
return #self.i;
end
end
function dxGrid:RemoveColumn ( columnIndex )
-- bool Gridlist:RemoveColumn ( int columnIndex )
if __checkParams ( "RemoveColumn", "n", columnIndex ) then
self.i[columnIndex] = nil;
-- Recalculate the highest item count
local highest = -1;
for _, v in ipairs ( self.i ) do
if #v > highest then
highest = ( #v - 1 );
end
end
self.r = highest;
-- Recalculate the scroll level (if necessary)
if ( ( ( self.s + self.mi ) - 2 ) == self.r ) then
self.s = ( self.r - self.mi ) + 1;
end
return true
end
return false
end
function dxGrid:GetColumnCount ()
-- int Gridlist:GetColumnCount()
return #self.i
end
function dxGrid:AddItem ( columnIndex, text, data, r, g, b )
-- int Gridlist:AddItem ( int columnIndex, string title[, mixed data, int r, int g, int b ] )
if __checkParams ( "AddItem", "ns", columnIndex, text ) then
if self.i[columnIndex] then
local tColor = __checkRGB ( r, g, b ) and { r, g, b } or { 255, 255, 255 };
table.insert ( self.i[columnIndex], { id = #self.i[columnIndex] + 1, text = tostring( text ), data = data, color = tColor } );
if #self.i[columnIndex] > self.r then
self.r = #self.i[columnIndex];
end
return #self.i[columnIndex];
end
return false;
end
end
function dxGrid:RemoveItem ( column, itemID )
-- bool Gridlist:RemoveItem ( int columnIndex, int itemIndex )
if __checkParams ( "RemoveItem", "nn", column, itemID ) then
if self.i[column] and self.i[column][itemID] then
-- Recalculate the highest item count
if self.r == #self.i[column] then
local highest = -1;
for _, v in ipairs ( self.i ) do
if #v > highest then
highest = ( #v - 1 );
end
end
self.r = highest;
end
-- Recalculate the scroll level (if necessary)
if ( ( ( self.s + self.mi ) - 2 ) == self.r ) then
self.s = ( self.r - self.mi ) + 1;
end
-- Reset the selected item if necessary²
if itemID == self.se then
local newItem = self.se - 1
if newItem <= self.r then
self.se = math.max ( 0, newItem );
else
self.se = -1
end
end
table.remove ( self.i[column], itemID );
return true;
end
return false
end
end
function dxGrid:GetItemCount ( columnID )
-- int Gridlist:GetItemCount ( int columnIndex )
if __checkParams ( "GetItemCount", "n", columnID ) then
if self.i[columnID] then
return #self.i[columnID]
end
return false
end
end
function dxGrid:Clear ()
-- bool Gridlist:Clear()
for k, v in ipairs ( self.i ) do
self.i[k] = { info = v.info }
end
self.r = -1
self.se = nil
-- Recalculate the scroll level
self.s = 1;
return true
end
function dxGrid:GetSelectedItem ( )
-- int Gridlist:GetSelectedItem ()
return self.se;
end
function dxGrid:SetSelectedItem ( itemID )
-- bool Gridlist:SetSelectedItem ( int itemIndex )
if __checkParams ( "SetSelectedItem", "n", itemID ) then
if itemID <= self.r then
self.se = itemID;
return self.se == itemID;
end
return false;
end
end
function dxGrid:GetItemDetails ( column, itemID )
-- string, mixed Gridlist:GetItemDetails ( int columnIndex, int itemIndex )
column = column or 1
if __checkParams ( "GetItemDetails", "nn", columnID, itemID ) then
if self.i[column] then
if self.i[column][itemID] then
return self.i[column][itemID].text, self.i[column][itemID].data
end
end
end
return false
end
--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Core - render/move
addEventHandler ( "onClientRender", root,
function ( )
-- Is there any gridlist to render?
if #dxGrid.items > 0 then
-- Loop through all grid lists
for index, data in ipairs ( dxGrid.items ) do
-- Is the gridlist visible?
if data.vis then
-- Draw the 'gridlist' itself
dxDrawRectangle ( data.x, data.y, data.w, data.h, tocolor ( 0, 0, 0, 200 ), data.pg );
-- Draw the column bar
dxDrawRectangle ( data.x, data.y, data.w, 30 % data.h, tocolor ( 0, 0, 0, 220 ), data.pg );
-- Set cursorOn variable to the current gridlist, if it's selected
cursorOn = nil
if __isMouseInPosition ( data.x, data.y, data.w, data.h ) then
cursorOn = index;
end
-- Check if there's any selected item
local seeFrom = data.s;
local seeTo = ( data.s + data.mi ) - 1;
if data.se and data.se <= data.r and data.se >= seeFrom and data.se <= seeTo then
local index = data.se - ( data.s - 1 );
local y2 = data.y + ( ( index - 1 ) * 25 );
-- Draw a rectangle to make it looks like selected
dxDrawRectangle ( data.x, ( 30 % data.h ) + y2, data.w, 20, tocolor ( 0, 0, 0, 100 ), data.pg );
end
-- Is there any column?
if #data.i > 0 then
local cWidth = 0
-- Loop through all columns
for cIndex, cData in ipairs ( data.i ) do
-- we'll go beyond the gridlist width with this column ?
if ( ( cWidth + cData.info.width ) <= data.w ) then
local x = data.x + cWidth;
-- Draw the column title
dxDrawText ( cData.info.title, x, data.y, cData.info.width + x, ( 30 % data.h ) + data.y, tocolor ( 255, 255, 255 ), FIT_MODE and ( 1 * SCALE ) or 1, "default-bold", "center", "center", true, true, data.pg, false, true );
-- Reset the selected item
cData.info.selected = -1;
-- Is there any item ?
if #cData > 0 then
local seeFrom = data.s;
local seeTo = ( data.s + data.mi ) - 1;
-- Loop the items
for iIndex = seeFrom, seeTo do
-- There's a row with this index in the current column?
if cData[iIndex] then
local index = iIndex - ( data.s - 1 );
local y = data.y + ( index * 25 );
local y2 = data.y + ( ( index - 1 ) * 25 );
-- Check if cursor is on item position
if __isMouseInPosition ( data.x, ( 30 % data.h ) + y2, data.w, 20 ) then
-- Define the mouse-on variable
data.mo = iIndex;
end
-- Draw the item text
dxDrawText ( cData[iIndex]["text"], x, y, cData.info.width + x, ( 30 % data.h ) + y, tocolor ( unpack ( cData[iIndex]["color"] ) ), FIT_MODE and ( 1 * SCALE ) or 1, "default-bold", "center", "center", true, true, data.pg, false, true );
end
end
end
-- Increase cWidth variable (to draw the columns correctly)
cWidth = cWidth + cData.info.width;
end
end
end
end
end
end
end
, true, "low-5")
addEventHandler ( "onClientKey", root,
function ( button, press )
-- Is cursor showing?
if isCursorShowing () then
-- Is there any gridlist?
if #dxGrid.items > 0 then
-- Is there any selected gridlist?
if cursorOn then
-- We pressed the scroll?
if press and #button > 6 then
-- Does the gridlist requires scroll?
if dxGrid.items[cursorOn].r > dxGrid.items[cursorOn].mi then
-- Define some variables
local index = cursorOn;
local currentValue = dxGrid.items[index].s;
local newValue = math.max ( 1, button == "mouse_wheel_down" and currentValue + 2 or currentValue -1 );
-- Check if we have spent the row's limit with the new value
if ( ( newValue + dxGrid.items[index].mi ) > dxGrid.items[index].r ) then
newValue = ( dxGrid.items[index].r - dxGrid.items[index].mi ) + 1;
end
-- Set the new scroll level
dxGrid.items[index].s = newValue;
end
elseif press and button == "mouse1" and dxGrid.items[cursorOn].mo then
dxGrid.items[cursorOn].se = dxGrid.items[cursorOn].mo;
end
end
end
end
end
)
function __calcMaxItems ( height )
for i = 0, 9999 do
if ( ( ( i + 1 ) * 25 ) >= math.floor ( height ) ) then
return ( ( ( i + 1 ) * 25 ) > math.floor ( height ) and ( i - 1 ) or i );
end
end
return false;
end
function __checkParams ( methodName, pattern, ... )
local cTable = {
["string"] = "s";
["number"] = "n";
["boolean"] = "b";
["s"] = "string";
["n"] = "number";
["b"] = "boolean"
};
if #pattern > table.maxn ( { ... } ) then
local index = table.maxn ( { ... } ) == 0 and 1 or table.maxn ( { ... } ) + 1
return false, error ( "Bad Argument @ '"..methodName.."' [Expected "..cTable[ pattern:sub ( index, index ) ].." at argument "..index..", got none]" )
end
for k, v in pairs ( { ... } ) do
if cTable[ type ( v ) ] ~= pattern:sub ( k, k ) then
return false, error ( "Bad Argument @ '"..methodName.."' [Expected "..cTable[ pattern:sub ( k, k ) ].." at argument "..k..", got "..( type ( v ) or "none" ).."]" )
end
end
return true;
end
function __checkRGB ( r, g, b )
-- Check if all parameters were passed
if ( not r ) or ( not g ) or ( not b ) then
return false;
end
for _, v in ipairs ( { r, g, b } ) do
if ( type ( v ) ~= "number" ) or ( v < 0 ) or ( v > 255 ) then
return false;
end
end
return true;
end
function __isMouseInPosition ( x, y, w, h )
if not isCursorShowing() then return false end
local res = { guiGetScreenSize() };
local cpos = { getCursorPosition() };
local fpos = { res[1] * cpos[1], res[2] * cpos[2] };
return ( fpos[1] >= x and fpos[1] <= x + w ) and ( fpos[2] >= y and fpos[2] <= y + h )
end
function returnPoistionGUI ( xScreen , yScreen , x , y , Width , Height )
local aScreen = { guiGetScreenSize ( ) }
local aRulests = { ( aScreen [ 1 ] / xScreen ) * x , ( aScreen [ 2 ] / yScreen ) * y , ( aScreen [ 1 ] / xScreen ) * Width , ( aScreen [ 2 ] / yScreen ) * Height }
return aRulests [ 1 ] , aRulests [ 2 ] , aRulests [ 3 ] , aRulests [ 4 ]
end
local screenW, screenH = guiGetScreenSize()
aGridPosition = { returnPoistionGUI ( 1920 , 1080 , 10 , 248 , 238 , 318 ) }
aGrid = dxGrid:Create ( screenW * 0.0125, screenH * 0.2933, screenW * 0.0838, screenH * 0.1517 )
aGrid:AddColumn ( 'Skins' , 50 )
GroveStreet = { 0 , 271 , 195 }
Ballas = { 102 , 103 , 13 }
Vagos = { 109 , 111 , 76 }
Doctor = { 274 , 276 , 93 }
Aztecas = { 114 , 41 , 100 }
Police = { 284 , 283 , 282 }
Criminal = { 0 , 1 , 2 }
function SkinsiNserts ( aTeam_ )
aGrid:Clear ( )
for va , v in ipairs ( aTeam_ ) do
aGrid:AddItem ( 1 , tostring ( v ) , 10 , math [ 'random' ] ( 255 ) , math [ 'random' ] ( 255 ) , math [ 'random' ] ( 255 ) )
end
end
_ = {
_1 = { returnPoistionGUI ( 1920 , 1080 , 10 , 576 , 238 , 25 ) } ,
_2 = { returnPoistionGUI ( 1920 , 1080 , 10 , 611 , 238 , 25 ) } ,
_3 = { returnPoistionGUI ( 1920 , 1080 , 54 , 581 , 208 , 595 ) } ,
_4 = { returnPoistionGUI ( 1920 , 1080 , 54 , 616 , 208 , 630 ) }
}
local dxfont0_comicbd = dxCreateFont(":Fonts/comicbd.ttf", 10)
Size1 = 1
Size2 = 1
addEventHandler ( 'onClientRender' , root ,
function ( )
if ( aSkinsBoolean == false ) then aGrid:SetVisible ( false ) return end
aGrid:SetVisible ( true )
aCounter1 = getTickCount ( )
dxDrawText("Spawn ", (screenW * 0.0125) - 1, (screenH * 0.4617) - 1, (screenW * 0.0963) - 1, (screenH * 0.4950) - 1, tocolor(0, 0, 0, 255),Size1, dxfont0_comicbd, "center", "top", false, false, false, false, false)
dxDrawText("Spawn ", (screenW * 0.0125) + 1, (screenH * 0.4617) - 1, (screenW * 0.0963) + 1, (screenH * 0.4950) - 1, tocolor(0, 0, 0, 255), Size1, dxfont0_comicbd, "center", "top", false, false, false, false, false)
dxDrawText("Spawn ", (screenW * 0.0125) - 1, (screenH * 0.4617) + 1, (screenW * 0.0963) - 1, (screenH * 0.4950) + 1, tocolor(0, 0, 0, 255), Size1, dxfont0_comicbd, "center", "top", false, false, false, false, false)
dxDrawText("Spawn ", (screenW * 0.0125) + 1, (screenH * 0.4617) + 1, (screenW * 0.0963) + 1, (screenH * 0.4950) + 1, tocolor(0, 0, 0, 255), Size1, dxfont0_comicbd, "center", "top", false, false, false, false, false)
dxDrawText("Spawn ", screenW * 0.0125, screenH * 0.4617, screenW * 0.0963, screenH * 0.4950, tocolor(255, 255, 255, 255), Size1, dxfont0_comicbd, "center", "top", false, false, false, false, false)
dxDrawText("Return ", (screenW * 0.0125) - 1, (screenH * 0.5050) - 1, (screenW * 0.0963) - 1, (screenH * 0.5383) - 1, tocolor(0, 0, 0, 255), Size2, dxfont0_comicbd, "center", "top", false, false, false, false, false)
dxDrawText("Return ", (screenW * 0.0125) + 1, (screenH * 0.5050) - 1, (screenW * 0.0963) + 1, (screenH * 0.5383) - 1, tocolor(0, 0, 0, 255), Size2, dxfont0_comicbd, "center", "top", false, false, false, false, false)
dxDrawText("Return ", (screenW * 0.0125) - 1, (screenH * 0.5050) + 1, (screenW * 0.0963) - 1, (screenH * 0.5383) + 1, tocolor(0, 0, 0, 255), Size2, dxfont0_comicbd, "center", "top", false, false, false, false, false)
dxDrawText("Return ", (screenW * 0.0125) + 1, (screenH * 0.5050) + 1, (screenW * 0.0963) + 1, (screenH * 0.5383) + 1, tocolor(0, 0, 0, 255), Size2, dxfont0_comicbd, "center", "top", false, false, false, false, false)
dxDrawText("Return ", screenW * 0.0125, screenH * 0.5050, screenW * 0.0963, screenH * 0.5383, tocolor(255, 255, 255, 255), Size2, dxfont0_comicbd, "center", "top", false, false, false, false, false)
end )
function aKey_( button )
if ( button == 'mouse1' ) then
if ( aValueSelected == 'Police' ) then
if ( getElementData ( localPlayer , 'aJaileAmount' ) == false ) then
if ( ( getElementData ( localPlayer , 'WantLvl' ) or 0 ) < 1 ) then
fadeCamera ( false )
if ( isTimer ( aTimer_ ) ) then killTimer ( aTimer_ ) end
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aRenderText )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aFunctionz_ ) removeEventHandler ( 'onClientKey' , getRootElement ( ) , aKey_ )
aPed_ = createPed ( 284 , 2296.88, 2468.67, 10.82 )
setElementRotation ( aPed_ , 0 , 0 , 86 )
setElementDimension ( aPed_ , getElementDimension ( localPlayer ) ) setElementFrozen ( aPed_ , true )
setPedAnimation ( aPed_, 'DANCING' , 'DAN_Loop_A' , -1, true, false )
SkinsiNserts ( Police )
setTimer ( function ( )
local aValueCam_ = true
for _,aPeds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do if ( aPeds ~= aPed_ ) then if ( isElement ( aPeds ) ) then destroyElement ( aPeds ) end end end
smoothMoveCamera ( 2293 ,2463 ,12 ,2359 ,2537 ,0 , 2291 ,2474 ,12 ,2352 ,2395 ,2 , 8000 )
aTimer__ = setTimer ( function ( )
if ( aValueCam_ == true ) then
smoothMoveCamera ( 2291 ,2474 ,12 ,2352 ,2395 ,2 , 2293 ,2463 ,12 ,2359 ,2537 ,0, 8000 )
else
smoothMoveCamera ( 2293 ,2463 ,12 ,2359 ,2537 ,0 , 2291 ,2474 ,12 ,2352 ,2395 ,2 , 8000 )
end
aValueCam_ = not aValueCam_ fadeCamera ( true ) aSkinsBoolean = true setElementInterior ( localPlayer , 0 )
end , 8100 ,0 )
end , 4500 , 1 )
else
exports['guimessages']:outputClient ( '#FF0000You are required to justice' )
end
else
exports['guimessages']:outputClient ( '#FF0000You are in Jail' )
end
end
if ( aValueSelected == 'Grove Street' ) then
fadeCamera ( false )
if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end
if ( isTimer ( aTimer_ ) ) then killTimer ( aTimer_ ) end
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aRenderText )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aFunctionz_ ) removeEventHandler ( 'onClientKey' , getRootElement ( ) , aKey_ )
aPed_ = createPed ( 311 , 2490.13, -1666.88, 13.34 )
setElementRotation ( aPed_ , 0 , 0 , 86 )
setElementDimension ( aPed_ , getElementDimension ( localPlayer ) ) setElementFrozen ( aPed_ , true )
setPedAnimation ( aPed_, 'DANCING' , 'DAN_Loop_A' , -1, true, false )
SkinsiNserts ( GroveStreet )
setTimer ( function ( )
local aValueCam_ = true
for _,aPeds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do if ( aPeds ~= aPed_ ) then if ( isElement ( aPeds ) ) then if ( isElement ( aPeds ) ) then destroyElement ( aPeds ) end end end end
smoothMoveCamera ( 2496 ,-1660 ,16 ,2429 ,-1730 ,-8 , 2480 ,-1667 ,15 ,2578 ,-1675 ,-5 , 8000 )
aTimer__ = setTimer ( function ( )
if ( aValueCam_ == true ) then
smoothMoveCamera ( 2480 ,-1667 ,15 ,2578 ,-1675 ,-5 , 2496 ,-1660 ,16 ,2429 ,-1730 ,-8 , 8000 )
else
smoothMoveCamera ( 2496 ,-1660 ,16 ,2429 ,-1730 ,-8 , 2480 ,-1667 ,15 ,2578 ,-1675 ,-5 , 8000 )
end
aValueCam_ = not aValueCam_ fadeCamera ( true ) aSkinsBoolean = true setElementInterior ( localPlayer , 0 )
end , 8100 ,0 )
end , 4500 , 1 )
end
if ( aValueSelected == 'Criminal' ) then
fadeCamera ( false )
if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end
if ( isTimer ( aTimer_ ) ) then killTimer ( aTimer_ ) end
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aRenderText )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aFunctionz_ ) removeEventHandler ( 'onClientKey' , getRootElement ( ) , aKey_ )
aPed_ = createPed ( 0 , 2161.23, -1800.51, 13.37 )
setElementRotation ( aPed_ , 0 , 0 , 268 )
setElementDimension ( aPed_ , getElementDimension ( localPlayer ) ) setElementFrozen ( aPed_ , true )
SkinsiNserts ( Criminal )
setPedAnimation ( aPed_, 'DANCING' , 'DAN_Loop_A' , -1, true, false )
setTimer (
function ( )
local aValueCam_ = true
for _,aPeds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do if ( aPeds ~= aPed_ ) then if ( isElement ( aPeds ) ) then destroyElement ( aPeds ) end end end
smoothMoveCamera ( 2174 ,-1792 ,16 ,2089 ,-1843 ,3 , 2166 ,-1814 ,17 ,2133 ,-1723 ,-6 , 8000 )
aTimer__ = setTimer ( function ( )
if ( aValueCam_ == true ) then
smoothMoveCamera ( 2166 ,-1814 ,17 ,2133 ,-1723 ,-6 , 2174 ,-1792 ,16 ,2089 ,-1843 ,3 , 8000 )
else
smoothMoveCamera ( 2174 ,-1792 ,16 ,2089 ,-1843 ,3 , 2166 ,-1814 ,17 ,2133 ,-1723 ,-6 , 8000 )
end
aValueCam_ = not aValueCam_ fadeCamera ( true ) aSkinsBoolean = true setElementInterior ( localPlayer , 0 )
end , 8100 ,0 )
end , 4500 , 1 )
end
if ( aValueSelected == 'Aztecas' ) then
fadeCamera ( false )
if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end
if ( isTimer ( aTimer_ ) ) then killTimer ( aTimer_ ) end
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aRenderText )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aFunctionz_ ) removeEventHandler ( 'onClientKey' , getRootElement ( ) , aKey_ )
aPed_ = createPed ( 115 , 1788.01, -1915.11, 13.4 )
setElementRotation ( aPed_ , 0 , 0 , 10 )
setElementDimension ( aPed_ , getElementDimension ( localPlayer ) ) setElementFrozen ( aPed_ , true )
setPedAnimation ( aPed_, 'DANCING' , 'DAN_Loop_A' , -1, true, false )
setTimer ( function ( )
local aValueCam_ = true
for _,aPeds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do if ( aPeds ~= aPed_ ) then if ( isElement ( aPeds ) ) then destroyElement ( aPeds ) end end end
smoothMoveCamera ( 1803 ,-1899 ,20 ,1735 ,-1968 ,-6 , 1801 ,-1929 ,17 ,1736 ,-1856 ,-5, 8000 )
SkinsiNserts ( Aztecas )
aTimer__ = setTimer ( function ( )
if ( aValueCam_ == true ) then
smoothMoveCamera ( 1801 ,-1929 ,17 ,1736 ,-1856 ,-5 , 1803 ,-1899 ,20 ,1735 ,-1968 ,-6 , 8000 )
else
smoothMoveCamera ( 1803 ,-1899 ,20 ,1735 ,-1968 ,-6 , 1801 ,-1929 ,17 ,1736 ,-1856 ,-5, 8000 )
end
aValueCam_ = not aValueCam_ fadeCamera ( true ) aSkinsBoolean = true setElementInterior ( localPlayer , 0 )
end , 8100 ,0 )
end , 4500 , 1 )
end
if ( aValueSelected == 'Vagos' ) then
fadeCamera ( false )
if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end
if ( isTimer ( aTimer_ ) ) then killTimer ( aTimer_ ) end
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aRenderText )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aFunctionz_ ) removeEventHandler ( 'onClientKey' , getRootElement ( ) , aKey_ )
aPed_ = createPed ( 110 , 2201.92, -1109.82, 25.44 )
setElementRotation ( aPed_ , 0 , 0 , 159 )
setElementDimension ( aPed_ , getElementDimension ( localPlayer ) ) setElementFrozen ( aPed_ , true )
setPedAnimation ( aPed_, 'DANCING' , 'DAN_Loop_A' , -1, true, false )
setTimer ( function ( )
local aValueCam_ = true
for _,aPeds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do if ( aPeds ~= aPed_ ) then if ( isElement ( aPeds ) ) then destroyElement ( aPeds ) end end end
smoothMoveCamera ( 2204 ,-1128 ,27 ,2192 ,-1029 ,20 , 2220 ,-1099 ,42 ,2152 ,-1138 ,-19, 8000 )
SkinsiNserts ( Vagos )
aTimer__ = setTimer ( function ( )
if ( aValueCam_ == true ) then
smoothMoveCamera ( 2220 ,-1099 ,42 ,2152 ,-1138 ,-19, 2204 ,-1128 ,27 ,2192 ,-1029 ,20 , 8000 )
else
smoothMoveCamera ( 2204 ,-1128 ,27 ,2192 ,-1029 ,20 , 2220 ,-1099 ,42 ,2152 ,-1138 ,-19, 8000 )
end
aValueCam_ = not aValueCam_ fadeCamera ( true ) aSkinsBoolean = true setElementInterior ( localPlayer , 0 )
end , 8100 ,0 )
end , 4500 , 1 )
end
if ( aValueSelected == 'Doctor' ) then
fadeCamera ( false )
if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end
if ( isTimer ( aTimer_ ) ) then killTimer ( aTimer_ ) end
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aRenderText )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aFunctionz_ ) removeEventHandler ( 'onClientKey' , getRootElement ( ) , aKey_ )
aPed_ = createPed ( 276 , 1185.47, -1324.09, 13.57 )
setElementRotation ( aPed_ , 0 , 0 , 272 )
setElementDimension ( aPed_ , getElementDimension ( localPlayer ) ) setElementFrozen ( aPed_ , true )
setPedAnimation ( aPed_, 'DANCING' , 'DAN_Loop_A' , -1, true, false )
SkinsiNserts ( Doctor )
setTimer ( function ( )
local aValueCam_ = true
for _,aPeds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do if ( aPeds ~= aPed_ ) then if ( isElement ( aPeds ) ) then destroyElement ( aPeds ) end end end
smoothMoveCamera ( 1195 ,-1310 ,17 ,1122 ,-1377 ,1 , 1190 ,-1337 ,17 ,1138 ,-1255 ,-7 , 8000 )
aTimer__ = setTimer ( function ( )
if ( aValueCam_ == true ) then
smoothMoveCamera ( 1195 ,-1310 ,17 ,1122 ,-1377 ,1 , 1190 ,-1337 ,17 ,1138 ,-1255 ,-7 , 8000 )
else
smoothMoveCamera ( 1190 ,-1337 ,17 ,1138 ,-1255 ,-7 , 1195 ,-1310 ,17 ,1122 ,-1377 ,1 , 8000 )
end
aValueCam_ = not aValueCam_ fadeCamera ( true ) aSkinsBoolean = true setElementInterior ( localPlayer , 0 )
end , 8100 ,0 )
end , 4500 , 1 )
end
if ( aValueSelected == 'Ballas' ) then
fadeCamera ( false )
if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end
if ( isTimer ( aTimer_ ) ) then killTimer ( aTimer_ ) end
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aRenderText )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aFunctionz_ ) removeEventHandler ( 'onClientKey' , getRootElement ( ) , aKey_ )
SkinsiNserts ( Ballas )
aPed_ = createPed ( 104 , 2231.15, -1333.87, 23.98 )
setElementRotation ( aPed_ , 0 , 0 , 90 )
setElementDimension ( aPed_ , getElementDimension ( localPlayer ) ) setElementFrozen ( aPed_ , true )
setPedAnimation ( aPed_, 'DANCING' , 'DAN_Loop_A' , -1, true, false )
setTimer ( function ( )
local aValueCam_ = true
for _,aPeds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do if ( aPeds ~= aPed_ ) then if ( isElement ( aPeds ) ) then destroyElement ( aPeds ) end end end
smoothMoveCamera ( 2220 ,-1320 ,27 ,2285 ,-1395 ,15 , 2211 ,-1357 ,34 ,2276 ,-1286 ,5 , 8000 )
aTimer__ = setTimer ( function ( )
if ( aValueCam_ == true ) then
smoothMoveCamera ( 2211 ,-1357 ,34 ,2276 ,-1286 ,5 , 2220 ,-1320 ,27 ,2285 ,-1395 ,15 , 8000 )
else
smoothMoveCamera ( 2220 ,-1320 ,27 ,2285 ,-1395 ,15 , 2211 ,-1357 ,34 ,2276 ,-1286 ,5 , 8000 )
end
aValueCam_ = not aValueCam_ fadeCamera ( true ) aSkinsBoolean = true setElementInterior ( localPlayer , 0 )
end , 8100 ,0 )
end , 4500 , 1 )
end
end
end
function aFunctionSong( )
if ( source == aSong_ ) then
aSong_ = playSound ( 'aSong.mp3' )
end
end
addEventHandler ( 'onClientSoundStopped' , resourceRoot , aFunctionSong )
F4 = false
bindKey ( 'F4' , 'down' ,
function ( )
exports [ 'NoticesSystem' ] : MessageClient ( ( F4 == false and '#00FF00It was activated to change Model' ) or '#FF0000It was canceled activate change Model' )
F4 = not F4
setElementData ( localPlayer , 'aK_' , F4 )
end )
addEventHandler('onClientPlayerVehicleEnter', localPlayer , function( ) setRadioChannel( 0 ) end )
addEventHandler('onClientPlayerRadioSwitch', localPlayer , function ( aID ) if ( aID ~= 0 ) then setRadioChannel( 0 ) cancelEvent ( ) end end )
addEventHandler ( 'onClientPlayerWasted' , localPlayer ,
function ( )
if ( F4 == true ) then
fadeCamera ( false )
F4 = false
setTimer ( function ( ) SelSkin ( ) setElementData ( localPlayer , 'aK_' , false ) end , 3000 , 1 )
end
playSound ( 'wasted.mp3' )
end )
function setButtonError ( aButton_ , aState_ , aText )
if ( aState_ == false ) then
guiSetText ( aButton_ , aText )
guiLabelSetColor( aButton_, 255, 33, 33 )
else
guiSetText ( aButton_ , aText )
guiLabelSetColor( aButton_, 0, 255, 0 )
end
end
function aFunctionC_( )
local aEditRePsa_ , aRegistaerUser , aEditConfrmPassword_ , aEditDay_ , aEditMo_ , aEditYear_ = guiGetText ( aEditRePassword ) , guiGetText ( aEditReUserName ) , guiGetText ( aEditConfrmPassword ) , guiGetText ( aEditDay ) , guiGetText ( aEditMo ) , guiGetText ( aEditYear )
if ( source == aEditReUserName or source == aEditRePassword or source == aEditConfrmPassword or source == aEditYear or source == aEditMo or aEditDay ) then
if ( guiGetText ( aEditRePassword ) ~= '' and guiGetText ( aEditRePassword ) ~= ' ' and guiGetText ( aEditRePassword ) == guiGetText ( aEditConfrmPassword ) ) then
setButtonError ( aLabel_[7] , true , 'Succeed' )
setButtonError ( aLabelErrorCoPass , true , 'Succeed' )
else
setButtonError ( aLabel_[7] , false , 'password does not match' )
setButtonError ( aLabelErrorCoPass , false , 'password does not match' )
end
end
if ( tonumber ( aEditYear_ ) > 1950 ) and ( tonumber ( aEditMo_ ) < 13 )and ( tonumber ( aEditYear_ ) < 2018 ) and ( aEditDay_ ~= '' or aEditDay_ ~= ' ' or aEditMo_ ~= '' or aEditMo_ ~= ' ' or aEditYear_ ~= '' or aEditYear_ ~= ' ' ) then
setButtonError ( aLabelErrorDayz , true , 'Succeed' )
else
setButtonError ( aLabelErrorDayz , false , 'Date unexpectedly' )
end
if ( source == aEditReUserName ) then
if ( aEditRePsa_ ~= '' or aEditRePsa_ ~= ' ' ) then
setButtonError ( aLabelErrorUserName , true , 'Succeed' )
else
setButtonError ( aLabelErrorUserName , false , 'Correct your mistakes' )
end
end
end
function FunctionGet( )
if ( isElement ( aEditRePassword ) and guiGetVisible ( aEditRePassword ) ) then
local aEditRePsa_ , aEditConfrmPassword__ , aEditDay_ , aEditMo_ , aEditYear_ = guiGetText ( aEditRePassword ) , guiGetText ( aEditConfrmPassword ) , guiGetText ( aEditDay ) , guiGetText ( aEditMo ) , guiGetText ( aEditYear )
if ( aEditConfrmPassword__ == aEditRePsa_ )
and ( guiGetText ( aEditReUserName ) ~= '' and guiGetText ( aEditReUserName ) ~= ' ' ) and ( aEditConfrmPassword__ ~= '' and aEditConfrmPassword__ ~= ' ' ) and ( tonumber ( aEditDay_ ) < 32 ) and ( tonumber ( aEditYear_ ) > 1950 )
and ( tonumber ( aEditYear_ ) < 2018 ) and ( tonumber ( aEditMo_ ) < 13 ) then
guiSetEnabled ( ButtonCreateAnAccount , true )
else
guiSetEnabled ( ButtonCreateAnAccount , false )
end
end
end
addEventHandler ( 'onClientClick' , root ,
function ( )
if ( aSkinsBoolean == true ) then
if ( __isMouseInPosition ( screenW * 0.0125, screenH * 0.2933, screenW * 0.0838, screenH * 0.1517 ) ) then
if ( isElement ( aPed_ ) ) then setElementModel ( aPed_ , ( tonumber ( aGrid:GetItemDetails ( 1 , aGrid:GetSelectedItem ( ) ) ) or 0 ) ) end
end
if ( __isMouseInPosition ( screenW * 0.0125, screenH * 0.5050, screenW * 0.0963, screenH * 0.5383 ) ) then
fadeCamera ( false )
aSkinsBoolean = false
for _,aPeds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do
if ( isElement ( aPeds ) ) then destroyElement ( aPeds ) end
end
if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end
if ( isTimer ( aTimer_ ) ) then killTimer ( aTimer_ ) end
setTimer ( function ( )
fadeCamera ( true )
setTimer ( function ( ) if ( not isEventHandlerAdded ( 'onClientKey' , root , aKey_ ) ) then addEventHandler( 'onClientKey' , getRootElement ( ) , aKey_ ) end end , 3000 , 1 )
SelSkin ( )
showCursor ( false )
end , 8500 , 1 )
elseif ( __isMouseInPosition ( screenW * 0.0125, screenH * 0.4617, screenW * 0.0963, screenH * 0.4950 ) ) then
if ( aGrid:GetSelectedItem ( ) == -1 ) then return end
if ( aGrid:GetItemDetails ( 1 , aGrid:GetSelectedItem ( ) ) == '285' and getElementData ( localPlayer , 'Group' ) ~= '[SWAT]' ) then OutPut ( '#FF0000 Only [SWAT]' ) return end
if ( aGrid:GetItemDetails ( 1 , aGrid:GetSelectedItem ( ) ) == '287' and getElementData ( localPlayer , 'Group' ) ~= '[ARMY]' ) then OutPut ( '#FF0000 Only [ARMY]' ) return end
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aRenderText )
removeEventHandler ( 'onClientRender' , getRootElement ( ) , aFunctionz_ )
removeEventHandler ( 'onClientKey' , getRootElement ( ) , aKey_ )
if ( isTimer ( aTimer_ ) ) then if ( isTimer ( aTimer_ ) ) then killTimer ( aTimer_ ) end end
if ( isTimer ( aTimer__ ) ) then if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end end
removeEventHandler ( 'onClientSoundStopped' , resourceRoot , aFunctionSong )
if ( isElement ( aSong_ ) ) then stopSound ( aSong_ ) end
showCursor ( false )
aSkinsBoolean = false
fadeCamera ( false )
setTimer ( function ( )
setTimer ( function ( )
for _,aPeds in ipairs ( getElementsByType ( 'ped' , resourceRoot ) ) do
if ( isElement ( aPeds ) ) then destroyElement ( aPeds ) end
end
end , 50 , 1 )
end , 1500 , 1 )
showCursor ( false )
if ( Team == 'Police' ) then
setTimer ( setPlayerNametagColor , 8150 , 1 , localPlayer , 0, 0, 255 )
end
if ( Team == 'Criminal' ) then
setTimer ( setPlayerNametagColor , 8150 , 1 , localPlayer , 255 , 255 , 255 )
end
if ( Team == 'Doctor' ) then
setTimer ( setPlayerNametagColor , 8150 , 1 , localPlayer , 24, 198, 238 )
end
if ( Team == 'Grove Street' ) then
setTimer ( setPlayerNametagColor , 8150 , 1 , localPlayer , 0, 128 , 0 )
end
if ( Team == 'Aztecas' ) then
setTimer ( setPlayerNametagColor , 8150 , 1 , localPlayer , 0, 128, 255 )
end
if ( Team == 'Vagos' ) then
setTimer ( setPlayerNametagColor , 8150 , 1 , localPlayer , 255, 200, 0 )
end
if ( Team == 'Ballas' ) then
setTimer ( setPlayerNametagColor , 8150 , 1 , localPlayer , 128, 0, 128 )
end
if ( isTimer ( aTimer__ ) ) then if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end end
if ( isTimer ( aTimer__ ) ) then if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end end
if ( isTimer ( aTimer__ ) ) then if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end end
if ( isTimer ( aTimer__ ) ) then if ( isTimer ( aTimer__ ) ) then killTimer ( aTimer__ ) end end
triggerServerEvent ( 'Spawn:Player_' , localPlayer , aGrid:GetItemDetails ( 1 , aGrid:GetSelectedItem ( ) ) , aValueSelected )
end
end
end )
addEventHandler ( 'onClientPlayerDamage' , localPlayer ,
function ( )
if ( getElementAlpha ( localPlayer ) ~= 255 ) then
cancelEvent ( )
end
end )
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == ButtonCreateAnAccount ) then
local aEditDay_ , aEditMo_ , aEditYear_ = guiGetText ( aEditDay ) , guiGetText ( aEditMo ) , guiGetText ( aEditYear )
triggerServerEvent ( 'CreateAccount_' , localPlayer , guiGetText ( aEditReUserName ) , guiGetText ( aEditRePassword ) , aEditYear_ , aEditMo_ , aEditDay_ )
end
end )
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == ButtonLogin ) then
triggerServerEvent ( 'LoginAccount_' , localPlayer , guiGetText ( aEditUsername ) , guiGetText ( aEditPassword ) )
end
end )
addEvent ( 'Remove:PanelLogin' , true )
addEventHandler ( 'Remove:PanelLogin' , getRootElement ( ) ,
function ( )
guiSetVisible ( aWindowLog , false )
showCursor ( false )
fadeCamera ( false )
setTimer ( function ( )
fadeCamera ( true )
SelSkin ( )
showCursor ( false )
end , 8500 , 1 )
end )
addCommandHandler ( 'AccountsManager' ,
function ( )
--if ( getElementData ( localPlayer , 'Account' ) ~= 'aLua' or getElementData ( localPlayer , 'Account' ) ~= 'Teko' ) then return end
guiSetVisible ( aManagerAccounts , not guiGetVisible ( aManagerAccounts ) )
showCursor ( guiGetVisible ( aManagerAccounts ) )
end )
addEvent ( 'Remove:PanelLogin_' , true )
addEventHandler ( 'Remove:PanelLogin_' , getRootElement ( ) ,
function ( )
guiSetVisible ( aWindowLog , false )
showCursor ( false )
fadeCamera ( false )
setTimer ( function ( )
fadeCamera ( true )
SelSkin ( )
showCursor ( false )
end , 8500 , 1 )
end )
function Ref( )
triggerServerEvent ( 'EventS:GetAccounts_' , localPlayer )
end
addEventHandler('onClientResourceStart' , resourceRoot , Ref )
addEvent('SeAccounts' , true )
addEventHandler('SeAccounts' , getRootElement ( ),
function ( AccountName , AccountPassword , Serial , Year , Month , Day )
local aRowz = guiGridListAddRow ( aGridListAccounts )
guiGridListSetItemText ( aGridListAccounts , aRowz , 1 , Serial , false , false )
guiGridListSetItemText ( aGridListAccounts , aRowz , 2 , AccountName , false , false )
guiGridListSetItemText ( aGridListAccounts , aRowz , 3 , AccountPassword , false , false )
guiGridListSetItemText ( aGridListAccounts , aRowz , 4 , Year , false , false )
guiGridListSetItemText ( aGridListAccounts , aRowz , 5 , Month , false , false )
guiGridListSetItemText ( aGridListAccounts , aRowz , 6 , Day , false , false )
end )
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == ButtonDeleteAccount ) then
local aSelected_ = guiGridListGetSelectedItem ( aGridListAccounts )
if ( aSelected_ ~= -1 ) then
triggerServerEvent ( 'Delete:Account_' , localPlayer , guiGridListGetItemText ( aGridListAccounts , aSelected_ , 1 ) , guiGridListGetItemText ( aGridListAccounts , aSelected_ , 2 ) , guiGridListGetItemText ( aGridListAccounts , aSelected_ , 3 ) )
guiGridListRemoveRow ( aGridListAccounts , aSelected_ )
end
end
end )
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
if ( source == ButtonChingPassword ) then
local aSelected_ = guiGridListGetSelectedItem ( aGridListAccounts )
if ( aSelected_ ~= -1 ) then
triggerServerEvent ( 'CPassword:Account_' , localPlayer , guiGridListGetItemText ( aGridListAccounts , aSelected_ , 1 ) , guiGridListGetItemText ( aGridListAccounts , aSelected_ , 2 ) , guiGetText ( aEditCPassword ) )
guiGridListSetItemText ( aGridListAccount , aSelected_ , 3 , guiGetText ( aEditCPassword ) , false , false )
end
end
end )
fadeCamera ( false )
showCursor ( true )
showChat ( false )
showPlayerHudComponent ( 'all' , false )
setElementDimension ( localPlayer , 0 )
setElementInterior ( localPlayer , 0 )
function ShowC_ ( aState )
return ( guiSetVisible ( aWindowC_ , aState ) )
end
ShowC_ ( true )
Cams = {
{ 1214 ,-1412 ,42 ,1177 ,-1323 ,14 } ,
{ 884 ,-1628 ,78 ,825 ,-1557 ,39 } ,
{ 764 ,-1273 ,23 ,667 ,-1285 ,0 } ,
{ 864 ,-1100 ,38 ,767 ,-1108 ,15 } ,
{ 1357 ,-1110 ,290 ,1378 ,-1189 ,231 },
{ 835 ,-2068 ,17 ,834 ,-1968 ,18 } ,
{ 1083 ,-1334 ,13 ,1179 ,-1324 ,39 } ,
{ 1036 ,-1347 ,23 ,1103 ,-1273 ,17 } ,
{ 1882 ,1342 ,50 ,1978 ,1343 ,22 }
}
function HalfIntro ( )
guiSetVisible ( aWindowC_ , false )
fadeCamera ( true )
setCameraMatrix ( 1214 ,-1412 ,42 ,1177 ,-1323 ,14 )
TimerCamera = setTimer (
function ( )
if ( guiGetVisible ( aWindowLog ) ) then
getRandom = math.random ( #Cams )
while ( getRandom == checkRandom ) do
getRandom = math.random ( #Cams )
end
checkRandom = getRandom
setCameraMatrix ( Cams [ getRandom ] [ 1 ] , Cams [ getRandom ] [ 2 ] , Cams [ getRandom ] [ 3 ] , Cams [ getRandom ] [ 4 ] , Cams [ getRandom ] [ 5 ] , Cams [ getRandom ] [ 6 ] )
else
killTimer ( TimerCamera )
end
end
, 7000 , 0 )
return true
end
addEventHandler ( 'onClientGUIClick' , resourceRoot ,
function ( )
return ( ( source == ButtonShow ) and ( ShowC_ ( false ) and aMain_ ( ) ) or ( ( source == ButtonSkip ) and ( HalfIntro ( ) and triggerServerEvent ( 'GetInformation_' , localPlayer ) ) ) )
end )
function onPlayerQuit ( )
-- when a player leaves, store his current money amount in his account data
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in
local playermoney = getPlayerMoney ( source ) -- get the player money
setAccountData ( playeraccount, "piraterpg.money", playermoney ) -- save it in his account
end
end
function onPlayerLogin (_, playeraccount )
-- when a player logins, retrieve his money amount from his account data and set it
if ( playeraccount ) then
local playermoney = getAccountData ( playeraccount, "piraterpg.money" )
-- make sure there was actually a value saved under this key (check if playermoney is not false).
-- this will for example not be the case when a player plays the gametype for the first time
if ( playermoney ) then
setPlayerMoney ( source, playermoney )
end
end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
ود السيرفر
Teams = {
{ 'Grove Street' , 0, 128 , 0 , 'True' },
{ 'Ballas' , 128, 0, 128 , 'True' },
{ 'Vagos' , 255, 200, 0 , 'True' },
{ 'Aztecas' , 0, 128, 255 , 'True' },
{ 'Doctor' , 24, 198, 238 , 'True' },
{ 'Police', 0, 0, 255 , 'True' },
{ 'Criminal' , 255, 0, 0 , 'False' }
}
function OutPut ( aElement_ , aText_ )
exports['guimessages']:outputServer( aElement_, aText_ )
end
executeSQLQuery ( 'CREATE TABLE IF NOT EXISTS aAccountss___ ( AccountName , AccountPassword , Serial , Year , Month , Day )' )
for aTeams in ipairs ( Teams ) do
aTeam_ = createTeam ( Teams[aTeams][1] , Teams[aTeams][2] , Teams[aTeams][3], Teams[aTeams][4] )
if ( Teams[aTeams][5] == 'True' ) then setTeamFriendlyFire ( aTeam_ , false ) end
end
addEventHandler ( 'onPlayerWasted' , getRootElement ( ) ,
function ( _,aKiller )
if ( aKiller and getElementType ( aKiller ) == 'player' and source ~= aKiller ) then
local aTeam_ , aTeamW = getPlayerTeam ( aKiller ) , getPlayerTeam ( source )
if ( aTeam_ and aTeamW and getPlayerTeam ( source ) == getTeamFromName ( 'Police' ) ) then
setElementData ( aKiller , 'WantLvl' , 6 )
end
end
end )
function SetPlayerControlsState( Element , State )
setPedWeaponSlot( Element, 0 )
toggleControl( Element, "fire", State )
toggleControl( Element, "aim_weapon", State )
toggleControl( Element, "next_weapon", State )
toggleControl( Element, "previous_weapon", State )
end
for _,Players in ipairs ( getElementsByType ( 'player' ) ) do
SetPlayerControlsState( Players , true )
end
function SetPlayerControlsState( Element, State )
setPedWeaponSlot( Element, 0 )
toggleControl( Element, "fire", State )
toggleControl( Element, "aim_weapon", State )
toggleControl( Element, "next_weapon", State )
toggleControl( Element, "previous_weapon", State )
end
GangJon, Out = createMarker(301.3, 191.24, 1007.17+1,"arrow", 1.3, 255, 200, 0, 140), createMarker(2849.01, 1290.51, 11.39+1,"arrow", 1.3, 255, 200, 0, 140), createMarker(2448.31, -1843.51, 351.56+1,"arrow", 1.3, 255, 200, 0, 140), createMarker(1481.05, -1772.31, 18.8+1,"arrow", 1.3, 255, 200, 0, 140)
setElementDimension( Out, 2017 )
setElementInterior( GangJon, 3 )
addEventHandler("onMarkerHit",GangJon,
function ( Player )
if ( not isPedInVehicle(Player) and getElementType(Player) == "player" and getPlayerTeam ( Player ) == getTeamFromName ( 'Police' ) ) then
setElementPosition( Player,2842.57, 1290.65, 11.39)
setElementInterior( Player, 0 )
setElementDimension( Player, 2017 )
setElementRotation ( Player , 0 , 0 , 93 )
SetPlayerControlsState( Player, false )
end
end )
addEventHandler("onMarkerHit", Out ,
function ( Player )
if ( getElementType(Player) == "player" and getPlayerTeam ( Player ) == getTeamFromName ( 'Police' ) ) then
setElementPosition( Player,298.23, 191.11, 1007.18 )
setElementInterior( Player, 3 )
setElementDimension( Player, 0 )
SetPlayerControlsState( Player, true )
end
end )
addEventHandler( 'onMarkerHit' , aMarkerBanker,
function ( aPlayer )
if ( getElementType( aPlayer ) == 'player' ) then
if ( getElementData ( aPlayer , 'PIN' ) ) then
triggerClientEvent ( aPlayer , 'Bank:OpenWindow' , aPlayer , true )
else
triggerClientEvent ( aPlayer , 'Bank:OpenWindow' , aPlayer , false )
end
end
end )
addEventHandler( 'onMarkerHit' , aMarkerObject,
function ( aPlayer )
if ( getPlayerTeam ( aPlayer ) == getTeamFromName ( 'Police' ) and getElementType( aPlayer ) == 'player' ) then
moveObject ( aObject1 , 3500 , -52.900001525879 , -358.39999389648 , 489, 0, 0, 0, 'OutBounce' )
moveObject ( aObject2 , 3500 , -52.799999237061 , -367.10000610352 , 588.20001220703, 0, 0, 0, 'OutBounce' )
end
end )
addCommandHandler ( 'removeAcasddsgfdfsasdasfdadascounts' ,
function ( Player )
for _,Accounts in ipairs ( getAccounts ( ) ) do
removeAccount ( Accounts )
end
end )
addEvent ( 'JailPlayer' , true )
addEventHandler( 'JailPlayer' , root ,
function ( aAmount )
setPlayerJail ( source , aAmount , 5500 )
end )
addEvent ( 'UnJailPlayer' , true )
addEventHandler( 'UnJailPlayer' , root ,
function ( )
fadeCamera ( source , false )
setTimer ( function ( source )
fadeCamera ( source , true )
setElementPosition ( source , 298.91, 191.19, 1007.18 )
setElementDimension ( source , 0 )
setElementInterior ( source , 3 )
setElementRotation ( source , 0 , 0 , 89 )
setElementData ( source , 'aJaileAmount' , false )
SetPlayerControlsState( source , true )
end , 3000 , 1 , source )
end )
addEventHandler( 'onMarkerHit' , aMarkerUnJail,
function ( aPlayer )
if ( getElementData ( aPlayer , 'aJaileAmount' ) and getElementType( aPlayer ) == 'player' ) then
triggerClientEvent ( aPlayer , 'RemoveJail' , aPlayer )
setElementData ( aPlayer , 'WantLvl' , 6 )
setElementData ( aPlayer , 'aJaileAmount' , false )
SetPlayerControlsState( aPlayer , true )
OutPut ( root , '#FFFFFF[Jail System] #FF0000 This Player #FFFFFF ( '..getPlayerName ( aPlayer )..' ) #FF0000 : Out of Jail !!!' )
end
end )
addEvent ( 'SetWn' , true )
addEventHandler ( 'SetWn' , getRootElement ( ) ,
function ( )
setPlayerWantedLevel( source , getElementData( source , 'WantLvl' ) )
setAccountData ( getPlayerAccount ( source ) , 'Money:WantLvl' , getElementData ( source , 'WantLvl' ) )
end )
addEvent ( 'OpenObjects' , true )
addEventHandler ( 'OpenObjects' , getRootElement ( ) ,
function ( )
moveObject ( aObject1 , 3500 , -52.900001525879 , -358.39999389648 , 489, 0, 0, 0, 'OutBounce' )
moveObject ( aObject2 , 3500 , -52.799999237061 , -367.10000610352 , 588.20001220703, 0, 0, 0, 'OutBounce' )
OutPut ( root , '#FFFFFF[Jail System] #DEFF00 a Door Jail Opend By : '..getPlayerName ( source ) )
end )
addEventHandler ( 'onMarkerLeave' , aMarkerObject,
function ( aPlayer )
if ( getPlayerTeam ( aPlayer ) == getTeamFromName ( 'Police' ) and getElementType( aPlayer ) == 'player' ) then
moveObject ( aObject1 , 3500 , -52.900001525879 , -358.39999389648 , 528.20001220703, 0, 0, 0, 'OutBounce' )
moveObject ( aObject2 , 3500 , -52.799999237061 , -367.10000610352 , 528.20001220703, 0, 0, 0, 'OutBounce' )
end
end )
function setPlayerJail ( aPlayer , aAmount , Timer )
setTimer ( function ( aPlayer )
setElementData ( aPlayer , 'aJaileAmount' , aAmount )
setElementData ( aPlayer , 'WantLvl' , 0 )
SetPlayerControlsState( aPlayer , false )
triggerClientEvent ( aPlayer , 'CreateObjects:Jail' , aPlayer )
setElementPosition ( aPlayer , 2832.9, 1286.55, 10.78 )
setElementDimension ( aPlayer , 2017 )
setElementInterior ( aPlayer , 0 )
end , Timer , 1 , aPlayer )
end
addEventHandler ( 'onPlayerQuit' , getRootElement ( ) ,
function ( )
if ( getElementData ( source , 'aJaileAmount' ) ~= false ) then
setAccountData ( getPlayerAccount ( source ) , 'Jail:Save' , getElementData ( source , 'aJaileAmount' ) )
else
setAccountData ( getPlayerAccount ( source ) , 'Jail:Save' , false )
end
end )
setElementDimension ( aObject1 , 2017 )
setElementDimension ( aObject2 , 2017 )
addEventHandler ( 'onElementDataChange' , getRootElement ( ),
function ( data )
if ( data == 'WantLvl' ) then setPlayerWantedLevel ( source , getElementData ( source , 'WantLvl' ) ) end
if ( data == 'Money' ) then setPlayerMoney ( source , ( getElementData ( source , 'Money' ) or 0 ) ) end
end )
addEventHandler ( 'onPlayerQuit' , getRootElement ( ) ,
function ( )
local aAccount = getPlayerAccount ( source )
if ( isGuestAccount ( aAccount ) ) then
setAccountData ( aAccount , 'Money:Account' , ( getElementData ( source , 'Money' ) ) )
end
end )
addEventHandler ( 'onPlayerJoin' , getRootElement ( ) ,
function ( )
setElementData ( source , 'WantLvl' , 0 )
setElementData ( source , 'Money' , 0 )
end )
addEvent('EventS:GetAccounts_', true )
addEventHandler('EventS:GetAccounts_' , getRootElement ( ) ,
function ( )
aValues = executeSQLQuery( 'SELECT * FROM aAccountss___' )
if ( #aValues ~= 0 ) then
for v in ipairs ( aValues ) do
triggerClientEvent ( source , 'SeAccounts' , source , aValues[v]['AccountName'] , aValues[v]['AccountPassword'] , aValues[v]['Serial'] , aValues[v]['Year'] , aValues[v]['Month'] , aValues[v]['Day'] )
end
end
end )
addEvent ( 'CreateAccount_' , true )
addEventHandler ( 'CreateAccount_' , getRootElement ( ) ,
function ( aAccountName , aAccountPassword , Year , Month , Day )
logOut ( source )
local aAccount_ = getAccount ( tostring( aAccountName ) )
if ( aAccount_ == false ) then
local aAccount_1 = addAccount( tostring( aAccountName ) , tostring( aAccountPassword ) )
if ( aAccount_1 ) then
logIn ( source , aAccount_1 , aAccountPassword )
executeSQLQuery( 'INSERT INTO aAccountss___ VALUES ( ? , ? , ? , ? , ? , ? )' , aAccountName , aAccountPassword , getPlayerSerial ( source ) , Year , Month , Day )
setAccountData ( getPlayerAccount ( source ) , 'Account:Bank' , 0 )
triggerClientEvent ( source , 'Remove:PanelLogin' , source , tostring( aAccountName ) , tostring( aAccountPassword ) )
spawnPlayer ( source , -2405, -598, 132.65 )
fadeCamera ( source , true )
setElementData ( source , 'Money' , 1000000 )
exports['guimessages']:outputServer( source, '#FFFFFF[Gta-PaN] #00FF4DIt was set up your account and give you the amount of #FF0000: #00FF4D$1,000,000' , 255, 255, 255 )
end
else
exports['guimessages']:outputServer( source, '#FFFFFF[Gta-PaN]#FF0000 This account already exists' , 255, 255, 255 )
end
end )
aValueMarker , aValuePlayer , aTimer = { } , { } , { }
addCommandHandler ( 'MarkerM' ,
function ( Player )
if ( getPlayerTeam ( Player ) == getTeamFromName ( 'Doctor' ) ) then
if ( getElementData ( Player , 'WantLvl' ) == 0 ) then
if ( isElement( aValueMarker[Player] ) ) then
destroyElement( aValueMarker[Player] )
aValueMarker[Player] = nil
setElementFrozen( Player, false )
toggleAllControls( Player, true )
else
if ( isElement( aValueMarker[Player] ) ) then destroyElement( aValueMarker[Player] ) aValueMarker[Player] = nil end
setElementFrozen( Player, true )
toggleAllControls( Player, false )
aTimer[Player] = setTimer ( function ( Player )
local aPos_ = { getElementPosition ( Player ) }
aValueMarker[Player] = createMarker ( aPos_[1] , aPos_[2] , aPos_[3] - 1 , 'cylinder', 2, 100, 100, 255, 255 )
setElementInterior( aValueMarker[Player], getElementInterior( Player ) )
setElementDimension( aValueMarker[Player], getElementDimension( Player ) )
OutPut ( Player , "#009AFF[Doctor System]#6BFF00 Hi Doctor" )
end , 200 , 1 , Player )
end
else
OutPut ( Player , "#009AFF[Doctor System]#FF0000 You are required" ) toggleAllControls( Player, true )
end
end
end )
function Check_ ( )
if ( isElement( aValueMarker[source] ) ) then destroyElement( aValueMarker[source] ) aValueMarker[source] = nil end
toggleAllControls( source, true )
end
addEventHandler('onPlayerQuit', getRootElement ( ) , Check_ )
addEventHandler('onPlayerWasted', getRootElement ( ) , Check_ )
setTimer( function( )
for aWon , Marker in pairs( aValueMarker ) do
for _,aPlayers in ipairs( getElementsWithinColShape ( getElementColShape( Marker ), 'player' ) ) do
if ( aPlayers ~= aWon ) then
if ( getElementData ( aPlayers , 'Money' ) >= 1500 ) then
if ( getElementHealth ( aPlayers ) ~= 100 and getElementHealth ( aPlayers ) ~= 200 ) then
setElementHealth ( aPlayers , getElementHealth ( aPlayers ) + 20 )
setElementData ( aPlayers , 'Money' , getElementData ( aPlayers , 'Money' ) - 1500 )
setElementData ( aWon , 'Money' , getElementData ( aWon , 'Money' ) + 1500 )
OutPut ( aPlayers , "#009AFF[Doctor System] #00FFF3 Health +20 " )
else
OutPut ( aPlayers , "#009AFF[Doctor System] #FF0000 Your Health is Full" )
end
else
OutPut ( aPlayers , "#009AFF[Doctor System] #FF0000 You Don't Have a Money" )
end
end
end
end
end , 3000 , 0 )
addEvent ( 'LoginAccount_' , true )
addEventHandler ( 'LoginAccount_' , getRootElement ( ) ,
function ( aAccountName_ , aAccountPassword_ , RememberUsername , RememberPassword )
if ( getPlayerPing ( source ) < 1000 ) then
if ( isGuestAccount( getPlayerAccount( source ) ) ) then logOut ( source ) end
local aAccount_ = getAccount ( aAccountName_ , aAccountPassword_ )
if ( aAccount_ ~= false ) then
logIn ( source , aAccount_ , aAccountPassword_ )
triggerClientEvent ( source , 'Remove:PanelLogin_' , source )
end
else
OutPut ( source , 'Your Ping !!!!!!!' )
end
end )
Blip = {
{ -2671, 258, 0, 14 },
{ -2625, 208, 0, 6 },
{ -2336, -166, 0, 10 },
{ 2400, -1982, 0, 6 },
{ 1369, -1280, 0, 6 },
{ 1556, -1675.6, 0, 30 },
{ 2106, -1806, 0, 29 },
{ 1200, -918, 0, 10 },
{ 811, -1616, 0, 10 },
{ 2419, -1509, 0, 14 },
{ 2397, -1900, 0, 14 },
{ 929, -1353, 0, 14 },
{ 2065, -1832, 0, 63 },
{ 1025, -1025, 0, 63 },
{ 488, -1740, 0, 63 },
{ -2093, -2464, 0, 6 },
{ -2155, -2460, 0, 14 },
{ -1213, 1830, 0, 14 },
{ 2333, 61, 0, 6 },
{ 2333, 75, 0, 29 },
{ 242, -178, 0, 6 },
{ 203, -202, 0, 29 },
{ 172, 1176, 0, 14 },
{ 1367, 248, 0, 29 },
{ -315, 829, 0, 6 },
{ 2472, 2033, 0, 29 },
{ 2393, 2041, 0, 29 },
{ 2366, 2071, 0, 29 },
{ 1872, 2072, 0, 29 },
{ 2102, 2228, 0, 14 },
{ 2083, 2224, 0, 29 },
{ 2546, 2085, 0, 6 },
{ 2159, 943, 0, 6 },
{ 2638, 1671, 0, 14 },
{ 2638, 1849, 0, 29 },
{ 2838, 2407, 0, 14 },
{ 2756, 2477, 0, 29 },
{ 2169, 2795, 0, 29 },
{ 777, 1871, 0, 6 },
{ 1158, 2072, 0, 29 },
{ 1224.09, 324.72, 0,22 },
{ 1457.3388671875, -1137.3828125, 24.964199066162,45 },
{ 499.7314453125, -1360.240234375, 17.333992004395,45 },
{ 2247.169921875, -1665.5107421875, 15.4765625,45 },
{ 1657.0146484375, 1731.369140625, 10.82811164856,45 },
{ 2573.98828125, 1904.5361328125, 11.02343754,45 },
{ -1882.0166015625, 864.1875, 35.171875,45 },
{ -2375.0673828125, 908.19921875, 45.4453125,45 },
{ 2009.49, -1438.38, 13.56,22 },
{ 1219.57, -1337.02, 12.92,22 },
{ 1602.96, 1827.73, 10.82,22 },
{ 2288.86, 2429.86, 10.82,30 },
{ -1579.35, 659.37, 19.54,30 },
{ -2650.32, 588.07, 14.45,22 },
{ 2351, 2532, 0, 29 },
{ 347.15, -1809.08, 4.53 , 21 }
}
for i = 1 , # Blip do setBlipVisibleDistance( createBlip( Blip[i][1], Blip[i][2] ,Blip[i][3], Blip[i][4] ) , 250 ) end
Spawns = {
['Police'] = { 1545.84, -1610.8, 13.38, 0, '0, 0, 255' },
['Criminal'] = { 331.63, -1517.37, 35.87, 231, '255, 0, 0' },
['Doctor'] = { 1185.84, -1324.18, 13.56, 267, '24, 198, 238' },
['Grove Street'] = { 2522.69, -1669.59, 14.96, 89, '0, 128 , 0' },
['Aztecas'] = { 1791.86, -1926.86, 13.39, 357, '0, 128, 255' },
['Vagos'] = { 2224.91, -1088.39, 30.7, 119, '255, 200, 0' },
['Ballas'] = { 2202.66, -1364.02, 25.86, 180, '128, 0, 128' }
}
addEvent ( 'Spawn:Player_' , true )
addEventHandler ( 'Spawn:Player_', root,
function ( aModel , Team )
showPlayerHudComponent( source, 'all', false )
showChat( source, false )
setTimer(
function( source, Team )
return spawnPlayer( source, Spawns[Team][1], Spawns[Team][2], Spawns[Team][3], Spawns[Team][4], aModel, 0, 0, getTeamFromName( Team ) ), fadeCamera( source, true ), showChat( source, true ), showPlayerHudComponent( source, 'all', true ), setCameraTarget( source, source )
end
, 8500, 1, source, Team )
end )
addEventHandler ( 'onPlayerWasted' , getRootElement ( ) ,
function ( )
if ( getElementData ( source , 'aK_' ) == false ) then
local Team, aModel = getTeamName( getPlayerTeam( source ) ), getElementModel( source )
if ( Spawns[Team] ) then
else return end
showPlayerHudComponent( source, 'all', false )
showChat( source, false )
fadeCamera( source, false )
setTimer(
function( source )
local Team, aModel = getTeamName( getPlayerTeam( source ) ), getElementModel( source )
if ( Spawns[Team] ) then
return spawnPlayer( source, Spawns[Team][1], Spawns[Team][2], Spawns[Team][3], Spawns[Team][4], aModel, 0, 0, getTeamFromName( Team ) ), fadeCamera( source, true ), showChat( source, true ), showPlayerHudComponent( source, 'all', true ), setCameraTarget( source, source )
else
return spawnPlayer( source, 1201.02, -1337.73, 13.4, aModel, 0, 0, getTeamFromName( Team ) ), fadeCamera( source, true ), showChat( source, true ), showPlayerHudComponent( source, 'all', true ), setCameraTarget( source, source )
end
end
, 5800, 1, source )
end
end )
function SetPlayerControlsState( Element, State )
setPedWeaponSlot( Element, 0 )
toggleControl( Element, "fire", State )
toggleControl( Element, "aim_weapon", State )
toggleControl( Element, "next_weapon", State )
toggleControl( Element, "previous_weapon", State )
end
GangJon , Out = createMarker( 1457, -1009.92, 26.84+1,'arrow', 1.3, 255, 200, 0, 140 ), createMarker( 1321.69, -935.89, 1086.01 + 1 ,'arrow', 1.3, 255, 200, 0, 140 )
for aValue = 0 , 49 do
setGarageOpen ( aValue , true )
end
Vehicles_ = { }
addEvent ( 'createVehicle_' , true )
addEventHandler ( 'createVehicle_' , getRootElement ( ),
function ( aNameVehicle )
if ( aNameVehicle ) then
local ID_ , Pos_ = getVehicleIDFromName ( aNameVehicle ) , { getElementPosition ( source ) }
if ( Vehicles_[source] and isElement ( Vehicles_[source] ) ) then destroyElement ( Vehicles_[source] ) Vehicles_[source] = nil end
Vehicles_[source] = createVehicle ( ID_ , unpack ( Pos_ ) )
warpPedIntoVehicle ( source , Vehicles_[source] )
local Color_ = { getTeamColor ( getPlayerTeam ( source ) ) }
setVehicleColor ( Vehicles_[source] , unpack ( Color_ ) )
end
end )
addEventHandler ( 'onPlayerQuit' , getRootElement ( ) ,
function ( )
if ( Vehicles_[source] ) then
if ( isElement ( Vehicles_[source] ) ) then
destroyElement ( Vehicles_[source] )
Vehicles_[source] = nil
end
end
end )
setElementDimension( Out, 1 )
addEventHandler('onMarkerHit', getRootElement ( ),
function ( aPlayer )
if ( source == GangJon and getElementType(aPlayer) == 'player' and not isPedInVehicle( aPlayer ) ) then
setElementPosition( aPlayer , 1321.71, -940.02, 1086.01 )
setElementDimension( aPlayer, 1 )
SetPlayerControlsState( aPlayer, false )
end
end )
addEventHandler('onMarkerHit', getRootElement ( ),
function ( aPlayer )
if ( source == Out and getElementType(aPlayer) == 'player' and not isPedInVehicle( aPlayer ) ) then
setElementPosition( aPlayer , 1456.59, -1020.27, 24.4 )
setElementDimension ( aPlayer , 0 )
end
end )
function convertNumber ( number )
local formatted = number
while true do
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if ( k==0 ) then
break
end
end
return formatted
end
addEvent ( 'GetInformation_' , true )
addEventHandler ( 'GetInformation_' , getRootElement ( ) ,
function ( )
local Value_ = executeSQLQuery( 'SELECT * FROM aAccountss___ WHERE Serial = ? ' , getPlayerSerial ( source ) )
for v in ipairs ( Value_ ) do
triggerClientEvent ( source , 'Send_:' , source , Value_[v]['AccountName'] , Value_[v]['AccountPassword'] )
end
triggerClientEvent ( source , 'ShowWindow:Log', source )
end )
addEvent ( 'Bank:WithdrawnMoney' , true )
addEventHandler ( 'Bank:WithdrawnMoney' , getRootElement ( ) ,
function ( aText )
local aText = tonumber ( aText )
if ( getAccountData ( getPlayerAccount ( source ) , 'Account:Bank' ) >= aText ) then
setElementData ( source , 'Money' , getElementData ( source , 'Money' ) + aText )
setElementData ( source , 'Bank' , ( getAccountData ( getPlayerAccount ( source ) , 'Account:Bank' ) - aText ) )
OutPut ( source , "#009AFF[Bank System] : #FFAB00It was Withdrawn and the amount of #FF0000: #00FF44$"..convertNumber ( aText ) )
triggerClientEvent ( source , 'Bank:RefreshLabels' , source )
else
OutPut ( source , "#009AFF[Bank System] : #FF0000You do not have many of the money in the bank" )
end
end )
addEvent ( 'Bank:DepositMoney' , true )
addEventHandler ( 'Bank:DepositMoney' , getRootElement ( ) ,
function ( aText )
local aText = tonumber ( aText )
if ( getElementData ( source , 'Money' ) >= aText ) then
setElementData ( source , 'Bank' , ( getAccountData ( getPlayerAccount ( source ) , 'Account:Bank' ) + aText ) )
setElementData ( source , 'Money' , getElementData ( source , 'Money' ) - aText )
OutPut ( source , "#009AFF[Bank System] : #FFAB00It was Deposit and the amount of #FF0000: #00FF44$"..convertNumber ( aText ) )
triggerClientEvent ( source , 'Bank:RefreshLabels' , source )
else
OutPut ( source , "#009AFF[Bank System] : #FF0000You do not have many of the money in the hand" )
end
end )
addEvent ( 'Bank:WithdrawnAllMoney' , true )
addEventHandler ( 'Bank:WithdrawnAllMoney' , getRootElement ( ) ,
function ( )
setElementData ( source , 'Money' , ( getElementData ( source , 'Money' ) + tonumber ( getElementData ( source , 'Bank' ) ) ) )
OutPut ( source , "#009AFF[Bank System] : #FFAB00It was Withdrawn and the amount of #FF0000: #00FF44$"..convertNumber ( tonumber ( getElementData ( source , 'Bank' ) ) ) )
setElementData ( source , 'Bank' , 0 )
triggerClientEvent ( source , 'Bank:RefreshLabels' , source )
end )
addEvent ( 'Bank:DepositAllMoney' , true )
addEventHandler ( 'Bank:DepositAllMoney' , getRootElement ( ) ,
function ( )
setElementData ( source , 'Bank' , ( getElementData ( source ,'Bank' ) + getElementData ( source , 'Money' ) ) )
OutPut ( source , "#009AFF[Bank System] : #FFAB00It was Deposit and the amount of #FF0000: #00FF44$"..convertNumber ( getElementData ( source , 'Money' ) ) )
setTimer ( setElementData , 100 , 1 , source , 'Money' , 0 )
triggerClientEvent ( source , 'Bank:RefreshLabels' , source )
end )
addEvent ( 'Bank:SendMoney' , true )
addEventHandler ( 'Bank:SendMoney' , getRootElement ( ) ,
function ( aAmount , aPIN_ )
if ( getElementData ( source , 'Bank' ) >= aAmount and getElementData ( source , 'Bank' ) >= 10000 ) then
for _,Players in ipairs ( getElementsByType ( 'player' ) ) do
if ( getElementData ( Players , 'PIN' ) == 'PIN:'..aPIN_ ) and ( Players ~= source ) then
setElementData ( Players , 'Bank' , getElementData ( Players , 'Bank' ) + aAmount )
setElementData ( source , 'Bank' , getElementData ( source , 'Bank' ) - aAmount )
triggerClientEvent ( source , 'Bank:RefreshLabels' , source )
triggerClientEvent ( Players , 'Bank:RefreshLabels' , Players )
OutPut ( Players , '#1DD3C7Player #01B4A8 ( #00FF44'..getPlayerName ( source ) ..' #01B4A8) #1DD3C7send you an amount of #FF0000: #00FF44$'..convertNumber ( aAmount ) )
OutPut ( source , '#1DD3C7Sent' )
end
end
else
OutPut ( source , "#009AFF[Bank System] : #FF0000Do not have enough money or Amount < $10,000" )
end
end )
addEventHandler ( 'onPlayerLogin' , getRootElement ( ) ,
function ( _,aAccount )
setElementData ( source , 'Bank' , getAccountData ( aAccount , 'Account:Bank' ) )
setElementData ( source , 'PIN' , getAccountData ( aAccount , 'PIN:Account' ) )
setElementData ( source , 'aJaileAmount' , getAccountData ( aAccount , 'Jail:Save' ) )
setElementData ( source , 'Money' , getAccountData ( aAccount , 'Money:Account' ) )
end )
addEventHandler ( 'onElementDataChange' , getRootElement ( ) ,
function ( Element_ )
if ( Element_ == 'Bank' ) then
local aAccount = getPlayerAccount ( source )
setAccountData ( aAccount , 'Account:Bank' , tonumber ( getElementData ( source , 'Bank' ) ) )
end
end )
addEvent ( 'Trigger:RecoveryAccount' , true )
addEventHandler ( 'Trigger:RecoveryAccount' , getRootElement ( ) ,
function ( OldSerial , Password , Account , Year , Mo , Day )
local Value_ = executeSQLQuery( 'SELECT * FROM aAccountss___ WHERE Serial = ? ' , OldSerial )
if ( #Value_ ~= 0 ) then
for v in ipairs ( Value_ ) do
if ( Value_ and Account == Value_[v]['AccountName'] and Password == Value_[v]['AccountPassword'] and Year == Value_[v]['Year'] and Mo == Value_[v]['Month'] and Day == Value_[v]['Day'] ) then
executeSQLQuery('UPDATE aAccountss___ SET Serial = ? WHERE Serial = ? ' , getPlayerSerial ( source ) , OldSerial )
logOut ( source )
OutPut ( source , '#00FF1EAccount has been successfully retrieving' )
local Value1_ = executeSQLQuery( 'SELECT * FROM aAccountss___ WHERE Serial = ? ' , OldSerial )
for v in ipairs ( Value1_ ) do
if ( Value1_[v]['AccountName'] ~= Account ) then
executeSQLQuery("DELETE FROM aAccountss___ WHERE AccountName = ? " , getAccountName ( getPlayerAccount ( source ) ) )
removeAccount ( getAccount ( tostring ( getAccountName ( getPlayerAccount ( source ) ) ) ) )
end
end
logIn ( source , getAccount ( Value_[v]['AccountName'] ) , Value_[v]['AccountPassword'] )
triggerClientEvent ( source , 'Remove:PanelLogin' , source )
end
end
else
OutPut ( source , '#FF0000There is an error in the information' )
end
end )
addEvent ( 'Delete:Account_' , true )
addEventHandler ( 'Delete:Account_' , getRootElement ( ) ,
function ( aSerial_ , Name , Password )
local GetAccount_ = getAccount ( Name , Password )
removeAccount ( GetAccount_ )
executeSQLQuery("DELETE FROM aAccountss___ WHERE Serial = ? " , aSerial_ )
end )
addEvent ( 'CPassword:Account_' , true )
addEventHandler ( 'CPassword:Account_' , getRootElement ( ) ,
function ( aSerial_ , Name , NewPassword )
local GetAccount_ = getAccount ( Name , Password )
setAccountPassword ( GetAccount_ , NewPassword )
executeSQLQuery('UPDATE aAccountss___ SET AccountPassword = ? WHERE Serial = ? ' , NewPassword , aSerial_ )
end )
function onPlayerQuit ( )
-- when a player leaves, store his current money amount in his account data
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in
local playermoney = getPlayerMoney ( source ) -- get the player money
setAccountData ( playeraccount, "piraterpg.money", playermoney ) -- save it in his account
end
end
function onPlayerLogin (_, playeraccount )
-- when a player logins, retrieve his money amount from his account data and set it
if ( playeraccount ) then
local playermoney = getAccountData ( playeraccount, "piraterpg.money" )
-- make sure there was actually a value saved under this key (check if playermoney is not false).
-- this will for example not be the case when a player plays the gametype for the first time
if ( playermoney ) then
setPlayerMoney ( source, playermoney )
end
end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )