Jump to content

TheIceman1

Members
  • Posts

    296
  • Joined

  • Last visited

Everything posted by TheIceman1

  1. When I start resource, then i have players on grid list, but when i do reconnect then I dont have players on grid list. for id, player in ipairs(getElementsByType("player")) do if (getPlayerWantedLevel(player) > 0) then local row = guiGridListAddRow ( GUIEditor_Grid[1] ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[1], getPlayerName( player ), false, false ) guiGridListSetItemText ( GUIEditor_Grid[1], row, GUIEditor_Column[2], getPlayerWantedLevel( player ), false, false ) end end
  2. I want save for "role" not weapon!!
  3. Why this dont save my role? 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 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 playerTeam = getAccountData (theCurrentAccount, "funmodev2-Team") 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 role = getAccountData (theCurrentAccount, "funmodev2-role") spawnPlayer (source, playerX, playerY, playerZ +1, 0, playerSkin, playerInt, playerDim) setPlayerMoney (source, playerMoney) setElementData(source, "Role") 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) setCameraTarget (source, source) fadeCamera(source, true, 2.0) else spawnPlayer (source, 1481.0855712891, -1771.2996826172, 18.795753479004, 0,78, 0, 0) setPlayerMoney (source, 200) setElementData(source, "Role", role) setCameraTarget (source, source) fadeCamera(source, true, 2.0) 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) 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, -- s8) -->) 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, -- s8) -->) 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, "funmodev2-role", getElementData ( source, "Role" )) end end end addEventHandler ("onPlayerQuit", getRootElement(), onQuit)
  4. TheIceman1

    Arrests.

    Why this dont show me my arrests on scoreboard? exports [ 'scoreboard' ]:addScoreboardColumn ( 'Arrests' ) addEventHandler("onPlayeDamage",root, function (attacker, weapon) local weap = getWeaponNameFromID(3) local skin = getElementModel ( attacker ) local team = getTeamFromName( getPlayerTeam ( attacker ) ) local wl = getPlayerWantedLevel ( source ) if (skin == 280 ) and ( team == "Police" ) and ( wl > 0 ) and ( weap == 3 ) then addPlayerArrests(attacker) end end) function addPlayerArrests(attacker) local account = getPlayerAccount(attacker) if isGuestAccount(account) then return end local arrests = getAccountData(account,"Arrests") if not arrests then setAccountData(account,"Arrests",0) end setAccountData(account,"Arrests",tonumber(arrests)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local arrests = getAccountData(account,"Arrests") if arrests then setElementData(source,"Arrests",tostring(arrests)) else setElementData(source,"Arrests",0) end end)
  5. How to make that,player who is arrested from function (wanted1),That player goes in jail(position) in second function(jail1)?Understand? Why this dont work? Here is player arrested: function wanted1( attacker, attackerweapon, bodypart, loss ) theSkin = getElementModel( attacker ) WL = getPlayerWantedLevel( source ) x, y, z = getElementPosition ( attacker ) if (attackerweapon == 3) and ( theSkin == 280 ) and (loss > 2 and (getPlayerWantedLevel( source ) == 1 ) and ( WL > 0 )) then exports ["guimessages"] : outputServer ( source, "You are arrested by "..getPlayerName(attacker).."." , 25, 25, 255) exports ["guimessages"] : outputServer ( attacker, "You have arrest "..getPlayerName(source).." take him to PD." , 25, 25, 255) showCursor ( source, true ) policecar = createVehicle ( 596, x, y, z ) setTimer ( warpPedIntoVehicle, 100, 1, attacker, policecar ) setTimer ( warpPedIntoVehicle, 200, 1, source, policecar ) markerjail = createMarker(1545.6,-1685.1,13.5,"cylinder",3, 25, 25, 255, 200 ) setElementVisibleTo ( markerjail, getRootElement(), false ) setElementVisibleTo ( markerjail, attacker, true ) end end addEventHandler ("onPlayerDamage", getRootElement(), wanted1) Here he goes in jail: function jail1 ( attacker, loss, player ) money = math.random ( 50, 150 ) time = math.random ( 5000, 15000 ) theSkin = getElementModel( attacker ) WaL = getPlayerWantedLevel( player ) if ( theSkin == 280 ) and (loss > 2 and (getPlayerWantedLevel( player ) == 1 ) and ( WaL > 0 )) then setElementPosition ( player, 0, 0, 0 ) setTimer ( setElementPosition, time, 1, player, 1545.6,-1685.1,13.5 ) setTimer ( setPlayerWantedLevel, time, 1, player, 0 ) destroyElement ( policecar ) destroyElement ( markerpo ) showCursor ( player, false ) givePlayerMoney (attacker, money) end end addEventHandler ( "onMarkerHit", markerjail, jail1 )
  6. TheIceman1

    Help.

    I have 1 wanted level and i can take Police job.But i want that,if is player wanted then he cant take police job. function police() local wantedl = getPlayerWantedLevel ( source ) if ( wantedl > 0 ) then setElementData( source, "Role", "Police Officer", true ) setElementModel( source,280) setPlayerTeam( source, getTeamFromName("Police") ) setPlayerNametagColor (source, 25, 25, 255 ) exports ["guimessages"] : outputServer ( source, "You are now employed as Police Officer." , 255, 255, 0) giveWeapon (source,3,1,true) else exports ["guimessages"] : outputServer ( source, "You can't be Police Officer while you are wanted." , 255, 255, 0) end end addEvent ( "police", true ) addEventHandler( "police",root,police )
  7. Try this: gate3= createObject ( 2929, 215.99548339844, 1875.40234375, 13.938992500305, 0, 0, 0 ) gate4 = createObject ( 2929, 211.94564819336, 1875.40234375, 13.938992500305, 0, 0, 0 ) gatecol1 = createColCircle ( 213.94564819336, 1875.40234375, 13.938992500305, 50 ) function opengatesg(thePlayer) if ( getTeamName(getPlayerTeam(thePlayer)) == "Army" ) then moveObject (gate3, 5000, 218.99548339844, 1875.40234375, 13.938992500305 ) moveObject (gate4, 5000, 208.94564819336, 1875.40234375, 13.938992500305 ) end end addEventHandler( "onColShapeHit", gatecol1, opengatesg ) function closegatesg(thePlayer) if ( getTeamName(getPlayerTeam(thePlayer)) == "Army" ) then moveObject (gate3, 5000, 215.99548339844, 1875.40234375, 13.938992500305 ) moveObject (gate4, 5000, 211.94564819336, 1875.40234375, 13.938992500305 ) end end addEventHandler( "onColShapeLeave", gatecol1, closegatesg )
  8. How to do that, only players from my gang get the message and the money? if isElementWithinColShape( player, beachTurfC ) then exports ["guimessages"] : outputServer ( player, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( player, 2000 )
  9. That's not what I'm looking for
  10. Its full code. function progress() guiSetVisible ( GUIEditor_Progress[1], false ) guiSetVisible ( GUIEditor_Label[1], false ) end function enterturf (playerSource) guiSetVisible ( GUIEditor_Progress[1], true ) guiSetVisible ( GUIEditor_Label[1], true ) capturingtimer = setTimer (guiProgressBarSetProgress,10000,1,GUIEditor_Progress[1],progress) end addEvent ( "enterturf", true ) addEventHandler ( "enterturf", root, enterturf )
  11. Why this aint loading? capturingtimer = setTimer ( getturf, 10000, 1, playerSource ) guiProgressBarSetProgress(GUIEditor_Progress[1], tonumber(capturingtimer))
  12. TheIceman1

    Question

    How can i set timer from server side to ProgressBar in client side?
  13. Is it good? function beachTurf ( player ) local playerGang = getElementData ( player, "gang" ) if ( playerGang ) then local beachTurfCplayers = getElementColShape( beachTurfC ) local players = getElementsWithinColShape ( beachTurfC, "player" ) local r, g, b = unpack ( exports [ "gang_system" ]:getGangColor ( playerGang ) ) setRadarAreaFlashing ( beachTurfA, true ) exports ["guimessages"] : outputServer ( player, "You entered the turf!" , 255, 0, 0 ) beachturfTimer = setTimer ( function ( player ) setRadarAreaColor ( beachTurfA, tonumber(r), tonumber(g), tonumber(b), 100 ) exports ["guimessages"] : outputServer ( players, "Congratulations,your gang take this turf!" , 255, 0, 0 ) givePlayerMoney ( players, 2000 ) setRadarAreaFlashing ( beachTurfA, false ) end ,10000, 1, player ) end end addEventHandler ( "onColShapeHit", beachTurfC, beachTurf )
  14. Working,how to do that all players in the turf receive money and messages from my gang?
  15. Working,but I have not got the money.And i have not got message "Congratulations,your gang take this turf!" Debug says: Bad argument @"givePlayerMoney"
×
×
  • Create New...