Jump to content

jkub

Members
  • Posts

    342
  • Joined

  • Last visited

Everything posted by jkub

  1. jkub

    Script help

    Hy by parem I assume you mean paremeters wich i see wat you mean. On the number on the move object script I put a comma but I ment to put a period wich added a paremeter I c, but I fixed that and it still didnt work, so instead of doing to differnt functions would i be able to just open the gate set the timer for moving back all in one function? I assume that would be easier
  2. jkub

    Script help

    this is a gate that opens when you hit the collision shape but when you leave the collision shape nothing happens even though i made a function to close it. I beilive the open function is right but ti dosent close? wat am i doin wrong col = createColRectangle ( -722.6709, 964.2388, 15, 40 ) gate = createObject ( 976, -716.8275, 957.5919, 10.1554, 0, 0, 90 ) function gateOpen ( hitPlayer, matchingDimension ) if getElementType(hitPlayer)=="player" then moveObject ( gate, 3500, -716.8275, 951.4920, 10.1554 ) end end addEventHandler ( "onColShapeHit", col, gateOpen ) function gateClose ( leavePlayer, matchingDimension ) if getElementType (leavePlayer)=="player" then moveObject ( gate, 3500, -716.8275, 957.5919, 10,1554, 0, 0, 90 ) end end addEventHandler ( "OnColShapeLeave", col, gateClose )
  3. jkub

    Script help

    when i do this it activates when i hit any marker i have made in other scripts which i beilive i called "marker" also shouldent i be able to eleminate that problem by renaming the marker of this script? example change it to "marker2" none of my other scripts have a marker with that name
  4. jkub

    Script help

    so the house inteiror script thing isnt much here is the code wich dosent seem to work marker = createMarker ( -2633.8181152344, 1371.9820556641, 8, "arrow", 2, 255, 255, 0, 180 ) visibleTo = getRootElement() function MarkerHit ( source, matchingDimension ) if getElementType(source)=="player" then spawnPlayer(source, -2636.7190, 1402.9170, 906.4609, 0, 0, 3, 0, nil) end end
  5. jkub

    Script help

    marker = createMarker ( -1090.3737792969, 402.10968017578, 14.5, "checkpoint", 20, 0, 255, 0, 255 ) visibleTo = getRootElement() function MarkerHit ( hitPlayer, matchingDimension ) outputChatBox (" Won the race!", getRootElement(), 255, 255, 109 ) end addEventHandler("onMarkerHit", getRootElement (), MarkerHit) when the script outputs to the chatbox>>> how would I make it output the players name before "Won the race!" ive already tried using getClientName and addessing another name to it but it doesent seem to work
  6. jkub

    Script help

    for some reason in this script when I attach the other car to the first car the attached car messes up and goes invisible??? car1 = createVehicle ( 421, 0, 15, 5, 0, 0, 0, BLUE ) car = createVehicle ( 421, 0, 20, 5, 0, 0, 0, BLUE ) setVehicleColor ( car, 158, 158, 158, 158 ) setVehicleColor ( car1, 158, 158, 158, 158 ) attachElementToElement ( car1, car, 0, -7, 0, 0, 0, 0) function setSkin (playerSource) id = getVehicleID ( theVehicle ) if id == 421 then setPlayerSkin ( playerSource, 0 ) end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), setSkin )
  7. jkub

    Script help

    i have created a house at a certain location on my map (by plesure domes club) and I have created a marker at the door of the house wich is an arrow... now when i walk in the arrow i want it to warp me to a certain interior. but it asks for an interior 0-255 are valid. i have looked at inteior ids on the wiki and some of them have the same number like 4 of them might have the same id. I found out the interior i wanted by using the admin panel to warp me to it. wich was world=5 SFHSB1 and how would i put that into a spawn player syntax correctly? intMarker = createMarker ( -2633.8181152344, 1371.9820556641, 8, "arrow", 2, 255, 255, 0, 180 ) visibleTo = getRootElement() function interior ( hitPlayer, matchingDimension ) if getElementType(hitPlayer)=="player" then spawnPlayer ( hitPlayer, 0, 0, 0, 0, 0, 5, 5 ) end end
  8. jkub

    Script help

    for some reason it wants to move on the x axis when i move it even though i havent specified anymovement on the x axis? road = createObject ( 18450, -992.48059082031, 340.8141784668, 2.2976553440094 ) --creates the road object function MarkerHit ( hitPlayer, matchingDimension ) if getElementType(hitPlayer)=="player" then moveObject ( road, 8000, -992.48059082031, 340.8141784668, 13.4976553440094, 0, 15, 0 ) end end addCommandHandler ("roadup", MarkerHit )
  9. jkub

    Script help

    if I wanted to rotate an object such as a road >smoothly<. making it go up like a draw bridge, how would make it to where rotateobject is a smooth animation. road = createObject ( 18450, -992.48059082031, 340.8141784668, 2.2976553440094 ) --creates the road object marker = createMarker ( -992.48059082031, 310.8141784668, 3, "corona", 2, 0, 255, 0, 100 ) -- creates the marker function MarkerHit ( hitPlayer, matchingDimension ) if getElementType(hitPlayer)=="player" then setObjectRotation ( road, 0, -1, 0 ) end end addEventHandler("onMarkerHit", getRootElement (), MarkerHit) and btw instead of using a marker to trigger it cant i just make a command handler like addCommandHandler ( "roadup", MarkerHit )
  10. jkub

    Script help

    thanks man that worked but doesent "nil" mean a value specified by the user?
  11. jkub

    Script help

    hmmm doesent seem to work,
  12. jkub

    Script help

    Ok i got that strait now but got some probs... 1 i have made an outputchatbox message that says "going up" but it is server side. I tryed to make the message client only but couldent do it so here that is outputChatBox ( "Going up", 255, 255, 255 ) and next how would i make it go back down. would i have to use another moveobject thing or what...????
  13. jkub

    Script help

    here is a script that creates a platform like object and is supposed to move it up when player steps into the marker. at first i made it at position 0 0 5 as a test and it worked perfectly. but when i changed the posistions it stoppped working here it is elevator = createObject ( 5154, -1157.0510253906, 140.57569885254, -2.1713070869466 ) marker = createMarker ( -1157.0510253906, 140.57569885254, -1, "cylinder", 2, 0, 255, 0, 175 ) function MarkerHit ( hitPlayer, matchingDimension ) if getElementType(hitPlayer)=="player" then moveObject ( elevator, 10000, -1157.0510253906, 140.57569885254, 10 ) end end addEventHandler("onMarkerHit", getRootElement (), MarkerHit)
  14. jkub

    Script help

    lol i guess i might try the col shape thing then
  15. jkub

    Script help

    btw nothing happens when player hits marker ive went thru trying to use the onplayerhitmarker and it said somthin about nil value?
  16. jkub

    Script help

    now about the setcamera function is there a way i can set the camera to look at an element instead of typing in a specific location for it? platform = createObject ( 18452, -1265, 6.0160622596741, 15.529356002808 ) -- creates the object 1842 (petrol hub) at the specified location minigun = createObject ( 2985, 0, 0, 0 ) -- creates the object 2985 (minigun) at the specified location theMarker = createMarker ( 0, 0, 0, "cylinder", 10, 255, 0, 0, 100 ) visibleTo = getRootElement() attachElementToElement ( theMarker, minigun, 0, -1, 0, 0, 0, 0 ) --attaches the marker to the minigun attachElementToElement ( minigun, platform, 0, -1, -2, 0, 0, 0 ) function markerBlip ( sourcePlayer ) if source == sourcePlayer then setCameraMode ( sourcePlayer, "fixed" ) setCameraLookAt ( sourcePlayer, -1265, 6.0, 16.0 ) end end
  17. jkub

    Script help

    i just got the object browser and i cant find the minigun id??
  18. jkub

    Script help

    I just figured out that this script interferes with my offedit script witch is a map editor. when i create the objects with it, it pops that rhino has been stolen message, I figured because it makes a arrow marker above the selected object, hmmm. and btw does anyone know the id for the mounted minigun cause I wanna attach it to the back of a patriot
  19. jkub

    Script help

    theCar was never a function because I looked thru the script and never seen it I dont know what I was thinking when i specified that. But I did specify car as an element in order to attachelements to it.
  20. jkub

    Script help

    here is one, It creates a rhino at the san fierro airport at a specific location and when a player enters it, the script outputs a message to the chat saying that the rhino has been stolen, and a arrow type marker will be attached to the rhino and also a blip will be attachted to the rhino. ive used destroy element and destroyed the marker where the rhino was sitting so you cant go back to where it was sitting and trigger the message again. This works perfectly but later I decided to make it to where the driver who is in possesion of the rhino gets money constantly while he is in it, like 10 dollars every 5 seconds. now the get money part dosent work. I assumed you would use the settimer function to make it to where getting the money is not just a one time thing by setting the last number on the settimer function to 0 makes it execute the function infinintly. I can get the givemoney part to work just for one time without the use of the settimer function but once i put that in the picture it throws me off and I do understand it has to call a function. car = createVehicle ( 432, -1276.3302001953, 35.553936004639, 14.0, 0, 0, 0 ) theMarker = createMarker ( -1276.3302001953, 35.553936004639, 13.758337974548, "cylinder", 2.5, 255, 0, 0, 0 ) function markerBlip ( sourcePlayer ) if source == theMarker then -- check if marker you enter is theMarker you created, if so, blip the player arrowMarker = createMarker ( 0, 0, 0, "arrow", 1.5, 255, 0, 0, 170 ) attachElementToElement ( arrowMarker, car, 0, 0, 4 ) createBlipAttachedTo ( car, 51, 4, 255, 0, 0, 255 ) visibleTo = getRootElement() outputChatBox("The rhino has been stolen", getRootElement(), 255, 255, 0) destroyElement ( theMarker ) end end addEventHandler( "onMarkerHit", getRootElement(), markerBlip ) function consoleGivePlayerMoney ( sourcePlayer ) setTimer ( theCar, 1000, 0 ) givePlayerMoney ( sourcePlayer, 10 ) end
  21. hy guys last night i was running my server with about 3 or 4 people in it and i had made changes to a script that was running in it while it was running so i stoppped the specific resource that i was running and in order to get my changes i refreshed my server and right after I did that ALL OF MY RESOURCES ZIPS IN MY RESOURCES FOLDER GOT DELETED I was like wtf I had lost everything and all i did was type refresh so i could get the changes to the resource i made changes to. Why did this happen?
  22. jkub

    Script help

    this one is supposed to kill the player when they walk into the marker but nothing happens, shouldent i define the source player then do one of those if source >> then things theMarker = createMarker ( 0, 0, 4, "cylinder", 2.5, 255, 0, 0, 175 ) visibleTo = getRootElement() function markerKill ( sourcePlayer ) onPlayerMarkerHit = theMarker, matchingDimension killPlayer(sourcePlayer, sourcePlayer) end
  23. jkub

    Script help

    ive got a set team script that is supposed to set the players team to an already created team when a player spawns, i have pulled some examples from the wiki and of course i dont feel accomplished for that but until i get it right even with the examples I feel it would be time to rely less on them. my luaeditor didnt spit out any error messages but im feeling it will not function properly when i use it in my server. i havent tested it yet but here it is function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) setPlayerTeam ( source, NWA ) outputchatbox ("Your team has been set to nwa", myPlayer ) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn )
  24. What I did was delete both the command handlers wp and give, there may of been a better way to do it but it works just fine lol. or if i am correct you can add the "wp" or "give" command to the acl under defeult false and under admin true
×
×
  • Create New...