Jump to content

SirniNamaz

Members
  • Posts

    138
  • Joined

  • Last visited

Everything posted by SirniNamaz

  1. i tried that too and it doesnt work
  2. my customblips is running and i am using resource on clientside, the code i copied from here: https://wiki.multitheftauto.com/wiki/Res ... ustomblips line 3: customblip exports.customblips:createCustomBlip ( 2521.1252441406, -1290.2532958984, 16, 16, "pill.png" ) on debugscript 3 is says: WARNING: Loading script failed: MOD_Base\blips.lua:3: '=' expected near 'exports'
  3. nevermind found a sulution (it is actually 'tonumber', not 'toNumber'
  4. client function actBuyBD () playermoney = getPlayerMoney(source) hitsnum = toNumber(guiGetText(txtAmountBD)) drugpriceCan = hitsnum*264 drugpriceOpi = hitsnum*94 drugprice1 = drugpriceCan-1 drugprice2 = drugpriceOpi-1 if (guiRadioButtonGetSelected(rdoCannabisBD)) then if (playermoney > drugprice1) then playermoney=playermoney-drugpriceCan guiSetText(lblCannabis,guiGetText(lblCannabis)+toNumber(hitsnum)) else outputChatBox("No Money!") end end if (guiRadioButtonGetSelected(rdoOpiumBD)) then if (playermoney > drugprice2) then playermoney=playermoney-drugpriceOpi guiSetText(lblOpium,guiGetText(lblOpium)+toNumber(hitsnum)) else outputChatBox("No Money!") end end end addEvent( "actBuyBD", true ) addEventHandler( "actBuyBD", getRootElement(), actBuyBD)
  5. its created under 'onClientResourceStart' handler, no errors in console
  6. When i go in the marker it doesnt show up gui Client: addEvent("mrkMakeDrugC",true) addEventHandler("mrkMakeDrugC",getRootElement(), function() activateDrugSystem = "false" guiSetVisible(guiMakingDrugs,true) end) Server: mrkMakeDrug1 = createMarker(2560.2534179688, -1304.4836425781, 1044.125, "cylinder", 1) setElementInterior (mrkMakeDrug1, 2) function mrkMakeDrug() triggerClientEvent(source,"mrkMakeDrugC",getRootElement()) end addEventHandler("onMarkerHit", mrkMakeDrug1, mrkMakeDrug)
  7. thanks, idk how i repleaced interior with dimension
  8. double checked everything, it should work but it doesnt
  9. I made a script that should spawn a ped, but it doesn't? function pedLoadSt () DrugGuard1 = createPed (111, 2581.0087890625, -1286.1293945313, 1044.125) setElementDimension (DrugGuard1, 2) setPedRotation(DrugGuard1, 90) setPedAnimation( DrugGuard1, "BAR", "barcustom_loop") end addEventHandler ( "onResourceStart", getResourceRootElement(), pedLoadSt )
  10. i have been driving arount the city and i noticed big hole in one building (usually there is drug making place) and i got in in and fall down than i got reseted.. so is it possible to close it with scripting or mapping
  11. how to trigger client event (from client) every few seconds
  12. im stuck here, basically i have drug system and when client quits it should save the drugs, but it cant trigger the server event becouse user already went offline.. is there a solution function oncQuit() amountCannabis = guiGetText(lblCannabis) amountHeroin = guiGetText(lblHeroin) amountCocaine = guiGetText(lblCocaine) amountLSD = guiGetText(lblLSD) amountEcstasy = guiGetText(lblEcstasy) amountOpium = guiGetText(lblOpium) triggerServerEvent("saveDrugAmount",getLocalPlayer(),amountCannabis,amountHeroin,amountCocaine,amountLSD,amountEcstasy,amountOpium) end addEventHandler("onClientPlayerQuit",getRootElement(),oncQuit)
  13. is there server code that can get label value text from client (not client sending value to server)
  14. result: false,false,fasle,fasle,fasle,false
  15. thanks i think it fixed it, but there is also problem with this: if (amountCannabis2) then triggerClientEvent (source, "outputDrug2", getRootElement(), amountCannabis2, amountHeroin2, amountCocaine2, amountLSD2, amountEcstasy2, amountOpium2 ) else triggerClientEvent(source,"firstTime",getRootElement()) end when i have 0 cannabis computer thinks its false and he resets my resources
  16. well it doesnt save my drug amount
  17. CLIENT: function trolo() x,y = guiGetScreenSize() guiDrugs = guiCreateWindow(x-285-20,y-253-20,285,253,"F3 - Drug Manager",false) lblDrug = guiCreateLabel(17,31,32,16,"Drug:",false,guiDrugs) lblAmount = guiCreateLabel(203,31,50,15,"Amount:",false,guiDrugs) rdoCannabis = guiCreateRadioButton(15,55,135,17,"Cannabis",false,guiDrugs) guiRadioButtonSetSelected(rdoCannabis,true) rdoHeroin = guiCreateRadioButton(15,79,135,17,"Heroin",false,guiDrugs) rdoCocaine = guiCreateRadioButton(15,104,135,17,"Cocaine",false,guiDrugs) rdoLSD = guiCreateRadioButton(15,129,135,17,"LSD",false,guiDrugs) rdoEcstasy = guiCreateRadioButton(15,154,135,17,"Ecstasy",false,guiDrugs) rdoOpium = guiCreateRadioButton(15,180,135,17,"Opium",false,guiDrugs) btnTakeHit = guiCreateButton(39,208,96,30,"Take a Hit",false,guiDrugs) btnSell = guiCreateButton(145,208,96,30,"Sell",false,guiDrugs) lblCannabis = guiCreateLabel(200,54,54,14,"0",false,guiDrugs) guiLabelSetVerticalAlign(lblCannabis,"center") guiLabelSetHorizontalAlign(lblCannabis,"center",false) lblHeroin = guiCreateLabel(200,76,54,14,"0",false,guiDrugs) guiLabelSetVerticalAlign(lblHeroin,"center") guiLabelSetHorizontalAlign(lblHeroin,"center",false) lblCocaine = guiCreateLabel(200,102,54,14,"0",false,guiDrugs) guiLabelSetVerticalAlign(lblCocaine,"center") guiLabelSetHorizontalAlign(lblCocaine,"center",false) lblLSD = guiCreateLabel(200,127,54,14,"0",false,guiDrugs) guiLabelSetVerticalAlign(lblLSD,"center") guiLabelSetHorizontalAlign(lblLSD,"center",false) lblEcstasy = guiCreateLabel(200,153,54,14,"0",false,guiDrugs) guiLabelSetVerticalAlign(lblEcstasy,"center") guiLabelSetHorizontalAlign(lblEcstasy,"center",false) lblOpium = guiCreateLabel(200,179,54,14,"0",false,guiDrugs) guiLabelSetVerticalAlign(lblOpium,"center") guiLabelSetHorizontalAlign(lblOpium,"center",false) guiSetVisible(guiDrugs,false) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),trolo) function drugShowHide () if (guiGetVisible(guiDrugs)==false) then guiSetVisible(guiDrugs,true) showCursor(true) else guiSetVisible(guiDrugs,false) showCursor(false) end end bindKey("F3","down",drugShowHide) function oncQuit() amountCannabis = guiGetText(lblCannabis) amountHeroin = guiGetText(lblHeroin) amountCocaine = guiGetText(lblCocaine) amountLSD = guiGetText(lblLSD) amountEcstasy = guiGetText(lblEcstasy) amountOpium = guiGetText(lblOpium) triggerServerEvent("saveDrugAmount",getLocalPlayer(),getLocalPlayer(),amountCannabis,amountHeroin,amountCocaine,amountLSD,amountEcstasy,amountOpium) end addEventHandler("onClientPlayerQuit",getRootElement(),oncQuit) function outputDrug (var1, var2, var3, var4, var5, var6) guiSetText ( lblCannabis,var1) guiSetText ( lblHeroin,var2) guiSetText ( lblCocaine,var3) guiSetText ( lblLSD,var4) guiSetText ( lblEcstasy,var5) guiSetText ( lblOpium,var6) end addEvent( "outputDrug2", true ) addEventHandler( "outputDrug2", getRootElement(), outputDrug ) addEvent("firstTime",true) addEventHandler("firstTime",getRootElement(), function() outputChatBox ("Test Measage") guiSetText(lblCannabis,"0") guiSetText(lblHeroin,"0") guiSetText(lblCocaine,"0") guiSetText(lblLSD,"0") guiSetText(lblEcstasy,"0") guiSetText(lblOpium,"0") end) SERVER: addEvent("saveDrugAmount",true) addEventHandler("saveDrugAmount",getRootElement(), function(player,amountCannabisS,amountHeroinS,amountCocaineS,amountLSDS,amountEcstasyS,amountOpiumS) playeraccount = getPlayerAccount(player) if (playeraccount) then setAccountData(playeraccount,"amountCannabis",tonumber(amountCannabisS)) setAccountData(playeraccount,"amountHeroin",tonumber(amountHeroinS)) setAccountData(playeraccount,"amountCocaine",tonumber(amountCocaineS)) setAccountData(playeraccount,"amountLSDS",tonumber(amountLSDS)) setAccountData(playeraccount,"amountEcstasy",tonumber(amountEcstasyS)) setAccountData(playeraccount,"amountOpium",tonumber(amountOpiumS)) end end) function loadDrugAmount() playeraccount = getPlayerAccount(source) if (playeraccount) then amountCannabis2 = getAccountData(playeraccount,"amountCannabis") amountHeroin2 = getAccountData(playeraccount,"amountHeroin") amountCocaine2 = getAccountData(playeraccount,"amountCocaine") amountLSD2 = getAccountData(playeraccount,"amountLSDS") amountEcstasy2 = getAccountData(playeraccount,"amountEcstasy") amountOpium2 = getAccountData(playeraccount,"amountOpium") if (amountCannabis2) then triggerClientEvent (source, "outputDrug2", getRootElement(), amountCannabis2, amountHeroin2, amountCocaine2, amountLSD2, amountEcstasy2, amountOpium2 ) else triggerClientEvent(source,"firstTime",getRootElement()) end end end addEventHandler("onPlayerLogin",getRootElement(),loadDrugAmount) it doesnt work, someone said i need to put something in a database (internal.db) but i dont know how..
  18. thankyou it works, also i have a small question: is it possible to edit this database where (drug is saved) outside mta,
  19. it still shows 'false', but maybe its becouse i have 0 drugs and computer thinks 0 is 'false' and 1 is 'true', is there any way to view this database with any tool and edit it
×
×
  • Create New...