Jump to content

reeshan

Members
  • Posts

    19
  • Joined

  • Last visited

reeshan's Achievements

Square

Square (6/54)

0

Reputation

  1. my problem is that i want to use the same script for save items after death....... how/where do i put the OnPlayerWasted
  2. Here is my script for save on quit and login i want to make it save on respawn also. if a person dies and come back with same weapon and money, so that the money,skin and weapon will not change except if the player uses or changes it. thx in advance. My current quit and login save script: function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local x,y,z = getElementPosition (source) setAccountData ( playeraccount, "s.HandMoney", getPlayerMoney ( source ) ) setAccountData (playeraccount, "s.skin", tostring (getPedSkin (source))) setAccountData (playeraccount, "s.x", x) setAccountData (playeraccount, "s.y", y) setAccountData (playeraccount, "s.z", z) setAccountData (playeraccount, "s.int", getElementInterior (source)) setAccountData (playeraccount, "s.dim", getElementDimension (source)) setAccountData (playeraccount, "s.rot", getPlayerRotation (source)) setAccountData (playeraccount, "s.weap0", getPedWeapon ( source, 0 )) setAccountData (playeraccount, "s.weap1", getPedWeapon ( source, 1 )) setAccountData (playeraccount, "s.weap2", getPedWeapon ( source, 2 )) setAccountData (playeraccount, "s.ammo2", getPedTotalAmmo ( source, 2 )) setAccountData (playeraccount, "s.weap3", getPedWeapon ( source, 3 )) setAccountData (playeraccount, "s.ammo3", getPedTotalAmmo ( source, 3 )) setAccountData (playeraccount, "s.weap4", getPedWeapon ( source, 4 )) setAccountData (playeraccount, "s.ammo4", getPedTotalAmmo ( source, 4 )) setAccountData (playeraccount, "s.weap5", getPedWeapon ( source, 5 )) setAccountData (playeraccount, "s.ammo5", getPedTotalAmmo ( source, 5 )) setAccountData (playeraccount, "s.weap6", getPedWeapon ( source, 6 )) setAccountData (playeraccount, "s.ammo6", getPedTotalAmmo ( source, 6 )) setAccountData (playeraccount, "s.weap7", getPedWeapon ( source, 7 )) setAccountData (playeraccount, "s.ammo7", getPedTotalAmmo ( source, 7 )) setAccountData (playeraccount, "s.weap8", getPedWeapon ( source, 8 )) setAccountData (playeraccount, "s.ammo8", getPedTotalAmmo ( source, 8 )) setAccountData (playeraccount, "s.weap9", getPedWeapon ( source, 9 )) setAccountData (playeraccount, "s.ammo9", getPedTotalAmmo ( source, 9 )) setAccountData (playeraccount, "s.weap10", getPedWeapon ( source, 10 )) setAccountData (playeraccount, "s.weap11", getPedWeapon ( source, 11 )) setAccountData (playeraccount, "s.weap12", getPedWeapon ( source, 12 )) end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) local root = getRootElement() addEventHandler("onPlayerLogin", root, function() local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "s.HandMoney" ) if ( playermoney ) then setPlayerMoney ( source, playermoney ) end local playerInt = getAccountData (playeraccount, "s.int") local playerDim = getAccountData (playeraccount, "s.dim") local playerSkin = getAccountData (playeraccount, "s.skin") local playerX = getAccountData (playeraccount, "s.x") local playerY = getAccountData (playeraccount, "s.y") local playerZ = getAccountData (playeraccount, "s.z") local playerRot = getAccountData (playeraccount, "s.rot") spawnPlayer(source, playerX, playerY, playerZ, playerRot, playerSkin, playerInt, playerDim) fadeCamera (source, true) setCameraTarget (source, source) local weap0 = getAccountData(playeraccount, "s.weap0") local weap1 = getAccountData(playeraccount, "s.weap1") local weap2 = getAccountData(playeraccount, "s.weap2") local ammo2 = getAccountData(playeraccount, "s.ammo2") local weap3 = getAccountData(playeraccount, "s.weap3") local ammo3 = getAccountData(playeraccount, "s.ammo3") local weap4 = getAccountData(playeraccount, "s.weap4") local ammo4 = getAccountData(playeraccount, "s.ammo4") local weap5 = getAccountData(playeraccount, "s.weap5") local ammo5 = getAccountData(playeraccount, "s.ammo5") local weap6 = getAccountData(playeraccount, "s.weap6") local ammo6 = getAccountData(playeraccount, "s.ammo6") local weap7 = getAccountData(playeraccount, "s.weap7") local ammo7 = getAccountData(playeraccount, "s.ammo7") local weap8 = getAccountData(playeraccount, "s.weap8") local ammo8 = getAccountData(playeraccount, "s.ammo8") local weap9 = getAccountData(playeraccount, "s.weap9") local ammo9 = getAccountData(playeraccount, "s.ammo9") local weap10 = getAccountData(playeraccount, "s.weap10") local weap11 = getAccountData(playeraccount, "s.weap11") local weap12 = getAccountData(playeraccount, "s.weap12") giveWeapon ( source, weap0, 1 ) giveWeapon ( source, weap1, 1 ) giveWeapon ( source, weap2, ammo2 ) giveWeapon ( source, weap3, ammo3 ) giveWeapon ( source, weap4, ammo4 ) giveWeapon ( source, weap5, ammo5 ) giveWeapon ( source, weap6, ammo6 ) giveWeapon ( source, weap7, ammo7 ) giveWeapon ( source, weap8, ammo8 ) giveWeapon ( source, weap9, ammo9 ) giveWeapon ( source, weap10, 1 ) giveWeapon ( source, weap11, 1 ) giveWeapon ( source, weap12, 1 ) end end )
  3. i got this error [2013-08-25 14:16:55] start: Requested by Console [2013-08-25 14:16:55] Starting dev [2013-08-25 14:16:55] SCRIPT ERROR: dev\dev.lua:9: ')' expected (to close '(' at line 1) near 'end' [2013-08-25 14:16:55] WARNING: Loading script failed: dev\dev.lua:9: ')' expected (to close '(' at line 1) near 'end' [2013-08-25 14:16:55] start: Resource 'dev' started [2013-08-25 14:17:39] restart: Requested by Console [2013-08-25 14:17:39] restart: Resource restarting... [2013-08-25 14:17:39] Stopping dev [2013-08-25 14:17:40] Resource 'dev' changed, reloading and starting [2013-08-25 14:17:40] Starting dev [2013-08-25 14:17:40] SCRIPT ERROR: dev\dev.lua:10: ')' expected (to close '(' at line 2) near 'end' [2013-08-25 14:17:40] WARNING: Loading script failed: dev\dev.lua:10: ')' expected (to close '(' at line 2) near 'end' [2013-08-25 14:17:40] dev restarted successfully
  4. i don't know how to use it can u make a direct lua for me
  5. how do i turn it on and i want to use the showcol
  6. it dosen't work at all, try it i don't know whats wrong.
  7. yeah!, i tried without adding ur script it still dosent work can u help me out...!!! how can i make this work
  8. the whole script it dident work
  9. it works but i want -350 cash on death
  10. i want to make a system that will save everything on death and on login in and logout the things i want to save is weapon skills, zombie kills, player deaths, hours played, money and skin. i also want to -350 cash on death function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "funmodev2-money") if (accountData) then local playerMoney = getAccountData (theCurrentAccount, "funmodev2-money") local playerSkin = getAccountData (theCurrentAccount, "funmodev2-skin") local playerHealth = getAccountData (theCurrentAccount, "funmodev2-health") local playerArmor = getAccountData (theCurrentAccount, "funmodev2-armor") local R = getAccountData (theCurrentAccount, "funmodev2-R") local G = getAccountData (theCurrentAccount, "funmodev2-G") local B = getAccountData (theCurrentAccount, "funmodev2-B") local playerX = getAccountData (theCurrentAccount, "funmodev2-x") local playerY = getAccountData (theCurrentAccount, "funmodev2-y") local playerZ = getAccountData (theCurrentAccount, "funmodev2-z") local playerInt = getAccountData (theCurrentAccount, "funmodev2-int") local playerDim = getAccountData (theCurrentAccount, "funmodev2-dim") local playerWanted = getAccountData (theCurrentAccount, "funmodev2-wantedlevel") local playerWeaponID0 = getAccountData (theCurrentAccount, "funmodev2-weaponID0") local playerWeaponID1 = getAccountData (theCurrentAccount, "funmodev2-weaponID1") local playerWeaponID2 = getAccountData (theCurrentAccount, "funmodev2-weaponID2") local playerWeaponID3 = getAccountData (theCurrentAccount, "funmodev2-weaponID3") local playerWeaponID4 = getAccountData (theCurrentAccount, "funmodev2-weaponID4") local playerWeaponID5 = getAccountData (theCurrentAccount, "funmodev2-weaponID5") local playerWeaponID6 = getAccountData (theCurrentAccount, "funmodev2-weaponID6") local playerWeaponID7 = getAccountData (theCurrentAccount, "funmodev2-weaponID7") local playerWeaponID8 = getAccountData (theCurrentAccount, "funmodev2-weaponID8") local playerWeaponID9 = getAccountData (theCurrentAccount, "funmodev2-weaponID9") local playerWeaponID10 = getAccountData (theCurrentAccount, "funmodev2-weaponID10") local playerWeaponID11 = getAccountData (theCurrentAccount, "funmodev2-weaponID11") local playerWeaponID12 = getAccountData (theCurrentAccount, "funmodev2-weaponID12") local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo0") local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo1") local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo2") local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo3") local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo4") local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo5") local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo6") local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo7") local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo8") local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo9") local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo10") local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo11") local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "funmodev2-weaponAmmo12") local skill0 = getAccountData(theCurrentAccount, "z.skill0") local skill1 = getAccountData(theCurrentAccount, "z.skill1") local skill2 = getAccountData(theCurrentAccount, "z.skill2") local skill3 = getAccountData(theCurrentAccount, "z.skill3") local skill4 = getAccountData(theCurrentAccount, "z.skill4") local skill5 = getAccountData(theCurrentAccount, "z.skill5") local skill6 = getAccountData(theCurrentAccount, "z.skill6") local skill7 = getAccountData(theCurrentAccount, "z.skill7") local skill8 = getAccountData(theCurrentAccount, "z.skill8") local skill9 = getAccountData(theCurrentAccount, "z.skill9") local skill10 = getAccountData(theCurrentAccount, "z.skill10") spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim) setPlayerMoney (source, playerMoney) setTimer (setElementHealth, 500, 1, source, playerHealth) setTimer (setPedArmor, 500, 1, source, playerArmor) setTimer (setPlayerWantedLevel, 500, 1, source, playerWanted) giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true) giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false) giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false) giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false) giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false) giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false) giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false) giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false) giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false) giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false) giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false) giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false) giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false) setPedStat ( source, 69, skill0 ) setPedStat ( source, 70, skill1 ) setPedStat ( source, 71, skill2 ) setPedStat ( source, 72, skill3 ) setPedStat ( source, 73, skill4 ) setPedStat ( source, 74, skill5 ) setPedStat ( source, 75, skill6 ) setPedStat ( source, 76, skill7 ) setPedStat ( source, 77, skill8 ) setPedStat ( source, 78, skill9 ) setPedStat ( source, 79, skill10 ) local Deaths = getAccountData(account, "Deaths") if Deaths then setElementData(source, "Deaths", Deaths) local zKills = getAccountData(account, "Zombie kills") if zKills then setElementData(source, "Zombie kills", zKills) setCameraTarget (source, source) fadeCamera(source, true, 2.0) setPlayerNametagColor (source, R, G, B) else setPlayerMoney (source, 200) setCameraTarget (source, source) fadeCamera(source, true, 2.0) setPlayerNametagColor (source, 255, 255, 255) end end end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onLogout () kickPlayer (source, nil, "Logging out is disallowed.") end addEventHandler ("onPlayerLogout", getRootElement(), onLogout) function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then account = getPlayerAccount (source) if (account) then local x,y,z = getElementPosition (source) local r,g,b = getPlayerNametagColor (source) setAccountData (account, "funmodev2-money", tostring (getPlayerMoney (source))) setAccountData (account, "funmodev2-skin", tostring (getPedSkin (source))) setAccountData (account, "funmodev2-health", tostring (getElementHealth (source))) setAccountData (account, "funmodev2-armor", tostring (getPedArmor (source))) setAccountData (account, "funmodev2-R", r) setAccountData (account, "funmodev2-G", g) setAccountData (account, "funmodev2-B", b) setAccountData (account, "funmodev2-x", x) setAccountData (account, "funmodev2-y", y) setAccountData (account, "funmodev2-z", z) setAccountData (account, "funmodev2-int", getElementInterior (source)) setAccountData (account, "funmodev2-dim", getElementDimension (source)) setAccountData (account, "funmodev2-wantedlevel", getPlayerWantedLevel (source)) setAccountData (account, "funmodev2-weaponID0", getPedWeapon (source, 0)) setAccountData (account, "funmodev2-weaponID1", getPedWeapon (source, 1)) setAccountData (account, "funmodev2-weaponID2", getPedWeapon (source, 2)) setAccountData (account, "funmodev2-weaponID3", getPedWeapon (source, 3)) setAccountData (account, "funmodev2-weaponID4", getPedWeapon (source, 4)) setAccountData (account, "funmodev2-weaponID5", getPedWeapon (source, 5)) setAccountData (account, "funmodev2-weaponID6", getPedWeapon (source, 6)) setAccountData (account, "funmodev2-weaponID7", getPedWeapon (source, 7)) setAccountData (account, "funmodev2-weaponID8", getPedWeapon (source, ) setAccountData (account, "funmodev2-weaponID9", getPedWeapon (source, 9)) setAccountData (account, "funmodev2-weaponID10", getPedWeapon (source, 10)) setAccountData (account, "funmodev2-weaponID11", getPedWeapon (source, 11)) setAccountData (account, "funmodev2-weaponID12", getPedWeapon (source, 12)) setAccountData (account, "funmodev2-weaponAmmo0", getPedTotalAmmo (source, 0)) setAccountData (account, "funmodev2-weaponAmmo1", getPedTotalAmmo (source, 1)) setAccountData (account, "funmodev2-weaponAmmo2", getPedTotalAmmo (source, 2)) setAccountData (account, "funmodev2-weaponAmmo3", getPedTotalAmmo (source, 3)) setAccountData (account, "funmodev2-weaponAmmo4", getPedTotalAmmo (source, 4)) setAccountData (account, "funmodev2-weaponAmmo5", getPedTotalAmmo (source, 5)) setAccountData (account, "funmodev2-weaponAmmo6", getPedTotalAmmo (source, 6)) setAccountData (account, "funmodev2-weaponAmmo7", getPedTotalAmmo (source, 7)) setAccountData (account, "funmodev2-weaponAmmo8", getPedTotalAmmo (source, ) setAccountData (account, "funmodev2-weaponAmmo9", getPedTotalAmmo (source, 9)) setAccountData (account, "funmodev2-weaponAmmo10", getPedTotalAmmo (source, 10)) setAccountData (account, "funmodev2-weaponAmmo11", getPedTotalAmmo (source, 11)) setAccountData (account, "funmodev2-weaponAmmo12", getPedTotalAmmo (source, 12)) setAccountData (account, "z.skill0", getPedStat ( source, 69 )) setAccountData (account, "z.skill1", getPedStat ( source, 70 )) setAccountData (account, "z.skill2", getPedStat ( source, 71 )) setAccountData (account, "z.skill3", getPedStat ( source, 72 )) setAccountData (account, "z.skill4", getPedStat ( source, 73 )) setAccountData (account, "z.skill5", getPedStat ( source, 74 )) setAccountData (account, "z.skill6", getPedStat ( source, 75 )) setAccountData (account, "z.skill7", getPedStat ( source, 76 )) setAccountData (account, "z.skill8", getPedStat ( source, 77 )) setAccountData (account, "z.skill9", getPedStat ( source, 78 )) setAccountData (account, "z.skill10", getPedStat ( source, 79 )) local Deaths = getElementData(source, "Deaths") if Deaths then setAccountData(account, "Deaths", Deaths) local zKills = getElementData(source, "Zombie kills") if zKills then setAccountData(account, "Zombie kills", zKills) end end end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
  11. thx control entity well i changed the play gamemode and used it for my own i change the whole broph.lua is that ok
  12. this is my script i need someone to help me do this function createStaffTeamOnStart ( ) StaffTeam = createTeam ( "Staff", 255, 255, 255 ) for index, player in ipairs ( getElementsByType ( "player" ) ) do if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" ) ) then setPlayerTeam ( player, StaffTeam ) end end end addEventHandler ( "onResourceStart", resourceRoot, createStaffTeamOnStart ) function setStaffTeam ( ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) then setTimer ( setPlayerTeam, 2000, 1, source, StaffTeam ) end end addEventHandler ( "onPlayerLogin", getRootElement(), setStaffTeam ) addEventHandler ( "onPlayerJoin", getRootElement(), setStaffTeam ) addEventHandler ( "onPlayerSpawn", getRootElement(), setStaffTeam ) addEventHandler ( "onClientLoginLoaded", getRootElement(), setStaffTeam ) addEventHandler ( "onRequestLogin", getRootElement(), setStaffTeam ) addEventHandler ( "onRequestAutologin", getRootElement(), setStaffTeam ) well that script only makes the admin to staff group but not for their name colour . it dosent change their name colour to white
  13. i have a lot of erros and i not good with scripts i tried the wiki
×
×
  • Create New...