Jump to content

Best-Killer

Members
  • Posts

    494
  • Joined

  • Last visited

Everything posted by Best-Killer

  1. Best-Killer

    Nill

    Not Work
  2. Best-Killer

    Nill

    any help !
  3. Best-Killer

    Nill

    Not Work
  4. Best-Killer

    Nill

    jWin = guiCreateWindow(550,560,200,200,"Vehicle System",false) guiSetVisible(jWin,false) function openGui() guiSetVisible(jWin,true) function spawnveh(button, press, p) if(press) then if(button == "1") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 468, x, y, z, localPlayer) end if(button == "2") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 457, x, y, z, localPlayer) end if(button == "3") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 412, x, y, z, localPlayer) end if(button == "4") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 522, x, y, z, localPlayer) end if(button == "5") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 560, x, y, z, localPlayer) end if(button == "6") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 411, x, y, z, localPlayer) end if(button == "7") then if ( getElementData(p, "VIP") ~= "Silver" ) then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 546, x, y, z, localPlayer) end end end end end addEventHandler("onClientKey", getRootElement(), spawnveh) guiWindowSetSizable(jWin,false) tGrid = guiCreateGridList(0,20,190,170,false,jWin) guiGridListAddColumn(tGrid, "Key", 0.20) guiGridListAddColumn(tGrid, "Name", 0.65) row1 = guiGridListAddRow(tGrid) row2 = guiGridListAddRow(tGrid) row3 = guiGridListAddRow(tGrid) row4 = guiGridListAddRow(tGrid) row5 = guiGridListAddRow(tGrid) row6 = guiGridListAddRow(tGrid) row7 = guiGridListAddRow(tGrid) guiGridListSetItemText(tGrid, row1, 1, tostring(row1+1), false, false) guiGridListSetItemText(tGrid, row1, 2, "Sanchez", false, false) guiGridListSetItemText(tGrid, row2, 1, tostring(row2+1), false, false) guiGridListSetItemText(tGrid, row2, 2, "Caddy", false, false) guiGridListSetItemText(tGrid, row3, 1, tostring(row3+1), false, false) guiGridListSetItemText(tGrid, row3, 2, "Voodoo", false, false) guiGridListSetItemText(tGrid, row4, 1, tostring(row4+1), false, false) guiGridListSetItemText(tGrid, row4, 2, "NRG-500", false, false) guiGridListSetItemText(tGrid, row5, 1, tostring(row5+1), false, false) guiGridListSetItemText(tGrid, row5, 2, "Sultan", false, false) guiGridListSetItemText(tGrid, row6, 1, tostring(row6+1), false, false) guiGridListSetItemText(tGrid, row6, 2, "Infernus", false, false) guiGridListSetItemText(tGrid, row7, 1, tostring(row7+1), false, false) guiGridListSetItemText(tGrid, row7, 2, "Intruder", false, false) end addEvent("markerHitted", true) addEventHandler("markerHitted", getRootElement(), openGui) function hideGui() guiSetVisible(jWin,false) removeEventHandler("onClientKey", getRootElement(), spawnveh) end addEvent("markerLeaved", true) addEventHandler("markerLeaved", getRootElement(), hideGui)
  5. Best-Killer

    Nill

    function spawnveh(button, press, p) if(press) then if(button == "1") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 468, x, y, z, localPlayer) end if(button == "2") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 457, x, y, z, localPlayer) end if(button == "3") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 412, x, y, z, localPlayer) end if(button == "4") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 522, x, y, z, localPlayer) end if(button == "5") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 560, x, y, z, localPlayer) end if(button == "6") then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 411, x, y, z, localPlayer) end if(button == "7") then if ( getElementData(p, "VIP") ~= "Silver" ) then x, y, z = getElementPosition(localPlayer) triggerServerEvent("crVeh", getRootElement(), 546, x, y, z, localPlayer) end line 28 argument 1 got nill
  6. Best-Killer

    Question

    There is way to make 200health to player ???
  7. i won't math bro see what i want the script is bank system account blance showing like that : Account Blance : 42116 but me want it Account Blance : 5445$
  8. You're not trying to learn though. Every time you encounter a problem you post it here instead of trying to solve it yourself. function depoistMoney() local text = tonumber (guiGetText(GUIEditor.edit[2])) local text2 = convertNumber(guiGetText(GUIEditor.edit[1])) if (guiRadioButtonGetSelected(GUIEditor.radiobutton[1])) then if tonumber(text) and getPlayerMoney() >= tonumber(text) and tonumber(text) >= 0 then guiSetText(GUIEditor.edit[1],"Transferring...") setTimer(guiSetText,2000,1,GUIEditor.edit[1],convertNumber(text + text2)) setTimer(takePlayerMoney,2000,1,convertNumber(text)) exports['SAEGMessages']:sendClientMessage ( "You've withdrawn $"..convertNumber(text)" from your bank account", source, 200, 200, 200 ) setElementData(localPlayer,"bankmoney",convertNumber(text + text2)) elseif getPlayerMoney() == 0 then -- exports['SAEGMessages']:sendClientMessage ( "You don't have that ammount money in your bank", 255, 0, 0 ) elseif getPlayerMoney() < 0 then outputChatBox("You can't deposit negative numbers.") end 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 GUIEditor.edit[1] = guiCreateEdit(11, 45, 444, 31,convertNumber(getElementData(localPlayer,"bankmoney")).."$", false, GUIEditor.window[1]) attempt to perform arithmetic on local 'text2' (a string value) (my problem i want add $ after the bank blance ) explain to me easy pls if u want help me cuz i'm fucking nab
  9. Why you don't learn lua? You're abusing help forum. are u kidding me ?? -.- who made the script then if i don't try to learn ?
  10. any help ?
  11. hard
  12. Best-Killer

    how ?

    How To Convert String to Number
  13. error : attempt to call a number value line : 9 function depoistMoney() local text = tonumber (guiGetText(GUIEditor.edit[2])) local text2 = tonumber(guiGetText(GUIEditor.edit[1])) if (guiRadioButtonGetSelected(GUIEditor.radiobutton[1])) then if tonumber(text) and getPlayerMoney() >= tonumber(text) and tonumber(text) >= 0 then guiSetText(GUIEditor.edit[1],"Transferring...") setTimer(guiSetText,2000,1,GUIEditor.edit[1],tonumber(text + text2)) setTimer(takePlayerMoney,2000,1,tonumber(text)) exports['SAEGMessages']:sendClientMessage ( "You've deposited $"..tonumber(text)" from your bank account", source, 200, 200, 200 ) setElementData(localPlayer,"bankmoney",tonumber(text + text2)) elseif getPlayerMoney() == 0 then -- exports['SAEGMessages']:sendClientMessage ( "You don't have that ammount money in your bank", 255, 0, 0 ) elseif getPlayerMoney() < 0 then outputChatBox("You can't deposit negative numbers.") end end end
  14. Sloved But there is way to add $ after the numbers ?
  15. function withdrawMoney() local text = tonumber guiGetText(GUIEditor.edit[2]) local text2 = tonumber guiGetText(GUIEditor.edit[1]) if (guiRadioButtonGetSelected(GUIEditor.radiobutton[2])) then if tonumber(text2) >= tonumber(text) and tonumber(text) > 0 then guiSetText(GUIEditor.edit[1],"Transferring...") setTimer(guiSetText,2000,1,GUIEditor.edit[1],tonumber(text + text2)) setTimer(givePlayerMoney,2000,1,tonumber(text)) setElementData(localPlayer,"bankmoney",tonumber(text2 - text)) elseif tonumber(text2) < tonumber(text) then outputChatBox("You don't have enough money at bank.") elseif tonumber(text) < 0 then outputChatBox("You can't withdraw negative numbers.") end end end line 5 attempt to compare two nill values
  16. Guys There is way to add $ after the numbers ?
  17. ye ye thanks u really u helped me alot <3 Thanks All
  18. GUIEditor.edit[1] = guiCreateEdit(11, 45, 444, 31,tostring(getElementData(localPlayer,"bankmoney")), false, GUIEditor.window[1]) function setZero() if guiGetText(GUIEditor.edit[1]) == "false" then guiSetText(GUIEditor.edit[1],"0$") end end addEventHandler("onClientRender",root,setZero)
  19. function depoistMoney() local text = tonumber (guiGetText(GUIEditor.edit[2])) local text2 = tonumber(guiGetText(GUIEditor.edit[1])) if (guiRadioButtonGetSelected(GUIEditor.radiobutton[1])) then if tonumber(text) and getPlayerMoney() >= tonumber(text) and tonumber(text) >= 0 then guiSetText(GUIEditor.edit[1],"Transferring...") setTimer(guiSetText,2000,1,GUIEditor.edit[1],tonumber(text + text2)) setTimer(takePlayerMoney,2000,1,tonumber(text)) setElementData(localPlayer,"bankmoney",tonumber(text + text2)) elseif getPlayerMoney() == 0 then -- outputChatBox("You don't have enough money.") elseif getPlayerMoney() < 0 then outputChatBox("You can't deposit negative numbers.") end end end same problem please guys explain to me easy i'm learning attempt to perform arithmetic on local 'text2' ( a nill value)
  20. function depoistMoney() local text = guiGetText(GUIEditor.edit[2]) local text2 = guiGetText(GUIEditor.edit[1]) if (guiRadioButtonGetSelected(GUIEditor.radiobutton[1])) then if tonumber(text) and getPlayerMoney() >= tonumber(text) and tonumber(text) >= 0 then guiSetText(GUIEditor.edit[1],"Transferring...") setTimer(guiSetText,2000,1,GUIEditor.edit[1],tostring(text + text2)) setTimer(takePlayerMoney,2000,1,tonumber(text)) setElementData(localPlayer,"bank.money",tonumber(text + text2)) elseif getPlayerMoney() == 0 then -- outputChatBox("You don't have enough money.") elseif getPlayerMoney() < 0 then outputChatBox("You can't deposit negative numbers.") end end end line 7 ( attempt to perform arithmetic on local 'text2' ( a string value)
  21. server side : function onPlayerLogin(per,cur) name = getAccountName(cur) money = getAccountData(account,"bank.money") setElementData(source,"bank.money",money) setElementData(source,"account",cur) setElementData(source,"accountName",name) end addEventHandler("onPlayerLogin",root,onPlayerLogin) function onPlayerLogout() account = getPlayerAccount(source) money = getElementData(source,"bank.money") setAccountData(account,"bank.money",money) end addEventHandler("onPlayerQuit",root,onPlayerLogout) function giveMoneyOnLog() local bankmoney = getElementData(source,"bank.money") local playermoney = getPlayerMoney(source) if bankmoney == "0" and playermoney == 0 then setElementData(source,"bank.money","5000") outputChatBox("Your current bank balance: $"..getElementData(source,"bank.money"),source) end end addEventHandler("onPlayerLogin",root,giveMoneyOnLog)
  22. nothing shoing nothing shoing same problem 0 errors 0 warnings
  23. thanks bro function depoistMoney() local text = guiGetText(GUIEditor.label[2]) local text2 = guiGetText(GUIEditor.edit[2]) if (guiRadioButtonGetSelected(GUIEditor.radiobutton[1])) then if tonumber(text) and getPlayerMoney(localPlayer) >= tonumber(text) and tonumber(text) >= 0 then guiSetText(cashLabel,"Transferring...") setTimer(guiSetText,2000,1,cashLabel,tostring(text + text2)) setTimer(takePlayerMoney,2000,1,tonumber(text)) setElementData(localPlayer,"bank.money",tonumber(text + text2)) elseif getPlayerMoney() then -- outputChatBox("You don't have enough money.") elseif tonumber(text) < 0 then outputChatBox("You can't deposit negative numbers.") end end end now work but when click deposit it's says You don't have enough money and i have money what is the problem
  24. attempt to compare number with nill function depoistMoney() local text = guiGetText(GUIEditor.label[2]) local text2 = guiGetText(GUIEditor.edit[2]) if (guiRadioButtonGetSelected(GUIEditor.radiobutton[1])) then if tonumber(text) and getPlayerMoney(localPlayer) >= tonumber(text) and tonumber(text) >= 0 then guiSetText(cashLabel,"Transferring...") setTimer(guiSetText,2000,1,cashLabel,""..tostring(text + text2)) setTimer(takePlayerMoney,2000,1,tonumber(text)) setElementData(localPlayer,"bank.money",tonumber(text + text2)) elseif getPlayerMoney(localPlayer) < tonumber(text) then outputChatBox("You don't have enough money.") elseif tonumber(text) < 0 then outputChatBox("You can't deposit negative numbers.") end end end Line 10
  25. Best-Killer

    example

    example for ATM System pls pls pls
×
×
  • Create New...