Jump to content

TheRock254

Members
  • Posts

    52
  • Joined

  • Last visited

Everything posted by TheRock254

  1. addEventHandler("onClientResourceStart", resourceRoot, function() Swindow = guiCreateWindow(256, 207, 331, 290, "User Panel", false) guiWindowSetSizable(Swindow , false) guiSetProperty(Swindow , "CaptionColour", "FFF7E307") repair = guiCreateButton(148, 38, 88, 94, "Repair", false, Swindow ) addEventHandler ( "onClientGUIClick", repair, repa, false ) end ) function repa () triggerServerEvent ("repairvehicle", localPlayer) end function repaircar(player) local vehicle = getPedOccupiedVehicle(player) local money = getPlayerMoney(player) if (money >= 30) then if getElementHealth(vehicle) < 1000 then fixVehicle(vehicle) takePlayerMoney(player, 30) else outputChatBox("#text!", player, 255, 0, 0, true) end else outputChatBox("text", player, 255, 0, 0, true) end end addEvent ("repairvehicle", true) addEventHandler ( "repairvehicle", getRootElement(), repaircar ) Where is the problem?
  2. TheRock254

    (help)

    I'm not a scripter. Can you do?
  3. TheRock254

    (help)

    Warning: Save\save.lua:145: Bad argument @ 'giveWeapon' [Expected weapon-type at argument2, got string 'weapons'] giveWeapon ( source, weapon, ammo, true )
  4. TheRock254

    (help)

    function playerLogin (thePreviousAccount, theCurrentAccount, autoLogin) if not (isGuestAccount (getPlayerAccount (source))) then local accountData = getAccountData (theCurrentAccount, "zmgm.money") if (accountData) then local playerMoney = getAccountData (theCurrentAccount, "zmgm.money") local playerArmor = getAccountData (theCurrentAccount, "zmgm.armor") local playerWeaponID0 = getAccountData (theCurrentAccount, "zmgm.weaponID0") local playerWeaponID1 = getAccountData (theCurrentAccount, "zmgm.weaponID1") local playerWeaponID2 = getAccountData (theCurrentAccount, "zmgm.weaponID2") local playerWeaponID3 = getAccountData (theCurrentAccount, "zmgm.weaponID3") local playerWeaponID4 = getAccountData (theCurrentAccount, "zmgm.weaponID4") local playerWeaponID5 = getAccountData (theCurrentAccount, "zmgm.weaponID5") local playerWeaponID6 = getAccountData (theCurrentAccount, "zmgm.weaponID6") local playerWeaponID7 = getAccountData (theCurrentAccount, "zmgm.weaponID7") local playerWeaponID8 = getAccountData (theCurrentAccount, "zmgm.weaponID8") local playerWeaponID9 = getAccountData (theCurrentAccount, "zmgm.weaponID9") local playerWeaponID10 = getAccountData (theCurrentAccount, "zmgm.weaponID10") local playerWeaponID11 = getAccountData (theCurrentAccount, "zmgm.weaponID11") local playerWeaponID12 = getAccountData (theCurrentAccount, "zmgm.weaponID12") local playerWeaponAmmo0 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo0") local playerWeaponAmmo1 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo1") local playerWeaponAmmo2 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo2") local playerWeaponAmmo3 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo3") local playerWeaponAmmo4 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo4") local playerWeaponAmmo5 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo5") local playerWeaponAmmo6 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo6") local playerWeaponAmmo7 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo7") local playerWeaponAmmo8 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo8") local playerWeaponAmmo9 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo9") local playerWeaponAmmo10 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo10") local playerWeaponAmmo11 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo11") local playerWeaponAmmo12 = getAccountData (theCurrentAccount, "zmgm.weaponAmmo12") local skill0 = getAccountData(theCurrentAccount, "zmgm.skill0") local skill1 = getAccountData(theCurrentAccount, "zmgm.skill1") local skill2 = getAccountData(theCurrentAccount, "zmgm.skill2") local skill3 = getAccountData(theCurrentAccount, "zmgm.skill3") local skill4 = getAccountData(theCurrentAccount, "zmgm.skill4") local skill5 = getAccountData(theCurrentAccount, "zmgm.skill5") local skill6 = getAccountData(theCurrentAccount, "zmgm.skill6") local skill7 = getAccountData(theCurrentAccount, "zmgm.skill7") local skill8 = getAccountData(theCurrentAccount, "zmgm.skill8") local skill9 = getAccountData(theCurrentAccount, "zmgm.skill9") local skill10 = getAccountData(theCurrentAccount, "zmgm.skill10") local skill11 = getAccountData(theCurrentAccount, "zmgm.skill11") setPlayerMoney (source, playerMoney) setTimer (setPedArmor, 500, 1, source, playerArmor) 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 ) setPedStat ( source, 24, skill11 ) end end end addEventHandler ("onPlayerLogin", getRootElement(), playerLogin) function onQuit (quitType, reason, responsibleElement) if not (isGuestAccount (getPlayerAccount (source))) then local account = getPlayerAccount (source) if (account) then setAccountData (account, "zmgm.money", tostring (getPlayerMoney (source))) setAccountData (account, "zmgm.armor", tostring (getPedArmor (source))) setAccountData (account, "zmgm.weaponID0", getPedWeapon (source, 0)) setAccountData (account, "zmgm.weaponID1", getPedWeapon (source, 1)) setAccountData (account, "zmgm.weaponID2", getPedWeapon (source, 2)) setAccountData (account, "zmgm.weaponID3", getPedWeapon (source, 3)) setAccountData (account, "zmgm.weaponID4", getPedWeapon (source, 4)) setAccountData (account, "zmgm.weaponID5", getPedWeapon (source, 5)) setAccountData (account, "zmgm.weaponID6", getPedWeapon (source, 6)) setAccountData (account, "zmgm.weaponID7", getPedWeapon (source, 7)) setAccountData (account, "zmgm.weaponID8", getPedWeapon (source, -- s8) -->) setAccountData (account, "zmgm.weaponID9", getPedWeapon (source, 9)) setAccountData (account, "zmgm.weaponID10", getPedWeapon (source, 10)) setAccountData (account, "zmgm.weaponID11", getPedWeapon (source, 11)) setAccountData (account, "zmgm.weaponID12", getPedWeapon (source, 12)) setAccountData (account, "zmgm.weaponAmmo0", getPedTotalAmmo (source, 0)) setAccountData (account, "zmgm.weaponAmmo1", getPedTotalAmmo (source, 1)) setAccountData (account, "zmgm.weaponAmmo2", getPedTotalAmmo (source, 2)) setAccountData (account, "zmgm.weaponAmmo3", getPedTotalAmmo (source, 3)) setAccountData (account, "zmgm.weaponAmmo4", getPedTotalAmmo (source, 4)) setAccountData (account, "zmgm.weaponAmmo5", getPedTotalAmmo (source, 5)) setAccountData (account, "zmgm.weaponAmmo6", getPedTotalAmmo (source, 6)) setAccountData (account, "zmgm.weaponAmmo7", getPedTotalAmmo (source, 7)) setAccountData (account, "zmgm.weaponAmmo8", getPedTotalAmmo (source, -- s8) -->) setAccountData (account, "zmgm.weaponAmmo9", getPedTotalAmmo (source, 9)) setAccountData (account, "zmgm.weaponAmmo10", getPedTotalAmmo (source, 10)) setAccountData (account, "zmgm.weaponAmmo11", getPedTotalAmmo (source, 11)) setAccountData (account, "zmgm.weaponAmmo12", getPedTotalAmmo (source, 12)) setAccountData (account, "zmgm.skill0", getPedStat ( source, 69 )) setAccountData (account, "zmgm.skill1", getPedStat ( source, 70 )) setAccountData (account, "zmgm.skill2", getPedStat ( source, 71 )) setAccountData (account, "zmgm.skill3", getPedStat ( source, 72 )) setAccountData (account, "zmgm.skill4", getPedStat ( source, 73 )) setAccountData (account, "zmgm.skill5", getPedStat ( source, 74 )) setAccountData (account, "zmgm.skill6", getPedStat ( source, 75 )) setAccountData (account, "zmgm.skill7", getPedStat ( source, 76 )) setAccountData (account, "zmgm.skill8", getPedStat ( source, 77 )) setAccountData (account, "zmgm.skill9", getPedStat ( source, 78 )) setAccountData (account, "zmgm.skill10", getPedStat ( source, 79 )) setAccountData (account, "zmgm.skill11", getPedStat ( source, 25 )) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit) local tempData = { } addEventHandler ( "onPlayerWasted", getRootElement(), function ( ) tempData [ source ] = { weapons = getWeaponsTable ( source ), skin = getElementModel ( source ) } end ) addEventHandler ( "onPlayerSpawn", getRootElement(), function ( ) if ( tempData [ source ] ) then for weapon, ammo in pairs ( tempData [ source ].weapons ) do giveWeapon ( source, weapon, ammo, true ) end end end ) function getWeaponsTable ( thePlayer ) local weapons = { } local hasAnyWeapon = false for slot = 0, 12 do local weapon = getPedWeapon ( thePlayer, slot ) if ( weapon > 0 ) then local ammo = getPedTotalAmmo ( thePlayer, slot ) if ( ammo > 0 ) then weapons [ weapon ] = ammo hasAnyWeapon = true end end end if ( hasAnyWeapon ) then return weapons end end ERROR: Save\save.lua:143: bad argument #1 to 'pairs' (And this script is not my. Im take to this forum.)
  5. I want to limit the maximum amount of ammo a person can carry in weap stat. 250 stat --> 250 ammo 500 stat--> 500 ammo 750 stat--> 750 ammo 1000 stat --> 1000 ammo
  6. I want to this: Weapon is stat to 250, player can carry to 250 colt ammo. 500 --> 400 ammo 750 --> 650 ammo 1000 --> 1000 ammo as.
  7. So how should I do? Is there that can help?
  8. Not work wassim. I agree with you miki. I want to limit the maximum amount...
  9. Im try it but this is not work. setWeaponAmmo(thePlayer,22,250) setWeaponAmmo(thePlayer,23,250)
  10. I did not know what it is. I want is as follows; Players can carry up to 250 Colt 45.
  11. How do i put limits to bullets? Example: Max. 250 ammo for colt 45?
  12. Hey all. I want to change to open car and close car door sounds. How to i do?
  13. TheRock254

    Health

    local give = false local tick = getTickCount( ) local endTick = nil addEventHandler( "onClientRender", root, function( thePlayer ) if ( getTickCount( ) - tick >= 1000 ) then give = true if ( not endTick ) then endTick = getTickCount( ) + 1000 end if ( getTickCount( ) >= endTick ) then give = false endTick = nil tick = getTickCount( ) end end if ( give ) then setElementHealth ( thePlayer, getElementHealth(thePlayer)+5 ) end end ) Why this is not work? Where is my mistake?
  14. Not work. This is give some error.
  15. addEventHandler("onMarkerHit",createMarker(1726.7969970703, -3491.5029296875, 20.170000076294,"cylinder",2,187,5,175,170),showGui) How to create acl marker? if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(p)), aclGetGroup("Admin")) then addEventHandler("onMarkerHit",createMarker(1726.7969970703, -3491.5029296875, 20.170000076294,"cylinder",2,187,5,175,170),showGui) end Im try this but its not work
  16. I do not know LUA. Do you have the script ready? Community or yours?
  17. I do it. But this is not work... function guiSetText ( ) local text = "" local UP = tonumber ( getElementData ( localPlayer, "level" ) ) or 0 if ( UP == 1 ) then text = " / 350" elseif ( UP == 2 ) then text = " / 700" elseif ( UP == 3 ) then text = " 1000" elseif ( UP == 4 ) then text = " 2000" elseif ( UP == 5 ) then text = " / 3000" elseif ( UP == 6 ) then text = " / 4000" elseif ( UP == 7 ) then text = " / 6000" elseif ( UP == 8 ) then text = " / 8000" elseif ( UP == 9 ) then text = " / 10000" elseif ( UP == 10 ) then text = " / 12000" elseif ( UP == 11 ) then text = " / 14000" elseif ( UP == 12 ) then text = " / 16000" elseif ( UP == 13 ) then text = " / 18000" elseif ( UP == 14 ) then text = " / 20000" elseif ( UP == 15 ) then text = " / 25000" elseif ( UP == 16 ) then text = " / 30000" elseif ( UP == 17 ) then text = " / 35000" elseif ( UP == 18 ) then text = " / 40000" elseif ( UP == 19 ) then text = " / 45000" elseif ( UP == 20 ) then text = " / 50000" end GUIEditor_Label[5] = guiCreateLabel(706,159,63,13,text,false) guiSetFont ( GUIEditor_Label[5], "default-bold-small" ) end addEventHandler ( "onClientResourceStart", resourceRoot, guiSetText ) addEventHandler ( "onClientElementDataChange", localPlayer, function ( dataName ) if ( dataName == "level" ) then guiSetText ( ) end end )
  18. Hey All. Im using "drawyourlevel". I have a problem. Level after a jump, exp is changing. But the "label" is not cleared. How to clear "label" at the jump level? main_c addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) GUIEditor_Label = { } GUIEditor_Label[1] = guiCreateLabel(624,135,66,14,"Level:",false) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Label[3] = guiCreateLabel(691,138,83,15,"Exp:",false) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[2] = guiCreateLabel(625,153,53,43, tostring ( getElementData ( localPlayer, "level" ) ),false) guiSetFont ( GUIEditor_Label[2], "sa-header" ) GUIEditor_Label[4] = guiCreateLabel(679,159,49,14, tostring ( getElementData ( localPlayer, "exp" ) ),false) guiSetFont ( GUIEditor_Label[4], "default-bold-small" ) end ) addEventHandler ( "onClientElementDataChange", localPlayer, function ( dataName ) if ( dataName == "level" ) then guiSetText ( GUIEditor_Label[2], tostring ( getElementData ( localPlayer, "level" ) ) ) elseif ( dataName == "exp" ) then guiSetText ( GUIEditor_Label[4], tostring ( getElementData ( localPlayer, "exp" ) ) ) end end ) main_level function dxsetText ( ) local text = "" local UP = tonumber ( getElementData ( localPlayer, "level" ) ) or 0 if ( UP == 1 ) then text = " 350" elseif ( UP == 2 ) then text = " 700" elseif ( UP == 3 ) then text = " 1000" elseif ( UP == 4 ) then text = " 2000" elseif ( UP == 5 ) then text = " 3000" elseif ( UP == 6 ) then text = " 4000" elseif ( UP == 7 ) then text = " 6000" elseif ( UP == 8 ) then text = " 8000" elseif ( UP == 9 ) then text = " 10000" elseif ( UP == 10 ) then text = " 12000" elseif ( UP == 11 ) then text = " 14000" elseif ( UP == 12 ) then text = " 16000" elseif ( UP == 13 ) then text = " 18000" elseif ( UP == 14 ) then text = " 20000" elseif ( UP == 15 ) then text = " 25000" elseif ( UP == 16 ) then text = " 30000" elseif ( UP == 17 ) then text = " 35000" elseif ( UP == 18 ) then text = " 40000" elseif ( UP == 19 ) then text = " 45000" elseif ( UP == 20 ) then text = " 50000" end GUIEditor_Label[5] = guiCreateLabel(706,159,63,13,text,false) guiSetFont ( GUIEditor_Label[5], "default-bold-small" ) end addEventHandler ( "onClientResourceStart", resourceRoot, dxsetText ) addEventHandler ( "onClientElementDataChange", localPlayer, function ( dataName ) if ( dataName == "level" ) then dxsetText ( ) end end ) Help pls..
×
×
  • Create New...