Jump to content

Wisin

Members
  • Posts

    126
  • Joined

  • Last visited

Everything posted by Wisin

  1. Wisin

    time

    i tryed this, function onlineTime() local getTickStart = getTickCount () dana=tonumber(getTickStart) hours = math.floor(dana/3600) minutes = math.floor((dana-hours*3600)/60) seconds = math.floor(dana-hours*3600-minutes*60) retStr = tostring(tonumber(hours)).."h "..tostring(tonumber(minutes)).."min "..tostring(tonumber(seconds)).."s" setElementData(source,"joinTime",retStr) return retStr end function getTickTimeStr() return onlineTime(getTickCount()) end addEventHandler( "onResourceStart",getResourceRootElement(getThisResource()),getTickTimeStr)
  2. Wisin

    time

    ah i forgot about that but how i can make it now it will put the online time at scoreboard?
  3. Wisin

    time

    yes, i do that and still same problem...
  4. Wisin

    time

    i forgot to tell you to replace "str" with "tostring" .. but you could have done it by yourself with a little search.. btw: better dont use "time" as variable name.. it should work but i dont recommend it it keeps saying attempt to perform airthmetic on local "dana" (a nil value) function convert_to_human_time(dana) dana=tonumber(dana) hours = math.floor(dana/3600) minutes = math.floor((dana-hours*3600)/60) seconds = math.floor(dana-hours*3600-minutes*60) retStr = tostring(tonumber(hours)).."h "..tostring(tonumber(minutes)).."min "..tostring(tonumber(seconds)).."s" outputChatBox( "Time: " .. retStr .. "!", getRootElement(), 0, 255, 0 ) return retStr end addCommandHandler( "test",convert_to_human_time)
  5. Wisin

    time

    ive "converted" it, function convert_to_human_time(time) time=tonumber(time) hours = math.floor(time/3600) minutes = math.floor((time-hours*3600)/60) seconds = math.floor(time-hours*3600-minutes*60) retStr = str(tonumber(hours)).."h "..str(tonumber(minutes)).."min "..str(tonumber(seconds)).."s" outputChatBox( "Time: " .. retStr .. "!", getRootElement(), 0, 255, 0 ) return retStr end addCommandHandler( "test",convert_to_human_time) says a nil value at "time"
  6. Wisin

    time

    i dont know how to do this...
  7. Wisin

    time

    ive done this, client: localPlayer = getLocalPlayer() function addColumns() exports.scoreboard:scoreboardAddColumn("joinTime") end addEventHandler("onClientResourceStart",getResourceRootElement(),addColumns) function get() local timeOnline = (getTickCount() - getElementData ( getLocalPlayer(), "joinTime" )) / 1000 setElementData(getLocalPlayer(),"joinTime",timeOnline) end addEventHandler( "onClientRender", getRootElement(), get) server: function joinTime ( ) local getTickStart = getTickCount () setElementData ( source, "joinTime", getTickStart ) end addEventHandler ( "onPlayerJoin", getRootElement(), joinTime ) but it sets a big number not seconds/minutes like i want...
  8. Wisin

    time

    hi, i would like to save how much a player played in the server, but i dont know what functions to use etc...
  9. Wisin

    Marker

    First should be like this grav1 = createMarker ( 4974.033203125, -1857.8096923828, 50.550357818604 , "corona" , 8, 0, 0,204, 255) function marker() if source == grav1 then moveObject (obj, 6000, 5010.1752929688,-1853.2252197266, 41.327033996582) end end addEventHandler( "onClientMarkerHit", getLocalPlayer(), marker )
  10. Well, if u want this u must script it cause i dont think someone will check all that code to add a save system. this functions can be used to save data in player accounts: setAccountData getAccountData and the eventHandlers, onPlayerQuit, onPlayerLogin
  11. Wisin

    color

    Hi, i have a bug in my code and i cant detect where is it, i hope someone can help me client side function nameTagColor ( ) text = guiGetText(nickE) triggerServerEvent ("nameTag", getLocalPlayer(), text) end addEventHandler("onClientGUIClick",nickSet,nameTagColor,false) server side function nameTagColor ( thePlayer,commandName, text ) setPlayerNametagColor ( thePlayer, text ) end addEvent( "nameTag", true ) addEventHandler ( "nameTag", getRootElement(), nameTagColor)
  12. If u arent gonna release it, why u posted u was going to release it "TODAY" ?
  13. Why the text is in spanish some parts? your other english parts arent bad so why just dont write everything in english? and the problem maybe are your ports, this happend to me with my test server many times, the ports you must open are 22003 TCP (i dont know if u have to open a 22003 udp too) 22005 UDP 22126 UDP
  14. Wisin

    [Help]Levels

    Any help please?
  15. Well, as i know u should edit the plane image .txd .dff and import it so all players will see it, i dont know other way.
  16. Wisin

    [Help]Levels

    Hi mta forums, i wish someone could tell me whats wrong with my script and help me to fix it, i will post code here: function rank( killer ) local kills = getElementData( killer, "deaths") if (kills == 2 ) then outputChatBox(""..killer.." Level Up! now you´re LvL 2!", killer) elseif (kills == 3 ) then outputChatBox(""..killer.."Level Up! now you´re LvL 3!", killer) elseif (kills == 5 ) then outputChatBox(""..killer.." Level Up! now you´re LvL 4!", killer) elseif (kills == 10 ) then outputChatBox(""..killer.." Level Up! now you´re LvL 5!", killer) elseif (kills == 15 ) then outputChatBox(""..killer.." Level Up! now you´re LvL 6!", killer) elseif (kills == 20 ) then outputChatBox(""..killer.." Level Up! now you´re LvL 7!", killer) elseif (kills == 25 ) then outputChatBox(""..killer.." Level Up! now you´re LvL 8!", killer) elseif (kills == 50 ) then outputChatBox(""..killer.." Level Up! now you´re LvL 9!", killer) end end function onPlayerQuit ( quitType, reason, responsibleElement,thePreviousAccount ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then setAccountData ( playeraccount, "exp.lvl", playerScore ) end end function onPlayerLogin ( thePreviousAccount, theCurrentAccount, autoLogin ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playerScore = getAccountData ( playeraccount, "exp.lvl" ) if ( playerScore ) then end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ("onPlayerLogin", getRootElement(), onPlayerLogin) addEventHandler ( "onPlayerWasted", getRootElement(), rank )
  17. Wisin

    respawn

    hi, i want to make when a player die he if he is in los santos he will respawn there at hospital but if he is in other city he will respawn at that city hospital not at los santos hospital, i hope someone understand what i mean Thanks
  18. hi, i understand that u want when like u type a command u get teleported to a place, like this: function farmwarp (source) setElementPosition ( source, 0, 0, 0 ) outputChatBox ( "You're warped to the farm!", source, 0, 255, 0 ) end addCommandHandler ( "farm", farm ) like this?
  19. With city hall u mean spawn there right?, ok yes its possible just edit the cords from the "play" game mode with the cords of the city hall and will work.
  20. Wisin

    [Help]char menu

    so, what exactly i must add because idont understand this things
  21. Hey there, im currently trying to script a character menu to create characters etc, but my problem is i have no clue of how to start exactly, i did the whole gui parts gridlist etc but can someone tell me some functions i should use? Thanks
  22. as jumba said just add this line in your admin group
  23. I think talasma dint understand what u said, btw yes u need to script it
  24. Wisin

    some problems

    Thank you 50p i have done the money thing now i will test the problem with more than 1 player in marker Edit: damn i tested the script second time and it keeps showing wtf how i can do????
×
×
  • Create New...