Jump to content

KariiiM

Members
  • Posts

    1,312
  • Joined

  • Last visited

Everything posted by KariiiM

  1. function hidingaVehicle(player, command) local vehicle = getVehicleByID(id) if isElement(vehicle) then local data = dbPoll(dbQuery(db, "SELECT * FROM VehicleList WHERE Account = ? AND ID = ?", getAccountName(getPlayerAccount(player)), id), -1) if type(data) == "table" and #data ~= 0 then local aman = getVehicleOccupant(vehicle) destroyVehicle(vehicle) if isElement(player) and playerVehicles[player] then for i=1,#playerVehicles[player] do if playerVehicles[player][i] == vehicle then table.remove(playerVehicles[player],i) break end end else playerVehicles[player] = nil end outputChatBox("You destroy your vehicle", player, 255, 0, 0) cur = getElementData(player,"spawnedcars") or {} for ind,veh in ipairs(cur) do if veh == getVehicleNameFromModel(data[1]["Model"]) then table.remove(cur,ind) end end setElementData(player,"spawnedcars",cur) else outputChatBox("No vehicle is spawned", player, 255, 0, 0) end else outputChatBox("No vehicle is spawned ", player, 255, 0, 0) end end addCommandHandler ( "hide", hidingaVehicle )
  2. What's wrong with this code?
  3. Btw bindKey ( player, "enter", "down", clientSubmitLogin ) You're using player outside the function plus not defined and after all it's client side and there's no player argument.
  4. What do you mean by "your Handling set to 0 then"?
  5. KariiiM

    CPU Usage.

    I just started scripting it But anyway thanks alot
  6. KariiiM

    Few questions.

    There are alot of examples at the wiki, check the link in below. Click_Here!
  7. KariiiM

    CPU Usage.

    Well thanks for all these answers I'll go ahead and try that.
  8. By the way, It won't works, if your table is empty.
  9. Hey, what you have coded was totally, wrong, try that function saveData() local account = getPlayerAccount(source) if (not account or isGuestAccount(account)) then return end local lastname = getPlayerName(source) -- Last name dbExec(db, "UPDATE banking SET lastname=? WHERE name='"..tostring(account).."'LIMIT 1", lastname) end addEventHandler("onPlayerQuit", root, saveData) addEventHandler("onPlayerLogout", root, saveData)
  10. KariiiM

    Solved.

    Try that, local registerBut = guiCreateButton( 298, 570, 127, 42, "Create my account", false, regWnd) local username = guiCreateEdit(13, 316, 223, 33, "", false, regWindow) local nameLabel = guiCreateLabel(292, 42, 115, 25, "Enter a name", false, regWindow) guiSetFont(nameLabel, "clear-normal") guiLabelSetColor(nameLabel, 247, 0, 0) addEventHandler("onClientGUIChanged", guiRoot, function () local text = guiGetText(username) if (text ~= "") then guiSetText(nameLabel, "Available name!") end end)
  11. KariiiM

    Solved.

    Try that, [lua]local registerBut = guiCreateButton( 298, 570, 127, 42, "Create my account", false, regWnd) local username = guiCreateEdit(13, 316, 223, 33, "", false, regWindow) local nameLabel = guiCreateLabel(292, 42, 115, 25, "Enter a name", false, regWindow) guiSetFont(nameLabel, "clear-normal") guiLabelSetColor(nameLabel, 247, 0, 0) addEventHandler("onClientGUIChanged", guiRoot, function () local text = guiGetText(username) if (text ~= "") then guiSetText(nameLabel, "Available name!") end end) [/lua]
  12. KariiiM

    Solved.

    Here you go, local registerBut = guiCreateButton( 298, 570, 127, 42, "Create my account", false, regWnd) local username = guiCreateEdit(13, 316, 223, 33, "", false, regWindow) local nameLabel = guiCreateLabel(292, 42, 115, 25, "Enter a name", false, regWindow) guiSetFont(nameLabel, "clear-normal") guiLabelSetColor(nameLabel, 247, 0, 0) addEventHandler("onClientGUIClick", guiRoot, function () if (source == registerBut) then local text = guiGetText(username) if (text ~= "") then guiSetText(nameLabel, "Available name!") end end end)
  13. KariiiM

    Solved.

    Is there's a button to click on?
  14. KariiiM

    Solved.

    Dude show the full code, if you automaticly posted what I have edited to your notepad, it won't work.
  15. KariiiM

    Solved.

    Simply, just check if the editbox is not empty that's mean it has some characters onto it. Try that and tell me the result. function nameLabel() local text = guiGetText(GUIEditor.edit[1]) if (text ~= "") then guiSetText(GUIEditor.label[2], "Available name!") end end Good luck.
  16. KariiiM

    Solved.

    Ah, so post what you have tried and I'll correct it
  17. KariiiM

    CPU Usage.

    Hello dear scripters, I want to ask if there's a way to check out how many CPU usage used for each script. Is there's a way? Best Regards, KariM
  18. KariiiM

    Solved...

    Hmm, as far as the event onPickupLeave not exists, it's possible to make a custom event, You'll have to get the distance between the player and the pickup for example if the distance is more than 2meters then unbind the key. Use these functions getDistanceBetweenPoints3D --or getDistanceBetweenPoints2D unbindKey
  19. KariiiM

    Solved...

    What you want to do and can you explain your problem more better?
  20. Glad to hear that, btw can I know how did you fix it? because what I had sent to you seem correct
×
×
  • Create New...