Jump to content

adithegman

Members
  • Content Count

    32
  • Joined

  • Last visited

Community Reputation

0 Neutral

About adithegman

  • Rank
    Rat

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I'm trying to develop the spectating system and ran into this error: When a player dies and the startSpectate event is called from server, there is an error at the setCameraTarget function: bad argument @ 'setCameraTarget' [ Expected Vector 3 at argument 1, got nil] I checked the updatePlayers() function to see whether the players table was formed correctly or not and it is. Thanks for helping! Client script: local players = {} local index = 1 local function updatePlayers() players = {} local candidates = getElementsByType("player") for k, v in ipairs
  2. Hey guys, need some help with my code, the script works, but it spams me this warning: Code: function onRender( ) if isCursorShowing( ) then vehicles = getElementsByType( "vehicle" ) local px, py, pz = getElementPosition( localPlayer ) for key, vehicle in ipairs(vehicles) do local vx, vy, vz = getElementPosition( vehicle ) local distance = getDistanceBetweenPoints3D ( vx,vy,vz,px,py,pz ) if distance < 30 then local w, h = guiGetScreenSize () local scalex, scaley = w/1920/distance, h
  3. Thanks man, don't know how I missed that
  4. I've tried to make a script that tells you what are you aiming at. For ex, it tells you if you're aiming at a player or a vehicle. But for whatever reason, it doesn't work... The script runs just fine, no warnings/errors. Thanks for the help. function checkAiming( ) if isPedAiming ( getLocalPlayer() ) then local w, h = guiGetScreenSize () local elementType = getElementType ( getPedTarget ( getLocalPlayer ( ) ) ) dxDrawText ( "You are aiming at a(n) " .. elementType .. " now", w/2, h/4) end end addEventHandler( "onPlayerRender", getRootElement(), chec
  5. Is there any possible way that when the player is in an interior, for example CJ's house, to make the windows transparent and the player to be able to see outside when he looks through them?
  6. Thanks for the example man! I think I got the idea... And BTW, I don't really need a timer for every vehicle, It is something close to that but a bit more complicated to explain so I just asked that question hoping that it will implicitly answer my ohter unknowings and fortunately it did. Thanks for the help!
  7. Hey! I just started scripting in LUA and I need some help... I have a very good knowledge of the C languages (mainly C++) but I'm having trouble understanding a few things. What I want to do is create a timer (x = setTimer(...) ) for every vehicle on the server... and I have no idea how to do it. I know it must be tied to tables, I tried using tables but I failed... I only just started on LUA today so I'm a pretty big noob NOTE: This account is not MINE so disregard my other posts
  8. not working... working just when start the resource
  9. i made another one from scratch so create a new lua file named "server" without quotes witch containes this code: local Criminal = createTeam ( "Criminal", 155, 0, 0 ) function putPlayerInTeam ( player ) if ( isElement ( player ) ) then if ( getPlayerTeam ( player ) == getTeamFromName ( "Criminal" )) then outputChatBox("* You Are Already On The 'Criminal' Team!",player,255,0,0) return end setPlayerTeam ( player , Criminal ) outputChatBox("* You Have Been Joined Into The 'Criminal' Team! ",player,155,0,0) end end addCommandHandl
  10. adithegman

    help :(

    hello guys, i'm tryng to make a script that every five minutes it cleares the chat, but... it doesn't work pls help This is client-side local cleared = 0 function timer() if ( cleared == 0 ) then setTimer ( clearChat, 60000*5, 1 ) cleared = 1 end end function clearChat() done=0 cleared = 0 while done<=200 do outputChatBox("",0,0,0,false) done = done+1 end setTimer ( timer, 1, 1 ) end addEventHandler ( "onClientResourceStart", getRootElement, timer )
  11. to be honest, my friend asked me to ask the community because on his server it doesn't work, so i don't know if he has permision....
  12. hi guys i have this panel and the maps aren't loading, i hope you guys can find the problem
  13. hello guys, i have a problem with the anti-spam and hope you guys can solve it it outputChatBox well cuz' i see for ex Adithegman has been muted... but it doesn't mute me for 1 min, i can still speak note: this is server-side antiSpam = {} function antiChatSpam() if isTimer(antiSpam[source]) then cancelEvent() outputChatBox("#ffffff"..getPlayerName(source).." has been #ff0000muted #fffffffor for 60 seconds, reason: #ff0000spam", getRootElement(), 255, 255, 0,true) setPlayerMuted ( source, true ) setTimer ( autoUnmute, 60000, 1, source) else
×
×
  • Create New...