Jump to content

xeon17

Members
  • Posts

    1,903
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by xeon17

  1. To update a text you can do something like this: I made this example for you , didn't tested it , but it should work well theText = 'Status: Outside ColShape' RadarArea(-336.51535, 1016.52850,380,200,255,255,255,150) Area = ColShape.Rectangle(-336.51535, 1016.52850,380,200) addEventHandler('onClientElementColShapeHit',resourceRoot, function (matchingDimension) if source.type == 'player' and source == localPlayer and matchingDimension then theText = 'Status: in ColShape' end end) addEventHandler('onClientElementColShapeLeave',resourceRoot, function (matchingDimension) if source.type == 'player' and source == localPlayer and matchingDimension then theText = 'Status: Outside ColShape' end end) function Render () dxDrawText ( theText,44,screenHeight-43 screenWidth,screenHeight,tocolor(255,255,255,255),1,"pricedown") end addEventHandler('onClientRender',root,Render)
  2. Thanks for the tip and happy birthday .:CiBeR:. the save system is almost finished but i keep geting a error in the line where i update the data. I don't know what's wrong here. Database.getInstance():execute('UPDATE Accounts SET Name=?,Serial=?,IP=?,Email=?,Money=?,Health=?,Armour=?,PlayerPositionX=?,PlayerPositionY=?,PlayerPositionZ=?,Skin=?,Interior=?,Rotation=?,Dimension=?,Team=?,Weapons=?,Stats=?,WHERE Username=?',name,serial,ip,email,money,health,armor,x,y,z,skin,int,rotation,dim,team,oruzije,Stats,account)
  3. I've solved the problem by using INSERT INTO instead of UPDATE with the help of two friends on Skype.
  4. Hello there, I'm trying to create some kind of save system using SQLite database but it doesn't save the data of players. The database is successfully created but it doesn't update the rows with newest player data. Also , it output in chatbox that the data is saved. About debugscript , there aren't any errors or warrings. Here is my code: Database.getInstance():execute( "CREATE TABLE IF NOT EXISTS Accounts (Username VARCHAR(200),Serial VARCHAR(50),IP VARCHAR(20),Money INT,Health INT,Armour INT,x VARCHAR(20),y VARCHAR(20),z VARCHAR(20),Rotation INT,Skin INT,Interior INT,Dimension INT,Team VARCHAR(20),Weapons TEXT,Stats TEXT)") local WeaponStats = { ['9mm'] = 0, ['silenced'] = 0, ['deagle'] = 0, ['shotgun'] = 0, ['combat_shotgun'] = 0, ['micro_smg'] = 0, ['mp5'] = 0, ['ak47'] = 0, ['m4'] = 0, ['tec-9'] = 0, ['sniper_rifle'] = 0 } function saveAccount () for i,player in ipairs (getElementsByType('player')) do if (not isGuestAccount(getPlayerAccount (player))) then local account = player.account:getName() local x, y, z = player:getPosition() local money, health = player.money,player.health local armor, skin = player.armor,player.model local int, dim = player.interior,player.dimension local rotation = player.rotation local ip = player.ip local serial = player.serial local team = "Nezaposleni" local Stats = toJSON(WeaponStats) local weapons = {} if ( player.team) then team = player.team:getName() end for i=1,12 do weapons[i] = { player:getWeapon(weaponSlot), player:getTotalAmmo(weaponSlot)} end local oruzije = toJSON ( weapons ) Database.getInstance():execute('UPDATE Accounts SET Username=?,Serial=?,IP=?,Money=?,Health=?,Armour=?,x=?,y=?,z=?,Skin=?,Interior=?,Rotation=?,Dimension=?,Team=?,Weapons=?,Stats=?',account,serial,ip,money,health,armor,x,y,z,skin,int,rotation,dim,team,oruzije,Stats) outputChatBox('Core: Data successfully saved',player,0,255,0) end end end addEventHandler('onResourceStart',resourceRoot,saveAccount) Note, i'm still a begginer in SQLite database so please if i did something wrong , expain everything well for me so in future i won't make the same mistake. Thank you.
  5. From here you have this from?
  6. You need a example? why don't you download some level system resources from the community and see how they work?
  7. xeon17

    HELP ME

    If i understood you well , you had problems updating your MTA Client. You can find the latest MTA Client/Server bilids here: https://nightly.multitheftauto.com/
  8. Sim, mas o servidor estava offline e eu embora ele não corrigiu o problema ainda. E uma dica para você, não há necessidade de usar este smyle, você parece um retardado.
  9. O problema já foi resolvido... Como voce sabe?
  10. xeon17

    SQL base

    We don't give support with stolen scripts ( which in your case are stolen from the Vallhalla MTA RolePlay gamemode )
  11. Mostre-me um screenshot de port forwarding em seu roteador, também mostre seu mtaserver.conf.
  12. xeon17

    SQL base

    Why don't you just post your script here? And please visit this topic: viewtopic.php?f=91&t=47897
  13. xeon17

    SQL base

    This is a public forum , if you expect some help and don't want to share your code then i don't see any way how someone could help you.
  14. Ok giv me the job hooker zip ???????????????????????????//////// Why you're still not banned?
  15. No, it's only for custom weapons.
  16. Show me where you've defined weaponslot
  17. getPlayerWeapon is deprecated use getPedWeapon instead. local fireRate = getWeaponProperty ( getPedWeapon(localPlayer, weaponslot) , "poor" , "anim_loop_start" )
  18. xeon17

    Help-me pls?

    You got a type on line 9 , friend.
  19. xeon17

    Staff panel bug

    Maybe use getPlayerName ?
  20. xeon17

    Staff panel bug

    There isn't any function onClientPlayerChat also onPlayerChat is only server-side.
  21. You have to post the screenshots here , or are you afraid that someone see that you edited or stoled the scripts?
  22. Another good tutorial by you, good job!
  23. Good tutorial , keep it up.
  24. function playGunfireSound() local muzzleX, muzzleY, muzzleZ = getPedWeaponMuzzlePosition ( source ) local px, py, pz = getElementPosition ( source ) local weapon = getPedWeapon ( source ) local current_1 = getElementData(source,"currentweapon_1") local current_2 = getElementData(source,"currentweapon_2") if not weapon then return end if weapon == 25 and current_1 == "Winchester 1866" then local sound = playSound3D("soundweapons/Winchester .wav", muzzleX, muzzleY, muzzleZ) setSoundMaxDistance(sound, 185) setSoundMinDistance(sound, 1) setSoundVolume(sound, 1.0) end end addEventHandler("onClientPlayerWeaponFire",getRootElement(),playGunfireSound) --------------------------------------------------------------------------------->>
  25. createWeapon createObject attachElements
×
×
  • Create New...