Jump to content

KariiiM

Members
  • Posts

    1,312
  • Joined

  • Last visited

Everything posted by KariiiM

  1. Chris, if you still need help with that, I can help you out by using team-viewer
  2. KariiiM

    Question

    "onVehicleExplode" event has no parameters, so what you had done with your code is incorrect. Try that, function stopFixxingWhileMoving() if isElement(source) and getElementType(source)=="vehicle" then setPedAnimation(player,false) setElementFrozen (source,false) repairTimer[source] = nil setElementData(source,"repairer",nil) setElementData(player,"repairingvehicle",nil) end end addEventHandler("onVehicleExplode",getRootElement(),stopFixxingWhileMoving)
  3. I saw your pm, try this local clickedElement = nil local absoluteX = nil local absoluteY = nil function addVehScreenInfo (button, state, absX, absY, wx, wy, wz, element) if element and getElementType(element) == "vehicle" then clickedElement = element absoluteX = absX absoluteY = absY removeEventHandler("onClientRender",root,drawtheScene) addEventHandler("onClientRender",root,drawtheScene) setTimer(function() removeEventHandler("onClientRender", root, drawtheScene) end, 2000, 1) end end addEventHandler ("onClientClick", getRootElement(), addVehScreenInfo,true) function drawtheScene() dxDrawRectangle(absoluteX-15,absoluteY-20,300,100,tocolor(0,0,0,75),false) dxDrawText(getVehicleName(clickedElement),absoluteX,absoluteY,300,20,tocolor(255,255,255,255),sx*0.7,"bankgothic") dxDrawText("Driver : " ..getPlayerName(getVehicleOccupants(clickedElement)[0]).."",absoluteX,absoluteY+20,300,20,tocolor(255,255,255,255),sx*0.7,"bankgothic") end
  4. I had sent you the code via pm, check it and tell me the result (not tested)
  5. Well obviously your code is incorrect, I will try to re script it for you
  6. function addVehScreenInfo ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if ( clickedElement ) then local elementType = getElementType ( clickedElement ) if elementType == "vehicle" then local occupants = getVehicleOccupants(clickedElement) function drawtheScene() dxDrawRectangle(absoluteX-15,absoluteY-20,300,100,tocolor(0,0,0,75),false) dxDrawText(getVehicleName(clickedElement),absoluteX,absoluteY,300,20,tocolor(255,255,255,255),sx*0.7,"bankgothic") dxDrawText("Driver : " ..getPlayerName(occupants[0]).."",absoluteX,absoluteY+20,300,20,tocolor(255,255,255,255),sx*0.7,"bankgothic") end addEventHandler("onClientRender",root,drawtheScene) setTimer(function() removeEventHandler("onClientRender", root, drawtheScene) end, 2000, 1) end end end addEventHandler ( "onClientClick", getRootElement(), addVehScreenInfo )
  7. If I had understand you well, check if the resource of Login is running, if so then use removeEventHandler
  8. I am sure the owner of this script just used ALTER to add "name" column.
  9. That wouldn't be possible ,because MTA has own functions and SAMP too.
  10. KariiiM

    SQL Problem

    It depends on how you inserted the data into it.
  11. KariiiM

    SQL Problem

    local connection = exports.database:getSQLConnection() function registerHandler(thePlayer, username, password) local query = dbQuery(connection, "SELECT * FROM accounts WHERE username=? and password=?", username, password) local result, num_affected_rows = dbPoll(query, -1) local account = getAccount(username, password) if (account ~= false) and num_affected_rows == 1 then triggerClientEvent(thePlayer, "registerTaken", root) else account = addAccount(username, password) dbExec(connection, "INSERT INTO accounts (username, password) VALUES ('"..tostring(username).."','"..tostring(password).."')")
  12. KariiiM

    Help me please

    create the object in the server side
  13. btw it's client side, and isPedInVehicle doesn't work there that's why, I changed isPedIn... to getPedOccupiedVehicle
  14. Well, complet server side, addEvent("isAccount",true) addEventHandler("isAccount", root, function () local txd = engineLoadTXD ( "cwmyhb1.txd" ) engineImportTXD ( txd, 162) local dff = engineLoadDFF ( "cwmyhb1.dff", 162) engineReplaceModel ( dff, 162) end) --Server side: addCommandHandler("setSkin", function(player) --Your code triggerClientEvent(player,"isAccount",player) end)
  15. Well try this, it should works function stopAnimation2() local _vehicle = getPedOccupiedVehicle (g_Me) if _vehicle then server.setPedAnimation(g_Me, false) end end
  16. I have no idea the code look fine, or maybe the author of this script, had used alter to the table that's why.
  17. Be sure to add the function name in some where because 'thePlayer' isn't defined
  18. What do you mean? the table doesn't have column onto it?
  19. You just have to change this line local db = dbConnect("mysql", "dbname=gti;host=127.0.0.1", "GTI", "") to local db = dbConnect("sqlite", "database.db")
  20. Yeah true, ana mwafi9 ma3ak He forgot this line in below, I thought he had that in the full code already guiSetVisible(GUIEditor_Image[1], false)
  21. Try this, --Client side: GUIEditor_Image = {} GUIEditor_Image[1] = guiCreateStaticImage(93,439,44,35,"heart.png",false) local sound function trolled() if sound and isElement(sound) then destroyElement(sound) sound = nil end sound = playSound("Heartbeat.mp3", false) setSoundVolume(sound, 1.0) guiSetVisible(GUIEditor_Image[1],true) setTimer(closewin, 3000, 1) end addEvent("dienoob", true) addEventHandler("dienoob", getRootElement(), trolled) function closewin() guiSetVisible(GUIEditor_Image[1], false) end --Server side: addEventHandler("onPlayerWasted", root, function (_, attacker) if (attacker and attacker ~= source and isElement(attacker)) then setElementHealth(attacker, getElementHealth(attacker) + 35 ) triggerClientEvent(attacker,"dienoob",attacker) outputChatBox("[--", attacker, 0, 255, 0, true) end end)
  22. I said wrong because getDistanceBetweenPoints2D won't do what he wants, But yeah this function can works for him only if he wants to create the marker in client side, but logically the job will be used for all players so what I had posted to him would work for him. Also he'll needs to use triggerClientEvent / triggerServerEvent
×
×
  • Create New...