Jump to content

CallumD

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by CallumD

  1. setPlayerSkinID? Try setElementModel instead.
  2. CallumD

    I cant join a game

    If you open Console (F8) it gives the reason for not being able to join the server.
  3. Thanks, Wojak. That worked.
  4. I am trying to add a column on scoreboard to show all players' wanted level. I have managed to add the column (called "wanted") but I don't get how to keep the column up-to-date with the latest wanted levels of every player. I get how to setElementData but I don't get how to trigger it. There is no event for when you become wanted.
  5. CallumD

    Alert Strip

    Because client-side there is no syntax to get the player name (as far as I know of) and show it to all players without it just showing their own name.
  6. CallumD

    helpmanager

    I wanted to make it so helpmanager can read all the help files from 1 resource instead of making a new resource for every help tab. I figured it would be something to do with the code below. Anybody know how to do this? I no good with xml stuff: local helpnode = getResourceConfig(":"..getResourceName(resource).."/help.xml")
  7. Oh, that's what a variable is. Well I know how to do them, just didn't know they were called that.
  8. CallumD

    moveObject

    Does moveObject have some form of sync problem? I have a barrier to turn 90 degress and back again which is done by moveObject (triggered by onMarkerHit). When I tested the script in a private server I was the only player and it worked perfectly. Then, when I uploaded it to the actual server with people on it the barrier turned over 90 degress (about 110). I then tested it over and over with 1 person in the server and then with 2 people in the server. It seems 2+ players in a server makes it mess up.
  9. Fixed it now, thanks for the help. I used set/getElementData with a timer.
  10. Below is how to make a team, get the skin, set team, add blip and on death or quit destroy the blip. function makeTeams () createTeam ( "Police", 0, 0, 255 ) end addEventHandler ( "onResourceStart", getRootElement(), makeTeams ) function playerStats () local skin = getElementModel ( source ) if ( skin == 280 ) then local policeTeam = getTeamFromName ( "Police" ) createBlipAttachedTo ( source, 0, 2, 0, 0, 255 ) setPlayerTeam ( source, policeTeam ) end end addEventHandler ( "onPlayerSpawn", getRootElement(), playerStats ) function onDied () setPlayerTeam ( source, nil ) local attached = getAttachedElements ( source ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end addEventHandler ( "onPlayerWasted", getRootElement(), onDied ) function onQuit () local attached = getAttachedElements ( source ) if ( attached ) then for k,element in ipairs(attached) do if getElementType ( element ) == "blip" then destroyElement ( element ) end end end end addEventHandler ( "onPlayerQuit", getRootElement(), onQuit )
  11. CallumD

    Alert Strip

    I made some random strip along the bottom of every players screen using a GUI Window. I know how to change the text when an event is triggered but I don't get how to output the players name. Say for example I wanted to make it say " has died!" how would I get ? Because GUI is client-side if I use getLocalPlayer it just say to each player their own nick. How would I get a certain players name then make it work on the client-side script?
  12. Well, there are Peds which would be the equivalent of a bot. See https://wiki.multitheftauto.com/wiki/Ped for info.
  13. Sorry, I'm a noob. How would I add a variable?
  14. In my server everybody just leaves all the vehicles everywhere so none are left at the spawn areas. I decided to try and make all vehicles auto-respawn after not being used for 10-15 minutes. Does anybody know how to make this happen? I supppose it would have something to do with setVehicleIdleRespawnDelay.
  15. Make a new script and make it check the players team or skin. then use this line below: createBlipAttachedTo ( source, 0, 2, 0, 0, 255 ) createBlipAttachedTo ( element, 0, 2, r, g, b )
  16. I made this Police Gates script but it has a bug; if you enter, leave, and then enter the colShape before it has finished moving or if 2 cops enter/leave at once it goes past the turning point. Does anybody know how to prevent it going past the point? The server-side script below (the part that moves the gate): function makePoliceGate () barrier = createObject ( 968, 1544.7355957031, -1623.9633789063, 12.950497627258, 0, -90, 90 ) end addEventHandler ( "onResourceStart", getRootElement(), makePoliceGate ) function openPoliceGate () moveObject ( barrier, 1000, 1544.7355957031, -1623.9633789063, 12.950497627258, 0, 90, 0 ) end addEvent ( "openPoliceGate", true ) addEventHandler ( "openPoliceGate", getRootElement(), openPoliceGate ) function closePoliceGate () moveObject ( barrier, 1000, 1544.7355957031, -1623.9633789063, 12.950497627258, 0, -90, 0 ) end addEvent ( "closePoliceGate", true ) addEventHandler ( "closePoliceGate", getRootElement(), closePoliceGate )
  17. There is a resource called playerblips. In the script (playerblips.lua) there is a code near the very top saying: color = { 0, 255, 0 } Just change that colour code.
  18. You did make a meta.xml and all the other stuff, right?
  19. This is the section for MTA:VC/GTA3 Versions of MTA not MTA:SA.
  20. function turnOffEngine ( theVehicle ) setVehicleEngineState ( getRootElement(), false ) end addEventHandler ( "onResourceStart", getResourceFromName ( "RESOURCE NAME HERE" ), turnOffEngine ) function toggleEngine ( playerSource ) local theVehicle = getPlayerOcuppiedVehicle ( playerSource ) if theVehicle and getVehicleController ( theVehicle ) == playerSource then local state = getVehicleEngineState ( theVehicle ) setVehicleEngineState ( theVehicle, not state ) end end addCommandHandler ( "engine", toggleEngine )
  21. Try adding either: setCameraTarget ( source, source ) or setCameraTarget ( client, client )
  22. Change the spawning code to what i've put below. if (client) then spawnPlayer(client, x, y, z) fadeCamera(client, true) setCameraTarget ( source, source ) The "setCameraTarget ( source, source )" should fix it.
  23. I find that if my resources have a space in the name I get a download error.
×
×
  • Create New...