Jump to content

Wisin

Members
  • Posts

    126
  • Joined

  • Last visited

Everything posted by Wisin

  1. Wisin

    Script problem

    ah, i was setting the element data on the radar area, not the col shape, thanks.
  2. Wisin

    Script problem

    Hi, i have a problem with onColShapeHit event, i want when hit the col shape get an element data from it, i use source as col shape element as says at wiki. solved. Error: when i enter it outputs "This area is owned by 'false'" and should output something different can someone help me?
  3. Wisin

    random map

    hello, im making a game mode but when the players votes and is a "draw" i want to start a random map, how i can do this?
  4. Wisin

    Anti-cheat problem

    Does anyone know how i can disable the MTA Anti-cheat? i have a script that cancells the damage between players so we cant kill eachother, thanks.
  5. Wisin

    top time

    function getTop3() outputChatBox ("Top time online", getRootElement(), 153, 51, 255, true) local top = { ["times"] = { 0, 0, 0 }, ["accs"] = { nil, nil, nil }, ["pls"] = { nil, nil, nil }, } for key,val in ipairs(getElementsByType("player")) do local account = getPlayerAccount(val) if account then local accountname = getAccountName(account) local time = executeSQLSelect ( "rol_time", "H","Player = '" .. accountname .. "'") if time~=nil and #time>0 then if tonumber(h) > top['times'][1] then top['times'][2] = top['times'][1] top['accs'][2] = top['accs'][1] top['pls'][2] = top['pls'][1] top['times'][1] = tonumber(h) top['accs'][1] = getPlayerAccount(val) top['pls'][1] = val elseif tonumber(h) > top['times'][1] then top['times'][2] = tonumber(h) top['accs'][2] = getPlayerAccount(val) top['pls'][2] = val end end end end outputChatBox("top1: player: "..getPlayerName(top['pls'][1])..", hours: ".. top['times'][1],getRootElement(),255,0,0) outputChatBox("top2: player: "..getPlayerName(top['pls'][2])..", hours: ".. top['times'][2],getRootElement(),0,255,0) outputChatBox("top3: player: "..getPlayerName(top['pls'][3])..", hours: ".. top['times'][3],getRootElement(),0,0,255) end addCommandHandler("toptime",getTop3) thats it
  6. Wisin

    top time

    nop still not working error: attempt to compare number with nil line: if tonumber(h) > top['times'][1] then
  7. Wisin

    top time

    no is not, i have added "if account then" now i go test. Edit: not working it says error in line: local h = time[1]["H"] attempt to index field '?' (a nil value) function getTop3() outputChatBox ("Top time online", getRootElement(), 153, 51, 255, true) local top = { ["times"] = { 0, 0, 0 }, ["accs"] = { nil, nil, nil }, ["pls"] = { nil, nil, nil }, } for key,val in ipairs(getElementsByType("player")) do local account = getPlayerAccount(val) if account then local accountname = getAccountName(account) local time = executeSQLSelect ( "rol_time", "H","Player = '" .. accountname .. "'") local h = time[1]["H"] if tonumber(h) > top['times'][1] then top['times'][2] = top['times'][1] top['accs'][2] = top['accs'][1] top['pls'][2] = top['pls'][1] top['times'][1] = tonumber(h) top['accs'][1] = getPlayerAccount(val) top['pls'][1] = val elseif tonumber(h) > top['times'][1] then top['times'][2] = tonumber(h) top['accs'][2] = getPlayerAccount(val) top['pls'][2] = val end end end outputChatBox("top1: player: "..getPlayerName(top['pls'][1])..", hours: ".. top['times'][1],getRootElement(),255,0,0) outputChatBox("top2: player: "..getPlayerName(top['pls'][2])..", hours: ".. top['times'][2],getRootElement(),0,255,0) outputChatBox("top3: player: "..getPlayerName(top['pls'][3])..", hours: ".. top['times'][3],getRootElement(),0,0,255) end addCommandHandler("toptime",getTop3)
  8. Wisin

    Money system

    wtf do you mean?????? i don't get it! you want to use real money system (getPlayerMoney,givePlayerMoney,setPlayerMoney)?
  9. Wisin

    top time

    all works with varez code but when a player dont has account it says errors and not works
  10. Wisin

    top time

    i dont understand what you mean
  11. Wisin

    top time

    ok i fixed that but now works but my friend have 3 hours and me 2 and he is down, why? function getTop2() outputChatBox ("Top time online", getRootElement(), 153, 51, 255, true) local top = { ["times"] = { 0, 0 }, ["accs"] = { nil, nil } } for key,val in ipairs(getElementsByType("player")) do local account = getPlayerAccount(val) local accountname = getAccountName(account) local time = executeSQLSelect ( "rol_time", "H","Player = '" .. accountname .. "'") local h = time[1]["H"] if tonumber(h) > top['times'][1] then top['times'][2] = top['times'][1] top['accs'][2] = top['accs'][1] top['times'][1] = tonumber(h) top['accs'][1] = getPlayerAccount(val) local nick = getPlayerName(val) outputChatBox(nick.." ".. tostring(h) .." hours", getRootElement (), 255, 255, 0, false) elseif tonumber(h) > top['times'][1] then top['times'][2] = tonumber(h) top['accs'][2] = getPlayerAccount(val) local nick = getPlayerName(val) outputChatBox(nick.." ".. tostring(h) .." hours", getRootElement (), 255, 255, 0, false) end end end addCommandHandler("toptime",getTop2)
  12. Wisin

    top time

    i cant post that part its not from this function, that worked varez but now when i put /toptime says 1 errors attempt to compare number with nil at line: if tonumber(time) > top['times'][1] then
  13. Wisin

    top time

    dont work this code, function getTop2() outputChatBox ("Top time online", getRootElement(), 153, 51, 255, true) local top = { "times" = { 0, 0 }, "accs" = { nil, nil } } for key,val in ipairs(getElementsByType("player") do local account = getPlayerAccount(val) local accountname = getAccountName(account) local time = executeSQLSelect ( "rol_time", "H","Player = '" .. accountname .. "'") if tonumber(time) > top['times'][1] then top['times'][2] = top['times'][1] top['accs'][2] = top['accs'][1] top['times'][1] = tonumber(time) top['accs'][1] = getPlayerAccount(val) local nick = getPlayerName(val) elseif tonumber(time) > top['times'][1] then top['times'][2] = tonumber(time) top['accs'][2] = getPlayerAccount(val) local nick = getPlayerName(val) end outputChatBox(nick.." ".. tostring(h) .." hours", getRootElement (), 255, 255, 0, false) end end addCommandHandler("toptime",getTop2) error: 498: '}' expected (to close '{' at line 497) near '='
  14. Wisin

    top time

    Yes thats what i want !
  15. Wisin

    top time

    hi everyone, im trying to make a script that will get the 2 players who have more hours, but i have no clue how to make it, if anyone can give me a start. addCommandHandler("toptime", function (thePlayer) outputChatBox ("Top time online", thePlayer, 153, 51, 255, true) for k,v in ipairs(players) do local account = getPlayerAccount(v) local accountname = getAccountName(account) local hours = executeSQLSelect ( "rol_time", "H","Player = '" .. accountname .. "'") local h = hours[1]["H"] local nick = getPlayerName(v) outputChatBox(nick.." ".. tostring(h) .." hours", getRootElement (), 255, 255, 0, false) end end)
  16. Wisin

    move dx position

    yeah i edited it but i got a question, how i can move the text with the timer i made? edit: also this dosn't works for all resolutions O_o
  17. Wisin

    move dx position

    yeah, its moving now but at wrong part of screen, it moves up but the rectangle position is wrong.
  18. Wisin

    track player

    yes directions are correct i checked and they're right thanks again.
  19. Wisin

    move dx position

    thats because it was messing with a different script cause i use also, x,y = guiGetScreenSize()
  20. Wisin

    track player

    lets hope they are correct, i don't know how to test that.
  21. Wisin

    move dx position

    you are right i was doing wrong arguments now it appears but it removes like before, here is my code, local y2 = 0; local height = 20; function createDX( ) y = y2 - 1; dxDrawRectangle( 0.0, y2, 1023.0, height, tocolor(0,0,0,200),false ); if y2 < -height then removeEventHandler("onClientRender",root,createDX) end end function removeNews() removeEventHandler("onClientRender",root,createDX) end
  22. Wisin

    track player

    i walk around the bot and it sets to south,west,north etc
  23. Wisin

    track player

    thank you, its working
  24. Wisin

    move dx position

    yes i have idea about DXdrawing and GUI addEventHandler("onClientRender",root,createDX) i got the event it works with normal rectangle but not with the one that should move.
  25. Wisin

    move dx position

    uhm, it dosn't works the rectangle dosn't even appears in screen local y = 0; local height = 20; function createDX( ) y = y - 1; dxDrawRectangle( 0.0, y, 1023.0, height, 19.0,tocolor(0,0,0,200),false ); if y < -height then removeEventHandler("onClientRender",root,createDX) end end any idea?
×
×
  • Create New...