Best-Killer
Members-
Posts
494 -
Joined
-
Last visited
Everything posted by Best-Killer
-
how to get the text in row !! example : Vehicle Model grid list , has 3 rows of 3 cars model id and now i want get them i hope you understand me guys
-
nope but thx ^^ i got what can help me ^^ pls help me here :
-
Thx Dude , i'm learning and you gave me a idea to make what i want really thx ^^ <3 what is problem here guys ? rRoot = getResourceRootElement(getThisResource()) addEventHandler( 'onResourceStart', rRoot, function( ) executeSQLQuery( 'CREATE TABLE IF NOT EXISTS Marker_System ( name VARCHAR(20) ,posX VARCHAR(40), posY VARCHAR(40), posZ VARCHAR(40), r VARCHAR(40), g, VARCHAR(40) b VARCHAR(40), models VARCHAR(40), rotation VARCHAR(40), ID VARCHAR(40))' ) creatMarkerSystem() end ) function creatMarkerSystem() local GetAllMarker = executeSQLQuery( "SELECT * FROM Marker_System" ) if ( type ( GetAllMarker ) == "table" and #GetAllMarker > 0 ) then for i = 1, #GetAllMarker do local n = {GetAllMarker[i]["posX"], GetAllMarker[i]["posY"], GetAllMarker[i]["posZ"], GetAllMarker[i]["r"], GetAllMarker[i]["g"],GetAllMarker[i]["b"]} for ii = 1, #n do n[ ii ] = tonumber( n[ ii ] ) end local marker = createMarker( n[1], n[2], n[3], 'cylinder', 1.25, n[4], n[5], n[6], 255 ) setElementData( marker, 'id', i ) setElementData( marker, 'giveCarSystem', true ) end end end addEvent( 'CreateMarker', true ) addEventHandler( 'CreateMarker', root, function( X, Y, Z, r, g, b) if getPedOccupiedVehicle( source ) then Z = Z else Z = Z - 1 end local AllMarker = executeSQLQuery( "SELECT * FROM Marker_System" ) id = #AllMarker + 1 executeSQLQuery( "INSERT INTO Marker_System ( posX, posY, posZ, r, g, b, ID ) VALUES ( "..X..", "..Y..", "..Z..", "..r..", "..g..", "..b..", "..id..")" ) local marker = createMarker( X, Y, Z, 'cylinder', 1.25, r, g, b, 255 ) setElementData( marker, 'giveCarSystem', true ) setElementData( marker, 'id', id ) outputChatBox( "Marker Was Created", source, 255, 255, 0 ) end ) errors : line:27/29: Database query failed: no such table: Marker_system
-
same problem , showing 255 i used it and same thing , showing to me just 255
-
i tried and i tested it and i got just r (255) code function myTeamColor(Player,Command) -- adding the function local ab = "#ffffff" if ab then outputChatBox("your team color is : "..hex2rgb(ab)) end end addCommandHandler("myteamcolor",myTeamColor) -- adding command handler function hex2rgb(hex) hex = hex:gsub("#","") return tonumber("0x"..hex:sub(1,2)), tonumber("0x"..hex:sub(3,4)), tonumber("0x"..hex:sub(5,6)) end 0 errors
-
lol you're not right bro i was don't have any idea about that idea Spawners's Vehicles (that gridlist in gui ) look at this script i was searching for it please look at script screenshot to understand me what i was need https://community.multitheftauto.com/index.php?p=gallery&s=show&pic=16109 now i got what i need ! it's just about Spawners's Vehicles also i was making that :~ but now really i'm trying to learn Lua and thx for anyway
-
if you helped me here : i'll not forget that help forever pls pls really i need finish my work on it
-
in 2 month ago i find spawner creator in mtasa Community i was not need it but now i need it any one give me that url he know spawner creator !! it's complied one as i remmeber but i just need it to know what i do with my script cuz i'm creating one but my problem i want know how selecet that vehicles be in spawner when player hit example : White Spawner (Free spawners) adding it NRG , infurnes , Sanchez .... , white spawner number 2 has only infurnes , sanchez for let you know guys i'll use SQL for make the script Thx to all who can help me
-
local shootingRangeLocations = { {138.43, -67.37, 1.57, 0, 0}, {137.37, -69.13, 1.43, 0, 0}, {137.37, -69.13, 1.43, 0, 0}, {137.37, -69.13, 1.43, 0, 0}, {138.43, -67.37, 1.57, 0, 0}, {138.43, -67.37, 1.57, 0, 0}, {138.43, -67.37, 1.57, 0, 0}, {138.43, -67.37, 1.57, 0, 0} } local invalidWeaponTypes = {[0] = true, [1] = true, [8] = true, [9] = true, [10] = true, [11] = true, [12] = true, [6] = true} addEventHandler("onResourceStart", resourceRoot, function () for i,v in pairs(shootingRangeLocations) do local marker = createMarker(tostring(v[1]), tostring(v[2]), tostring(v[3]), "cylinder", 1.2, 255, 255, 255, 0) if marker then setElementInterior(marker, tonumber(v[4])) setElementDimension(marker, tonumber(v[5])) addEventHandler("onMarkerHit", marker, onMarkerHit) end end end) 0 errors but no markers what is the problem ?
-
0 errors but the object didn't remove and the marker removed
-
Please help , i tried with everything but it won't work
Best-Killer replied to Best-Killer's topic in Scripting
Thx dude 0 error but now when i kill some one nothing added to database or gui -
-------Server Kills_ = {} addEventHandler('onResourceStart',resourceRoot,function () exports.NGSQL:db_exec("CREATE TABLE IF NOT EXISTS `group_kills` ( Serial VARCHAR(20), Name VARCHAR(20), Kills VARCHAR(40) )") end ) addEventHandler("onPlayerWasted",root,function ( _,Killer ) if ( Killer and Killer ~= source and getElementType(Killer) == "player" ) then local playerSerial = getPlayerSerial( Killer ) local playerName = exports.SAEGGroups:getPlayerGroup( Killer ) if not Kills_[Killer] then Kills_[Killer] = 0; end Kills_[Killer] = Kills_[Killer] + 1 local Sel = exports.NGSQL:db_exec("SELECT * FROM `group_kills` WHERE Serial=?", playerSerial) if ( type ( Sel ) == "table" and #Sel == 0 or not Sel ) then exports.NGSQL:db_exec(" INSERT INTO `group_kills` (Serial, Name, Kills) VALUES(?,?,?)",playerSerial,playerName,Kills_[Killer]) else exports.NGSQL:db_exec(" UPDATE `group_kills` WHERE Name =?, Kills =? WHERE Serial=?",playerName,Kills_[Killer],playerSerial) end end end) addEvent ( 'getData', true) addEventHandler ( 'getData', root, function() local db = exports.NGSQL:db_exec("SELECT * FROM `group_kills`") if (type(db) ~= "table" or (type(db)=="table" and #db==0) or not db) then return end triggerClientEvent ( source, 'setData', source, db ) end ) --------Clinet function isEventHandlerAdded( 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 bindKey('f4','down', function() if isEventHandlerAdded ("onClientRender", root,dx) then removeEventHandler("onClientRender", root,dx) else triggerServerEvent( 'getData', localPlayer ) addEventHandler("onClientRender", root,dx) end end) addEvent( 'setData', true ) addEventHandler ( 'setData', root, function(data) guiGridListClear ( killgrid ) table.sort ( data, function (a,b) return ( tonumber(a.Kills) or 0 ) > ( tonumber(b.Kills) or 0 )end) for k,v in ipairs ( data ) do local Row = guiGridListAddRow(killgrid) guiGridListSetItemText(killgrid,Row,1,v.name,false,false) guiGridListSetItemText(killgrid,Row,2,v.kills,false,false) if k == 10 then break end end end) got : NGSQL/sql.lua , Line 25 dbExec failed; (1064) yo uhave an error in your sql syntax; check the manual that corrsponds to your mariaDB server version for the right syntax to use 'Where Name='Test, Kills=5 Where Serial'D8F20A.......' and this NGSql : if ( tostring ( get ( "CONNECTION_TYPE" ) ):lower() == "mysql" ) then outputConsole ( "Attempting to connect as MySQL... Please wait") db = dbConnect( "mysql", "dbname="..tostring(get("DATABASE_NAME"))..";host="..tostring(get("MYSQL_HOST"))..";port="..tostring(get("MYSQL_PORT"))..";unix_socket=/opt/lampp/var/mysql/mysql.sock", tostring(get("MYSQL_USER")), tostring(get("MYSQL_PASS")), "share=1;autoreconnect=1" ); elseif ( tostring ( get ( "CONNECTION_TYPE" ) ):lower() == "sqlite" ) then db = dbConnect ( "sqlite", tostring(get("DATABASE_NAME")) .. ".sql" ); else error ( tostring(get("CONNECTION_TYPE")) .. " is an invalid SQL connection -- valid: mysql, sqlite" ); end if not db then print ( "The database has failed to connect") return else print ( "Database has been connected") end function db_query ( ... ) local data = { ... } return dbPoll ( dbQuery ( db, ... ), - 1 ) end function db_exec ( ... ) return dbExec ( db, ... ); end --[[ Columns: Username TEXT, Money TEXT, Armour TEXT, Health TEXT, x TEXT, y TEXT, z TEXT, Skin INT, Interior INT, Dimension INT, Team TEXT Job TEXT, Playtime_mins INT, JailTime INT, WL INT, Weapons TEXT, JobRank TEXT, GroupName TEXT, GroupRank TEXT, LasterOnline DATE, LastSerial TEXT, LastIP TEXT, Kills INT, Deaths INT, weapstats TEXT, items TEXT, unemployedskin INT, vip TEXT, vipexp DATE, plrtosrvrsettings TEXT ]] db_exec ( [[CREATE TABLE IF NOT EXISTS accountdata ( Username VARCHAR(200), Money INT, Armour INT, Health INT, x VARCHAR(20), y VARCHAR(20), z VARCHAR(20), Skin INT, Interior INT, Dimension INT, Team VARCHAR(70), Job VARCHAR(70), Playtime_mins INT, JailTime INT, WL INT, Weapons TEXT, JobRank VARCHAR(20), GroupName VARCHAR(100), GroupRank VARCHAR(100), LastOnline DATE, LastSerial VARCHAR(50), LastIP VARCHAR(20), Kills INT, Deaths INT, weapstats TEXT, items TEXT, unemployedskin INT, vip VARCHAR(100), vipexp DATE, plrtosrvrsettings TEXT )]] ); local weapStats_ = { ['9mm'] = 0, ['silenced'] = 0, ['deagle'] = 0, ['shotgun'] = 0, ['combat_shotgun'] = 0, ['micro_smg'] = 0, ['mp5'] = 0, ['ak47'] = 0, ['m4'] = 0, ['tec-9'] = 0, ['sniper_rifle'] = 0 } function createAccount ( account ) if ( account and type ( account ) == 'string' ) then local plr = getPlayerFromAccount ( account ) local autoIP = "unknown" local autoSerial = "unknown" local weapStats = toJSON ( weapStats_ ) if plr and isElement ( plr ) then autoSerial = getPlayerSerial ( plr ) autoIP = getPlayerIP ( plr ) outputDebugString ( "NGSQL: Creating account "..account.." for player "..getPlayerName ( plr ).." (Serial: "..autoSerial.." || IP: "..autoIP..")" ) else outputDebugString ( "NGSQL: Creating account "..account.." for player N/A (Serial: None || IP: None)" ); end local today = exports['SAEGPlayerFunctions']:getToday ( ) return db_exec ( [[INSERT INTO `accountdata` (`Username`, `Money`, `Armour`, `Health`, `x`, `y`, `z`, `Skin`, `Interior`, `Dimension`, `Team`, `Job`, `Playtime_mins`, `JailTime`, `WL`, `Weapons`, `JobRank`, `GroupName`, `GroupRank`, `LastOnline`, `LastSerial`, `LastIP`, `Kills`, `Deaths`, `weapstats`, `items`, `unemployedskin`, `vip`, `vipexp`, `plrtosrvrsettings` ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? );]], account, '0', '0', '100', '0', '0', '0', '0', '0', '0', 'UnEmployed', 'UnEmployed', '0', '0', '0', '[ [ ] ]', 'None', 'None', 'None', today, autoSerial, autoIP, '0', '0', weapStats, toJSON ( { } ), '28', 'None', nil, toJSON ( { } ) ) end return false end function getPlayerFromAccount ( accnt ) if accnt and type ( accnt ) == 'string' then for i, v in ipairs ( getElementsByType ( 'player' ) ) do if ( getAccountName ( getPlayerAccount ( v ) ) == accnt ) then return v; end end end return false end function savePlayerData ( p, loadMsg, deleteTime ) if ( p and getElementType ( p ) == 'player' ) then if ( not isGuestAccount ( getPlayerAccount ( p ) ) ) then if ( loadMessage == nil ) then loadMessage = true end if ( deleteTime == nil ) then deleteTime = false end local account = getAccountName ( getPlayerAccount ( p ) ) local x, y, z = getElementPosition ( p ) local money, health = getPlayerMoney ( p ), getElementHealth ( p ) local armor, skin = getPedArmor ( p ), getElementModel ( p ) local int, dim = getElementInterior ( p ), getElementDimension ( p ) local job = getElementData ( p, "Job" ) local pt = exports['SAEGPlayerFunctions']:getPlayerPlaytime ( p ) local team = "UnEmployed" local wl = getElementData ( p, "WantedPoints" ) or 0 local rank = tostring ( getElementData ( p, "Job Rank" ) ) local group = tostring ( getElementData ( p, "Group" ) ) local gRank = tostring ( getElementData ( p, "Group Rank" ) ) local jt = exports['SAEGPolice']:isPlayerJailed ( p ) or 0 local weapons = { } local today = exports['SAEGPlayerFunctions']:getToday ( ) local kills = tonumber ( getElementData ( p, "NGSQL:Kills" ) ) or 0 local deaths = tonumber ( getElementData ( p, "NGSQL:Deaths" ) ) or 0 local weapstats = toJSON ( getElementData ( p, "NGSQL:WeaponStats" ) or weapStats_ ) local items = tostring ( toJSON ( getElementData ( p, "SAEGUser:Items" ) or { } ) ) local unemloyedSkin = tostring ( getElementData ( p, "SAEGUser.UnemployedSkin" ) ) or 28 local vip = tostring ( getElementData ( p, "VIP" ) ) local vipexp = tostring ( getElementData ( p, "SAEGVIP.expDate" ) ) local plrtosrvrsettings = tostring ( toJSON ( getElementData ( p, "PlayerServerSettings" ) or { } ) ) if ( getElementData ( p, "SAEGEvents:IsPlayerInEvent" ) ) then health = 0 dim = 0 end if ( getPlayerTeam ( p ) ) then team = getTeamName ( getPlayerTeam ( p ) ) end if not armor then armor = 0 end if ( not jt ) then jt = 0 end for i=1,12 do weapons[i] = { getPedWeapon ( p, i ), getPedTotalAmmo ( p, i ) } end local weapons = toJSON ( weapons ) local ip = getPlayerIP ( p ) local serial = getPlayerSerial ( p ) if loadMsg then outputDebugString ( "NGSQL: Attempting to save account "..account.." (Player: "..getPlayerName ( p )..") userdata." ) end if ( deleteTime ) then exports['SAEGPlayerFunctions']:deletePlayerPlaytime ( p ) end return db_exec ( "UPDATE accountdata SET Money=?, Armour=?, Health=?, x=?, y=?, z=?, Skin=?, Interior=?, Dimension=?, Team=?, Job=?, Playtime_mins=?, JailTime=?, WL=?, Weapons=?, JobRank=?, GroupName=?, GroupRank=?, LastOnline=?, LastSerial=?, lastIP=?, Kills=?, Deaths=?, weapstats=?, items=?, unemployedskin=?, vip=?, vipexp=?, plrtosrvrsettings=? WHERE Username=?", money, armor, health, x, y, z, skin, int, dim, team, job, pt, jt, wl, weapons, rank, group, gRank, today, serial, ip, kills, deaths, weapstats, items, unemloyedSkin, vip, vipexp, plrtosrvrsettings, account ) end end end function loadPlayerData ( p, loadMsg ) local acc = getAccountName ( getPlayerAccount ( p ) ) local data = account_exist ( acc ) if ( data and type ( data ) == 'table' ) then for i, v in ipairs ( data ) do if ( v['Username'] == acc ) then if ( loadMsg == nil ) then loadMesg = true end local money = tonumber ( v['Money'] ) or 0 local armor = tonumber ( v['Armour'] ) or 0 local health = tonumber ( v['Health'] ) or 0 local x = tonumber ( v['x'] ) or 0 local y = tonumber ( v['y'] ) or 0 local z = tonumber ( v['z'] ) or 3 local skin = tonumber ( v['Skin'] ) or 28 local interior = tonumber ( v['Interior'] ) or 0 local dimension = tonumber ( v['Dimension'] ) or 0 local team = tostring ( v['Team'] ) or "None" local job = tostring ( v['Job'] ) or "None" local pt = tonumber ( v["Playtime_mins"] ) or 0 local jt = tonumber ( v['JailTime'] or 0 ) local wl = tonumber ( v['WL'] or 0 ) local weapons = fromJSON ( v['Weapons'] or toJSON ( { } ) ) local rank = tostring ( v['JobRank'] or "None" ) local group = tostring ( v['GroupName'] or "None" ) local gRank = tostring ( v['GroupRank'] or "None" ) local kills = tonumber ( v['Kills'] ) local deaths = tonumber ( v['Deaths'] ) local weapstats = fromJSON ( tostring ( v['weapstats'] ) ) local items = fromJSON ( tostring ( v['items'] ) ) local unemployedSkin=tonumber( v['unemployedskin'] ) or 28 local vip = tostring ( v['vip'] ) local vipexp = tostring ( v['vipexp'] ) local group = tostring ( v['GroupName'] or "None" ) local groupRank = tostring ( v['GroupRank'] or "None" ) local srvrsettings =fromJSON ( tostring ( v['plrtosrvrsettings'] or tosJSON ( { } ) ) ) if ( not exports.saeggroups:doesGroupExist ( group ) ) then group = "None" else if ( not exports.saeggroups:isRankInGroup ( group, groupRank ) ) then groupRank = "None" end end if ( group:lower ( ) == "none" ) then groupRank = "None" end spawnPlayer ( p, x, y, z, 0, skin, interior, dimension ) setElementData ( p, "Job Rank", rank ) if ( jt > 0 ) then exports['SAEGPolice']:jailPlayer ( p, jt, false ) end setElementData ( p, "NGSQL:Kills", kills ) setElementData ( p, "NGSQL:Deaths", deaths ) setElementData ( p, "Job", job ) setPedArmor ( p, armor ) givePlayerMoney ( p, money ) exports['SAEGPlayerFunctions']:setPlayerPlaytime ( p,pt ) setElementData ( p, "WantedPoints", wl ) setElementData ( p, "Group", group ) setElementData ( p, "Group Rank", gRank ) setElementData ( p, "NGSQL:WeaponStats", weapstats ) setElementData ( p, "SAEGUser:Items", items ) setElementData ( p, "SAEGUser.UnemployedSkin", unemployedSkin ) setElementData ( p, "VIP", vip ) setElementData ( p, "SAEGVIP.expDate", vipexp ) setElementHealth ( p, health ) setElementData ( p, "PlayerServerSettings", srvrsettings ) if ( srvrsettings.walkStyle ) then setPedWalkingStyle ( p, srvrsettings.walkStyle) end exports.SAEGVIP:checkPlayerVipTime ( p ) for i, v in ipairs ( weapons ) do giveWeapon ( p, v[1], v[2] ) end if ( team and getTeamFromName ( team ) ) then setPlayerTeam ( p, getTeamFromName ( team ) ) end if ( loadMsg ) then outputDebugString ( "NGSQL: Loading "..acc.." account data (Player: "..getPlayerName ( p )..")" ) end return true end end end return false end function account_exist ( acc ) if ( acc ) then local q = db_query ( "SELECT * FROM accountdata WHERE Username='"..acc.."' LIMIT 1" ) if ( type ( q ) == 'table' ) then if ( #q > 0 ) then return q end return false end end return nil end function saveAllData ( useTime ) if ( useTime == nil ) then useTime = true end if ( useTime ) then if ( getResourceState ( getResourceFromName ( 'SAEGMessages' ) ) == 'running' ) then exports['SAEGMessages']:sendClientMessage ( "Please expect some lag, saving server data in 5 seconds.", root, 255, 0, 0 ) end setTimer ( function ( ) for i, v in ipairs ( getElementsByType ( 'player' ) ) do savePlayerData ( v, false, false ) end if ( isTimer ( saveAllTimer ) ) then resetTimer ( saveAllTimer ) else saveAllTimer = setTimer ( saveAllData, 3600000, 1, true ) end if ( getResourceState ( getResourceFromName ( "SAEGBank" ) ) == 'running' ) then exports['SAEGBank']:saveBankAccounts ( ) end if ( getResourceState ( getResourceFromName ( 'SAEGMessages' ) ) == 'running' ) then exports['SAEGMessages']:sendClientMessage ( "Server data has been saved!", root, 0, 255, 0 ) end if ( getResourceState ( getResourceFromName ( "SAEGBans" ) ) == "running" ) then exports.SAEGBans:saveBans ( ) end if ( getResourceState ( getResourceFromName ( "SAEGTurf" ) ) == "running" ) then exports.SAEGTurf:saveTurfs ( ) end end, 5000, 1 ) else if ( getResourceState ( getResourceFromName ( 'SAEGMessages' ) ) == 'running' ) then exports['SAEGMessages']:sendClientMessage ( "Saving server data! Please expect some lag.", root, 255, 0, 0 ) end if ( getResourceState ( getResourceFromName ( 'SAEGBank' ) ) == 'running' ) then exports['SAEGBank']:saveBankAccounts ( ) end if ( getResourceState ( getResourceFromName ( "SAEGBans" ) ) == "running" ) then exports.SAEGBans:saveBans ( ) end if ( getResourceState ( getResourceFromName ( "SAEGTurf" ) ) == "running" ) then exports.SAEGTurf:saveTurfs ( ) end for i, v in ipairs ( getElementsByType ( 'player' ) ) do savePlayerData ( v, false, false ) end if ( isTimer ( saveAllTimer ) ) then resetTimer ( saveAllTimer ) else saveAllTimer = setTimer ( saveAllData, 3600000, 1, true ) end end end saveAllTimer = setTimer ( saveAllData, 3600000, 1, true ) addEventHandler ( "onPlayerQuit", root, function ( ) if ( isGuestAccount ( getPlayerAccount ( source ) ) ) then return end savePlayerData ( source, false, true ) end ) addEventHandler ( "onPlayerLogin", root, function ( ) loadPlayerData ( source, true ) end ) addEventHandler ( "onResourceStop", resourceRoot, function ( ) saveAllData ( false ) end ) -- For development purposes --[[ addCommandHandler ( "makeaccnt", function ( p, cmd, accnt ) if ( getPlayerName ( p ) == "Console" or getAccountName ( getPlayerAccount ( p ) ) == "xXMADEXx" ) then outputChatBox ( "Executing command: Account Creation", root, 255, 255, 255 ) results = nil if ( accnt ) then if ( createAccount ( accnt ) ) then print ( "The account "..accnt.." has been created!" ) results = "Account "..accnt.." has been created" else print ( "Failed to create account." ) results = "Account "..accnt.." has failed to create!!" end else print ( "Format: /"..cmd.." [account name]" ) results = "none" end outputChatBox ( "Command Execution Results: "..tostring ( results ), root, 255, 255, 255 ) end end ) addCommandHandler ( "delaccnt", function ( p, cmd, accnt ) if ( getPlayerName ( p ) == "Console" ) then if ( account_exist ( accnt ) ) then print ( "Removing account "..accnt.." from database......" ) if ( db_exec ( "DELETE FROM accountdata WHERE Username='"..accnt.."'" ) ) then print ( "Account has been removed!" ) else print ( "Account has failed to have been removed." ) end else print ( "The account "..accnt.." doesn't exist in the mysql database." ) end end end ) addCommandHandler ( 'saveall', function ( p, cmd ) if ( ( getPlayerName ( p ) == 'Console' ) or ( getAccountName ( getPlayerAccount ( p ) ) == 'xXMADEXx' ) ) then saveAllData ( true ) end end ) ]]
-
addEvent( 'killslist', true ) addEventHandler ( 'killslist', function() guiSetVisible ( killgrid,true ) triggerServerEvent( 'getData', localPlayer ) end )
-
everything is fine but gui not opened
-
ah guys all right i tried with this now addCommandHandler( cmd, function(player, Command) if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( allowedGroup ) ) then local mrker = getMarkerByHit( player ) local objct = getObjectByHit( player ) if mrker then if objct then local id = tonumber ( getElementData( mrker, 'id') or 0 ) local obid = tonumber ( getElementData( objct, 'id') or 0 ) if id == 0 then return end if obid == 0 then return end if executeSQLQuery("DELETE FROM `tessst` WHERE `ID`=?", id) then if executeSQLQuery("DELETE FROM `tessst` WHERE `ID`=?", obid) then destroyElement( mrker ) destroyElement( objct ) outputChatBox( "ATM Has Deleted", player, 255, 255, 0 ) else outputChatBox( "error", player, 255, 255, 0 ) end end end end else outputChatBox( "Access denied", player, 255, 255, 0 ) end end ) function getObjectByHit( plr ) for i, v in ipairs( getElementsByType( 'object', rRoot ) ) do if isElementWithinColShape(plr, v) then return v end end return false,outputChatBox( "Error: Please enter the marker", plr, 255, 255, 0 ) end function getMarkerByHit( plr ) for i, v in ipairs( getElementsByType( 'marker', rRoot ) ) do if isElementWithinMarker(plr, v) then return v end end return false,outputChatBox( "Error: Please enter the marker", plr, 255, 255, 0 ) end bad argument @'isElementWithinColShape' [Expected colshape at argument 2, go object] any help pls ?
-
function citycheck (plr) if ( plr and plr ~= source and getElementType(plr) == "player" ) then local city = getElementZoneName(plr,true) if city == "Las Venturas" then triggerClientEvent ( plr, 'killslist', plr ) end end end No error but the gui didn't open ? what i want do ?? that when player be in Lv that gui showed to the player
-
no , i still have just error :Line 38 , attempt to all global 'getObjectByHit' (a nil value)
-
No i didn't get any other error when i start the resource
-
addEvent( 'Createatm', true ) addEventHandler( 'Createatm', root, function( X, Y, Z , R) if getPedOccupiedVehicle( source ) then Z = Z else Z = Z - 1 end local AllMarker = executeSQLQuery( "SELECT * FROM tessst" ) local AllObject = executeSQLQuery( "SELECT * FROM tessst" ) id = #AllMarker + 1 obid = #AllObject + 1 executeSQLQuery( "INSERT INTO tessst ( posX, posY, posZ,50,205,50, objX, objY, objZ, 0,0,Rotation ,ID ) VALUES ( "..X..", "..Y..", "..Z..","..X..", "..Y..", "..Z..","..R..", "..id..","..obid..")" ) local marker = createMarker( X, Y, Z, 'cylinder', 1.5, 50,205,50, 255 ) local object = createObject(2942, X, Y, Z+0.70, 0, 0, R) setElementData( object, 'id', id ) setElementData( marker, 'id', obid ) outputChatBox( "ATM Has Created", source, 255, 255, 0 ) end ) addEventHandler( 'onMarkerHit', rRoot, function( p , acc ) if ( p and getElementType ( p ) == 'player' and not isPedInVehicle ( p ) ) then if ( getElementInterior ( p ) == getElementInterior ( source ) and getElementDimension ( p ) == getElementDimension ( source ) ) then local acc = getPlayerAccount ( p ) if ( isGuestAccount ( acc ) ) then return false end local acc = getAccountName ( acc ) if ( not doesBankAccountExist ( acc ) ) then createBankAccount ( acc ) end triggerClientEvent(p,"markerhit",p,accounts[acc],acc,source) end end end ) addCommandHandler( cmd, function(player, Command) if isObjectInACLGroup( 'user.'..getAccountName( getPlayerAccount( player ) ), aclGetGroup( allowedGroup ) ) then local mrker = getMarkerByHit( player ) local objct = getObjectByHit( player ) if mrker then if objct then local id = tonumber ( getElementData( mrker, 'id') or 0 ) local obid = tonumber ( getElementData( objct, 'id') or 0 ) if id == 0 then return end if obid == 0 then return end if executeSQLQuery("DELETE FROM `tessst` WHERE `ID`=?", id) then if executeSQLQuery("DELETE FROM `tessst` WHERE `ID`=?", obid) then destroyElement( mrker ) destroyElement( objct ) outputChatBox( "ATM Has Deleted", player, 255, 255, 0 ) else outputChatBox( "error", player, 255, 255, 0 ) end end end end else outputChatBox( "Access denied", player, 255, 255, 0 ) end end ) function getMarkerByHit( plr ) for i, v in ipairs( getElementsByType( 'marker', rRoot ) ) do if isElementWithinMarker(plr, v) then return v end end return false,outputChatBox( "Error: Please enter the marker", plr, 255, 255, 0 ) end error :Line 38 , attempt to all global 'getObjectByHit' (a nil value) AllowedGroup , CMD work fine
-
Line 78 : bad argument #1 to 'gsub' (string expected, got nil) GUIEditor = { edit = {}, button = {}, window = {}, label = {}, radiobutton = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(433, 249, 464, 265, "SAEG:RPG Bank System", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 0.80) GUIEditor.label[1] = guiCreateLabel(10, 25, 96, 15, "Account Balance:", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 76, 183, 70) GUIEditor.edit[1] = guiCreateEdit(11, 45, 444, 31,"$0", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(10, 80, 96, 15, "Amount:", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(11, 97, 444, 31, "", false, GUIEditor.window[1]) GUIEditor.radiobutton[1] = guiCreateRadioButton(11, 135, 16, 15, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(27, 135, 55, 15, "Deposit", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[3], 254, 0, 0) GUIEditor.radiobutton[2] = guiCreateRadioButton(83, 135, 16, 15, "", false, GUIEditor.window[1]) guiRadioButtonSetSelected(GUIEditor.radiobutton[2], true) GUIEditor.label[4] = guiCreateLabel(100, 135, 55, 15, "Withdraw", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[4], 76, 183, 70) GUIEditor.button[1] = guiCreateButton(330, 157, 121, 51, "HACK", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "clear-normal") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFFE0000") GUIEditor.button[2] = guiCreateButton(9, 156, 20, 25, "1", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(29, 156, 20, 25, "2", false, GUIEditor.window[1]) GUIEditor.button[4] = guiCreateButton(49, 156, 20, 25, "3", false, GUIEditor.window[1]) GUIEditor.button[5] = guiCreateButton(69, 156, 20, 25, "4", false, GUIEditor.window[1]) GUIEditor.button[6] = guiCreateButton(89, 156, 20, 25, "5", false, GUIEditor.window[1]) GUIEditor.button[7] = guiCreateButton(9, 181, 20, 25, "6", false, GUIEditor.window[1]) GUIEditor.button[8] = guiCreateButton(29, 181, 20, 25, "7", false, GUIEditor.window[1]) GUIEditor.button[9] = guiCreateButton(49, 181, 20, 25, "8", false, GUIEditor.window[1]) GUIEditor.button[10] = guiCreateButton(69, 181, 20, 25, "9", false, GUIEditor.window[1]) GUIEditor.button[11] = guiCreateButton(89, 181, 20, 25, "0", false, GUIEditor.window[1]) GUIEditor.button[12] = guiCreateButton(336, 218, 112, 35, "Cancel", false, GUIEditor.window[1]) GUIEditor.button[13] = guiCreateButton(9, 218, 100, 38, "Enter", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1],false) showCursor(false) guiEditSetReadOnly( GUIEditor.edit[1], true ) end ) addEventHandler("onClientGUIClick",root, function () if ( source == GUIEditor.button[12] ) then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) currentPosition = {} function createatm() local x,y,z = getElementPosition (getLocalPlayer()) local r = getPlayerRotation (getLocalPlayer()) currentPosition = {x,y,z,r} local send = { [1] = currentPosition[1], [2] = currentPosition[2], [3] = currentPosition[3], [4] = currentPosition[4], } triggerServerEvent("Createatm", localPlayer, unpack(send)) end addCommandHandler ( "atmc", createatm ) addEvent( 'markerhit', true ) addEventHandler( 'markerhit', root, function () if ( not exports.saeglogin:isClientLoggedin ( ) ) then return end guiSetText ( GUIEditor.edit[1], "$"..convertNumber ( money ) ) guiSetVisible(GUIEditor.window[1],true) showCursor(true) 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 function depoistMoney ( ) local text = tonumber ( guiGetText ( GUIEditor.edit[2] ) ) or 0 local text2 = tonumber ( guiGetText ( GUIEditor.edit[1] ) ) or 0 if guiRadioButtonGetSelected ( GUIEditor.radiobutton[1] ) then if ( text and getPlayerMoney ( ) >= text and text >= 0 ) then guiSetText ( GUIEditor.edit[1], "Transferring..." ) setTimer ( guiSetText, 2000, 1, GUIEditor.edit[1], tostring ( text + text2 ) ) triggerServerEvent ( "bank_deposit", localPlayer, text ) end end end function withdrawMoney ( ) local text = tonumber ( guiGetText ( GUIEditor.edit[2] ) ) or 0 local text2 = tonumber ( guiGetText ( GUIEditor.edit[1] ) ) or 0 if guiRadioButtonGetSelected ( GUIEditor.radiobutton[2] ) then if ( text2 >= text and text > 0 ) then guiSetText ( GUIEditor.edit[1], "Transferring..." ) setTimer ( guiSetText, 2000, 1, GUIEditor.edit[1], tostring ( text2 - text ) ) triggerServerEvent ( "bank_withdraw", localPlayer, text ) end end end
-
i removed it but still same eroor
-
karrim the first part is ngql pa3ck i'm sure using xampp
