-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
You should break the loop after the data was found.
-
You must check their team with: getPlayerTeam getTeamName inside "FBIjob" function.
-
Please read the following things: https://wiki.multitheftauto.com/wiki/Resources https://wiki.multitheftauto.com/wiki/Se ... our_server https://wiki.multitheftauto.com/wiki/Meta.xml
-
Your script has many problems, I've fixed them for you, but next time use debugscript ( /debugscript 3 in-game ). -- client side: GUIEditor = { button = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(510, 418, 264, 162, "Chilli Dogs Vendor", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.button[1] = guiCreateButton(19,42,108,31, "Chili | 5HP | $10", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(101, 129, 65, 21, "Close", false, GUIEditor. window[1]) GUIEditor.button[3] = guiCreateButton(137, 42, 108, 31, "Ace | 10HP | $15", false, GUIEditor. window[1]) GUIEditor.button[4] = guiCreateButton(137, 88, 114, 31, "Mega | 20HP | $20", false, GUIEditor. window[1]) GUIEditor.button[5] = guiCreateButton(13, 88, 114, 31, "Super | 25HP | $25", false, GUIEditor. window[1]) function showVendorGUI ( ) guiSetVisible ( GUIEditor.window[1], true ) showCursor ( true ) end addEvent ( "showVendorGUI", true ) addEventHandler ( "showVendorGUI", getRootElement(), showVendorGUI ) addEvent ( "hideVendorGUI", true ) addEventHandler ( "hideVendorGUI", getRootElement(), function ( ) guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) end ) addEventHandler ( "onClientGUIClick", getRootElement(), function ( ) if ( source == GUIEditor.button[2] ) then guiSetVisible ( GUIEditor.window[1], false ) showCursor ( false ) elseif ( source == GUIEditor.button[1] ) then triggerServerEvent ( "buyFood", localPlayer, 10 ) elseif ( source == GUIEditor.button[3] ) then triggerServerEvent ( "buyFood", localPlayer, 15 ) elseif ( source == GUIEditor.button[4] ) then triggerServerEvent ( "buyFood", localPlayer, 20 ) elseif ( source == GUIEditor.button[5] ) then triggerServerEvent ( "buyFood", localPlayer, 25 ) end end ) -- server side: --Markers vendor1 = createMarker ( 999.921, -1850.50, 11.8, "cylinder", 1.2, 100, 0, 0, 115 ) vendor2 = createMarker ( 388.86, -2073.04, 6.8, "cylinder", 1.2, 100, 0, 0, 115 ) --Vendors ped1 = createPed ( 168, 1000.78 ,-1848.05, 12.82 ) ped2 = createPed ( 168, 388.86, -2070.44, 8 ) setPedRotation ( ped1, 155 ) setPedRotation ( ped2, 180 ) function showGUI ( hitPlayer ) triggerClientEvent ( hitPlayer, "showVendorGUI", getRootElement(), hitPlayer ) end addEventHandler ( "onMarkerHit", vendor1, showGUI ) addEventHandler ( "onMarkerHit", vendor2, showGUI ) function hideGUI ( leavePlayer ) triggerClientEvent ( leavePlayer, "hideVendorGUI", leavePlayer ) end addEventHandler ( "onMarkerLeave", vendor1, hideGUI ) addEventHandler ( "onMarkerLeave", vendor2, hideGUI ) addEvent ( "buyFood", true ) addEventHandler ( "buyFood", root, function ( cost ) if ( getPlayerMoney ( client ) < cost ) then return outputChatBox ( "You don't have enough money!", client, 255, 0, 0 ) end if ( cost == 10 ) then outputChatBox ( "(Local) Vendor: There you go sir, have a nice day.", client, 225, 230, 0 ) elseif ( cost == 15 ) then outputChatBox ( "(Local) Vendor: There you go sir, have a nice day.", client, 225, 230, 0 ) elseif ( cost == 20 ) then outputChatBox ( "(Local) Vendor: There you go sir, have a nice day.", client, 225, 230, 0 ) elseif ( cost == 25 ) then outputChatBox ( "(Local) Vendor: There you go sir, have a nice day.", client, 225, 230, 0 ) end takePlayerMoney ( client, cost ) setElementHealth ( client, ( getElementHealth ( client ) + cost ) ) end )
-
You may want to check out this topic: viewtopic.php?f=148&t=40809
-
Yes, it is, the bribe part is optional.
-
And you have the script that removes them inside your map?
-
You're welcome.
-
Proba creandolo justo donde estas.
-
That's right, since the time that displays on "banlist.xml" is the timestamp.
-
Algun error? pusiste el script como server side?
-
What do you mean by "millon seconds"? you can convert seconds to minutes like this: minutes = ( seconds / 60 )
-
marker = {} vehicleCarSpawns = { -- Format: x, y, z, rotation, "Group", {cars} {1476.7, -2776.3, 14.7, -90, "FBI", {596, 597, 598, 599, 579, 490, 528}}, {1523, -2847.8, 0, 180, "FBI", {472, 473, 595}} } addEventHandler ( "onResourceStart", resourceRoot, function ( ) for i,v in ipairs ( vehicleCarSpawns ) do local x, y, z, rot, group, cars = unpack ( vehicleCarSpawns [ i ] ) local r, g, b = unpack ( exports [ '[ROG]Groups' ]:getGangColor ( group ) ) marker [ i ] = createMarker ( x, y, z - 1, "cylinder", 2.3, r, g, b, 150 ) setElementData ( marker [ i ], "markerIndex", i, false ) addEventHandler ( "onMarkerHit", marker [ i ], onSpawnerMarkerHit ) end end ) function onSpawnerMarkerHit ( p ) local index = getElementData ( source, "markerIndex" ) local x, y, z, rot, group, cars = unpack ( vehicleCarSpawns [ index ] ) if ( group == exports [ '[ROG]Groups' ]:getPlayerGang ( p ) ) then triggerClientEvent ( p, "showGroupVehicleSpawners", p, cars, x, y, z ) else triggerClientEvent ( p, "message:centerText", p, "Your not in the ".. group, 5, 255, 0, 0 ) end end vehicle = {} function onDestroyCustomCars() if isElement(vehicle[source]) then destroyElement(vehicle[source]) vehicle[source] = nil end end addEventHandler("onPlayerQuit", root, onDestroyCustomCars) addEvent("onDestroyCustomCars",true) addEventHandler("onDestroyCustomCars",root,onDestroyCustomCars) function onCreateGroupVehicle(id,x,y,z) if (id) then if (isElement(vehicle[source])) then destroyElement(vehicle[source]) end local r,g,b = unpack(exports['[ROG]Groups']:getGangColor(group)) triggerEvent("spawners:destroyOldCars",source) if (tonumber(x) ~= nil) then vehicle[source] = createVehicle(id, x, y, z, 0, 0, rot) else local rx,ry,rz = getElementPosition(source) vehicle[source] = createVehicle(id, rx, ry, rz, 0, 0, 0) end warpPedIntoVehicle(source,vehicle[source]) setElementData(vehicle[source],"vehOwner","spawners",true) setVehicleColor(vehicle[source],r,g,b) end end addEvent("onCreateGroupVehicle",true) addEventHandler("onCreateGroupVehicle",root,onCreateGroupVehicle)
-
Maybe the problem is not with the GUI, maybe is with your table? tried using outputChatBox to see the results when looping the table to insert to the grid list?
-
Sorry, I meant before the for-loop, not under.
-
Export a function which returns the mysql handler, like this: function getMySQLConnection ( ) return connection -- connection is defined at dbConnect. end Then export it on the meta.xml: function="getMySQLConnection" type="server" /> Then you can use it on another resource like this: local connection = exports [ "MySQLResource" ]:getMySQLConnection ( )
-
Lol, why dont you ask everyone about that"Do they have rights". Like TFF has the same edited panel that its much better and also the save system is remaked, ask them then "Do you have a right?" If he's using the script without permission from the author, then we won't help him here.
-
Any errors on debugscript?
-
Maybe the link they mentioned here: http://stackoverflow.com/questions/3890 ... -to-sqlite has a working converter.
-
That would clear it a lot of times. @MADE: Put it under: for i,v in ipairs (cars) do
-
You can't "edit" world objects, you can remove and replace them with new ones.