Jump to content

jkub

Members
  • Posts

    342
  • Joined

  • Last visited

Everything posted by jkub

  1. as to making it move automaticly u might want to use some kind of event handler for it. I dont know what in the world this object is in this case. If it is a gate I would add a marker or colshape around it somewhere. But Its probably not
  2. local x, y, z = getElementPosition ( myObject ) use this instead. u said getELementPosition ( object ) ive looked through your code and "object" does not exist... u have to provie the specific object name in this case it is myObject U use getElementPosition to get the position. If u provide the numbers for the arguement like u did it would be more like setting the position I guess
  3. jkub

    onClientGUIClick

    Oh I see. It would be so much easier and ( neater ) doing it like that and the way you do the Add thing for all the other gui elements for the parent window. You revised it in less then half the lines of code I did lol. Works wonders. Thanks for this amazing relief! Im gonna see what I can do as cuz I was pulling my hair out trying to get that to work correctly lol.
  4. im working on a simple weapons gui and as far it works fine other then the buttons i cant ever use the onClientGUIClick handler correctly even though I use it just like it says on the wiki first thing I want to where i click the btnCls then it will close the window but it dont function createWindow () local x = 0.02 local y = 0.3 local Width = 0.2 local Height = 0.6 myWindow = guiCreateWindow ( x, y, Width, Height, "Test", true ) guiSetVisible ( myWindow, false ) guiWindowSetMovable ( myWindow, false ) guiWindowSetSizable ( myWindow, false ) x = 0.25 y = 0.9 Width = 0.5 Height = 0.05 btnCls = guiCreateButton ( x, y, Width, Height, "Close", true, myWindow ) x = 0.1 y = 0.1 Width = 0.28 Height = 0.1 guiCreateLabel ( x, y, Width, Height, "colt45", true, myWindow ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () createWindow () if ( myWindow ~= nil ) then guiSetVisible ( myWindow, false ) end end ) function hide ( btnCls ) guiSetVisible ( myWindow, false ) showCursor ( false ) end function show () guiSetVisible ( myWindow, true ) showCursor ( true ) end addCommandHandler ( "open", show ) addCommandHandler ( "close", hide ) addEventHandler ( "onClientGUIClick", btnCls, hide ) ? what am i doing wrong...
  5. jkub

    onClientRender?

    k i got my mta working again I am now triggering the function throught another function... one that checks if the vehicles health is too high. i can see several problems in this myself like why I used vehicle health 999 instead of the max 1000 its for testing purposes so i can get to the speed part of the script. and another problem is that it is triggered through this function which has to be triggered by a cheating vehicle anyway. cheating i mean ( has more then 1000 health ) I think there are new trainers or sobeit thingys out there that dont use over 1000 vehicle health anymore but another way to do infinite vehicle health im not sure lol.. and another prob is that its triggers the command handler which is totaly desperate for this situation. and too add to it the executecommandhandler line only works if the loop part of it is set to "0" any other number will not work. i just lagged myself out with onclientrender now for this current version i have tested it and it outputs nothing to the debug window... function vehiclesByHealth ( thePlayer, theVehicle, seat ) local theVehicle = getPlayerOccupiedVehicle ( thePlayer ) local vehicleHealth = getElementHealth ( theVehicle ) local playerName = getClientName ( thePlayer ) local driver = getVehicleOccupant ( theVehicle, 0 ) if ( driver ) then if ( vehicleHealth > 999 ) then outputChatBox ( playerName.. "'s vehicle is suspicious", thePlayer, 175, 100, 50 ) setTimer ( executeCommandHandler, 500, 0, "speeding", thePlayer ) else end else end end addEventHandler ( "onVehicleEnter", getRootElement(), vehiclesByHealth ) function vehiclesBySpeed ( thePlayer, theVehicle ) local playerName = getClientName ( thePlayer ) local theVehicle = getPlayerOccupiedVehicle ( thePlayer ) local speedx, speedy, speedz = getElementVelocity ( theVehicle ) local realSpeed = ( speedx^2 + speedy^2 + speedz^2 )^( 0.5 ) if ( realSpeed > 2.75 ) then outputChatBox ( playerName.. "'s vehicle is suspicious", thePlayer, 175, 100, 50 ) else end end addCommandHandler ( "speeding", vehiclesBySpeed )
  6. jkub

    onClientRender?

    ... I would like to do a debug but now my mta is not even starting... the pop up messages "stop playing with yourself" comes up and it just sits there with the busy hourglass icon
  7. jkub

    onClientRender?

    k thx. got the onClientRender to work but I havent really got to test it yet because as i would figure it causes massive lag. is there a way to eliminate that lag. I would like fast rendering but I dont think like 40-50 renders a second is neccessary lol
  8. jkub

    onClientRender?

    I have created a small script that tells if a player is going over 275 mph but I cant really find any event handlers to make it function I was looking through the wiki and I saw "onClientRender" which looked to be what I was looking for because it said somthing like it is triggered every time gta renders a new frame so I thought that might be useful for this script. but When I put it in the script it does nothing. What am I doing wrong? function vehiclesBySpeed ( thePlayer, theVehicle ) local playerName = getClientName ( thePlayer ) local theVehicle = getPlayerOccupiedVehicle ( thePlayer ) local speedx, speedy, speedz = getElementVelocity ( theVehicle ) local realSpeed = ( speedx^2 + speedy^2 + speedz^2 )^( 0.5 ) if ( realSpeed > 2.75 ) then outputChatBox ( playerName.. "'s vehicle is suspicious", thePlayer, 175, 100, 50 ) else end end addEventHandler ( "onClientRender", getRootElement(), vehiclesBySpeed ) I used a sample from the wiki and Built the rest from there.
  9. where it says ip your supposed to put ur ip address lol
  10. thePlayer = getLocalPlayer()[/code ] ??? can that replace source?
  11. jkub

    gui help

    ok thanks ill be checking it out
  12. jkub

    gui help

    umm... i read the wiki all the time... Plz man im not that stupid ive read the client side part for gui and i cant make sense of it
  13. jkub

    gui help

    Hey I would like to create basic minor guis for some scripts i created recently I use that guieditor script.. But how would I make the gui visible through an event because I am never able to get my guis to work ( to be visible ) im gonna come back later with a basig gui idea
  14. I am making a gui to go along with a script because outputting useful information to the chatbox all the time looks shitty so i got a basic gui window now and I can not make it visible... when i try it gives this in debug attempt to call global 'guiCreateWindow' (a nil value) function gui ( thePlayer ) myWindow = guiCreateWindow ( 90, 175, 244, 228, "Wanted List", false ) guiSetVisible ( myWindow, true ) end addCommandHandler ( "show", gui )
  15. k thx!!! but I got a simple repair script that charges 1000 for a vehicle repair... I am trying to use 3 if statements 1 if he has enough money repair.. if not output a message.. I did that correctly 2 if source is the marker Ive did that correctly 3 if the cars health is already 1000 (mint) then I want to output a message and end the function there but instead it does not say anything and takes the money and repairs anyway???? is there any layout of if or should i use else if or what?? function repair ( thePlayer ) local car = getPlayerOccupiedVehicle ( thePlayer ) local wallet = getPlayerMoney ( thePlayer ) local hp = getElementHealth ( car ) if source == repairMarker then if ( wallet < 1000 ) then if hp == 1000 then outputChatBox ( "right" ) end outputChatBox ( "You cannot afford to fix your car", thePlayer, 255, 0, 0 ) else fixVehicle ( car ) takePlayerMoney ( thePlayer, 1000 ) end else return end end
  16. now that we got that out of the way what about if instead activated by a vehicle but activated by a specific vehicle created within the script like exCar = createVehicle ( 420, 0, 0, 0, 0, 0, 0 ) how would i make it to where it is activated by only that car?
  17. k thx for that.. but next i got another problem that is related to the same script... I made a marker and used the "onMarkerHit" eventHandler... but the function it is tied too is triggered when u hit the marker in a vehicle or on foot... I want it only to work when ur in a vehicle>>> how would I do that?
  18. jkub

    Season's Greetings

    fur real... for all the people who are too impatient to wait get over it as its been said before they dont owe you anything... Ill remind u that it is a rather difficult process lol
  19. ok This has been urking me for a long time now. I know there are real simple ways or alternate ways to tell what certain elements should do here is wat I mean first = createMarker ( 0, 0, 0, "cylinder", 1, 0, 255, 0, 125, getRootElement() ) second = createMarker ( 0, 5, 0, "cylinder", 1, 0, 255, 0, 125, getRootElement() ) third = createMarker ( 0, 10, 0, "cylinder", 1, 0, 255, 0, 125, getRootElement() ) function park_Example ( ) if source == first local myCar = getPlayerOccupiedVehicle ( thePlayer ) setVehicleEngineState ( myCar, false ) end addEventHandler ( "onMarkerHit", getRootElement(), park_Example ) so u see i got 3 markers right... where it says if source == first i would rather want the "source" or what the function is triggered by to be all three of these markers. since I dont know how to do that here is wat i end up doing and it either dont work or is messy I end up just duplicating the function code and pasting it below but just changing the if source == part to another marker ive already tryed doing this if source == first or second or third or ive tryed defining all three of them as one before by doing somthing like this allMarkers = ( first, second, third ) I have no idea lol my methods that i came up with dont work lol plz help?
  20. jkub

    1.0 server

    k thx ive did that and it let me in. ive tryed loging in to my admin but it keeps saying i am using a bad password when i checked the account.xml more then six time and assured it was right... so i tryed to spawn my player using the freeroam resource but the player will not spawn it just fades to a black screen...
  21. jkub

    1.0 server

    k thanks that seemed to work but another prob lol my 1.0 server keeps kicking me for invalid serial ? i tryed loggin in thru the settings tab on the client and it keeps saying "computer is in use"
  22. jkub

    1.0 server

    i just got the december 24 nightly build of the server build and i am trying to run it so i can go ahead and check out some stuff but for some reason i cant connect to the server when i start it. it says "connection timed out" always i can never connect. but when i run my normal dp2.3 server i can connect. Is there somthing extra i should get with the 1.0 server or what?
  23. jkub

    Arrest event?

    yes its in the client script
  24. jkub

    Arrest event?

    Ive tryed that but it returned somthin like this in debug " onPlayerArrest not added clientside"?
  25. jkub

    Arrest event?

    I am working on a real simple arrest script for the police team. anyway my problem is I would not like it to say "you will be realesed in 15 seconds" in the chatbox, i would like it to say that thru an image I made, like a gui static image that pops up and says it instead. but In order to do that I would have to make an "onPlayerArrest" event to trigger that image to pop up on the screen of the criminal. I have no idea how to define the custom event... function arrest ( thePlayer ) setElementPosition ( thePlayer, 198.8221, 162.0566, 1003.0299 ) setElementInterior ( thePlayer, 3 ) toggleAllControls ( thePlayer, false ) --disable the criminals controls ( basicly freezing him ) takeAllWeapons ( thePlayer ) --remove all of the players weapons setTimer ( toggleAllControls, 15000, 1, thePlayer, true ) setTimer ( setElementPosition, 15000, 1, thePlayer, 2335.9614, 2454.5168, 14.9687 ) setTimer ( setElementInterior, 15000, 1, thePlayer, 0 ) outputChatBox ( "You will be released in 15 seconds", thePlayer, 0, 100, 255 ) end addCommandHandler ( "arrestme", arrest ) addEvent ( "onPlayerArrest" ) function setPlayerArrest ( thePlayer ) if isControlEnabled ( thePlayer, "forwards" ) then triggerEvent ( "onPlayerArrest", thePlayer ) end end function releasemessage ( thePlayer ) guiCreateStaticImage( 20, 200, 100, 100, "image.png", false ) end addEventHandler ( "onPlayerArrest", getRootElement(), releasemessage )
×
×
  • Create New...