Jump to content

AlexWo

Members
  • Posts

    67
  • Joined

  • Last visited

Everything posted by AlexWo

  1. This animation should be enabled for 3 seconds and stops. setPedAnimation ( source, "DANCING", "dnce_m_b", 3000 )
  2. Well, on that wiki page you can add Optional Arguments like "time: how long the animation will run for in milliseconds." So if you add for example 3000 = 3seconds so it takes than 3 seconds
  3. Ok it works for me now either.... I just copied it a second time... Thank you
  4. Hmmm.... Nothing happens...
  5. Hi I started to script a PoliceJob, with Server and Client Side. At the Server Side I added a "triggerClientEvent" but my server.exe says: "WARNING: Policejob-server.lua:5: Bad argument @ 'triggerClientEvent' [Expected string at argument 1, got nil] Server Side: PoliceJobMarker = createMarker(1552.7, -1673.6, 16.2, "cylinder", 1.5, 0, 0, 255) function policejob (theMarker) if ( theMarker == PoliceJobMarker) then triggerClientEvent ( policejobwindow, source) end end addEventHandler ( "onPlayerMarkerHit", root, policejob ) Client Side: guiCreateLabel(0.02,0.04,0.94,0.2, "Press ACCEPT to work as Police Officer, press CANCEL to leave this window", true, PoliceJobChooseTab) function policejobwindow () PoliceJobWindow = guiCreateWindow ( 0, 0, 0.5, 0.4, "Police Job", true ) PoliceJobTabPanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, PoliceJobWindow ) PoliceJobChooseTab = guiCreateTab ( "Accept/Cancel", PoliceJobTabPanel) guiCreateLabel(0.02,0.04,0.94,0.2, "Press ACCEPT to work as Police Officer, press CANCEL to leave this window", true, PoliceJobChooseTab) end addEventHandler( "onPlayerMarkerHit", root, policejobwindow ) Well I think I entered some false variables at the "triggerClientFunction" but I'm not sure. Thank you for helping
  6. Ok I did that but if I enter the marker it just disapears.
  7. I have to change now: addEventHandler( "onPlayerMarkerHit", Weaponshop1, warpinto1) to.. addEventHandler( "onPlayerMarkerHit", root, warpinto1) or how because I'm not sure...
  8. Hi. In my script I just want that if a player hit's the Marker he get teleported to Ammunation1. I got mixed up with how to get the local Player. I only have a client side. Weaponshop1 = createMarker(1368, -1279.8, 12.7, "cylinder", 1.5, 255, 255, 255, 255) function warpinto1 (source) setElementInterior ( source, 1, 286, -40, 1001 ) end addEventHandler( "onPlayerMarkerHit", Weaponshop1, warpinto1) I'm not sure with the functions how to get the local Player who enters the Marker Thank you for helping me
  9. Hi, I made a Music script. It's really easy. Only 2 commands. -"/placespeaker" -"/destroyspeaker" ↓You can download it here ↓ http://uploaded.net/file/cc5tc68l /placespeaker The script adds a speaker to your position and plays music. The music works with an url Stream. (I will add an tutorial how to change the Stream) /destroyspeaker Destroys every placed speaker. TIPP You can place it on your car and drive around with the speaker and the sound too. Screenshot: http://abload.de/image.php?img=speakerscriptwouy1.jpg THANK YOU I uploaded it to "uploaded.to, because that site pays me a bit money for uploading Files
  10. AlexWo

    Servers Gone

    I don't know.... I played on CIT for over a year but then I started my own Server..... And I like to script so I stay on my server....
  11. AlexWo

    Servers Gone

    I think he is looking for CIT but the server is down and its official website ,too! I think they have some Problems or they got DDoS-ed
  12. Ok the errors from the Console stopped now.... The marker is also there, but if I hit the marker.... nothing happens
  13. Hi, I got an own MTA server hosted on my Computer. Everything is working players can connect..... and so on, but if a player disconnects and want to connect again, they have to wait 1-2 mins because they can find my server. Maybe you guys know what is wrong ...
  14. Server addEvent("Bank", true) addEventHandler("Bank", root, function Bank() setElementFrozen(localPlayer, true) outputChatBox("Hacking started! It will take 5 mins to hack the Bank!", 255, 255, 0) end ) addEvent("hacked", true) addEventHandler("hacked", root, function hacked() givePlayerMoney (localPlayer, 10000) setElementFrozen(localPlayer, false) setPlayerWantedLevel ( localPlayer, 3 ) end setTimer ( hacked, 300000, 1 ) ) Client: HackerMarker = createMarker ( 2511, -1246, 35, "cylinder", 1.5, 255, 255, 0, 255 ) addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) local screenX, screenY = guiGetScreenSize() local width, height = 600, 600 local x = (screenX/2) - (width/2) local y = (screenY/2) - (height/2) function HackerWindow() HackWindow = guiCreateWindow(x,y,width,height,"Hacker-Job",false) guiWindowSetSizable(HackWindow,false) guiSetVisible(HackWindow, false) Hacker = guiCreateLabel(0.02,0.07,0.5,0.2,"Choose what you want to hack",true,HackWindow) button1 = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Bank", true,HackWindow ) end addEvent ("HackerWindow",true) addEventHandler ("HackerWindow",getResourceRootElement(getThisResource()),HackerWindow) function HackerWindowDestroy() destroyElement(HackerWindow) HackerWindow = false showCursor (false) end function HackerWindowClick() if source == button1 then triggerServerEvent ("Bank",getLocalPlayer()) HackWindowDestroy () elseif source == button2 then HackerWindowDestroy () end end addEventHandler("onClientGUIClick",getRootElement(),HackerWindowClick)
  15. Ok I have it now like you posted it .... But I have the Error .... '(' expected near "Bank"
  16. You know ... Im new in scripting and I don't what you mean with this sry
  17. Ok but now I got an Error at the sever side again '(' expected near "Bank"
  18. ok tryed this... but now its sais: setTimer[Expected fuction at Argument 1, got nil] well but "hacked" is the function... IDK maybe you know that aswell?
  19. Hi I made a "Hacker-Job" but it isn't working.... I got a console Error: Here is a Link to the screenshot: http://www.abload.de/image.php?img=errorj7jz4.png Would be nice if you could look over it and tell me what is wrong. Server Side addEvent("Bank", true) addEventHandler("Bank", root, function Bank() setElementFrozen(localPlayer, true) outputChatBox("Hacking started! It will take 5 mins to hack the Bank!", 255, 255, 0) end setTimer ( hacked, 300000, 1) ) addEvent("hacked", true) addEventHandler("hacked", root, function hacked() givePlayerMoney (localPlayer, 10000) setElementFrozen(localPlayer, false) setPlayerWantedLevel ( localPlayer, 3 ) end ) Client: HackerMarker = createMarker ( 2511, -1246, 35, "cylinder", 1.5, 255, 255, 0, 255 ) addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit ) local screenX, screenY = guiGetScreenSize() local width, height = 600, 600 local x = (screenX/2) - (width/2) local y = (screenY/2) - (height/2) function HackerWindow() HackWindow = guiCreateWindow(x,y,width,height,"Hacker-Job",false) guiWindowSetSizable(HackWindow,false) guiSetVisible(HackWindow, false) Hacker = guiCreateLabel(0.02,0.07,0.5,0.2,"Choose what you want to hack",true,HackWindow) button1 = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "Bank", true,HackWindow ) end addEvent ("HackerWindow",true) addEventHandler ("HackerWindow",getResourceRootElement(getThisResource()),HackerWindow) function HackerWindowDestroy() destroyElement(HackerWindow) HackerWindow = false showCursor (false) end function HackerWindowClick() if source == button1 then triggerServerEvent ("Bank",getLocalPlayer()) HackWindowDestroy () elseif source == button2 then HackerWindowDestroy () end end addEventHandler("onClientGUIClick",getRootElement(),HackerWindowClick)
  20. I changed it now that I have only the Client side. But it's not working .... Client Side: addEventHandler("onClientGUIClick",root,onClientGUIClick) local screenX, screenY = guiGetScreenSize() local width, height = 400, 400 local x = (screenX/2) - (width/2) local y = (screenY/2) - (height/2) theWindow = guiCreateWindow(x,y,width,height,"Info-Box",false) guiWindowSetSizable(theWindow,false) guiSetVisible (theWindow, false) memo1 = guiCreateMemo (0.15,0.15,0.7,0.5,"Welcome on GlobalGaming",true,theWindow) help_window_main_button_decline = guiCreateButton(0.15,0.5,0.2,0.2,"LS",true,theWindow) function onClientGUIClick() if source == help_window_main_button_decline then setElementPosition(source, 1187, -1323, 15) end end addEventHandler("onClientGUIClick",root,onClientGUIClick) function resourceStart () bindKey ("F1", "down", menuShow) end addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) function menuShow () visableornot = guiGetVisible (theWindow) if (visableornot == true) then guiSetVisible (theWindow, false) showCursor (false) end if (visableornot == false) then guiSetVisible (theWindow, true) showCursor (true) end end
  21. And where exactly, in which line?
  22. Fail.... Can't get it runned.... I changed it now to this: Client: local screenX, screenY = guiGetScreenSize() local width, height = 400, 400 local x = (screenX/2) - (width/2) local y = (screenY/2) - (height/2) theWindow = guiCreateWindow(x,y,width,height,"Info-Box",false) guiWindowSetSizable(theWindow,false) guiSetVisible (theWindow, false) memo1 = guiCreateMemo (0.15,0.2,0.7,0.5,"Welcome on GlobalGaming",true,theWindow) help_window_main_button_decline = guiCreateButton(0.15,0.5,0.2,0.2,"LS",true,theWindow) function onClientGUIClick() if source == help_window_main_button_decline then triggerServerEvent(TeleportLS) end end function resourceStart () bindKey ("F1", "down", menuShow) end addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) function menuShow () visableornot = guiGetVisible (theWindow) if (visableornot == true) then guiSetVisible (theWindow, false) showCursor (false) end if (visableornot == false) then guiSetVisible (theWindow, true) showCursor (true) end end server: addEvent("TeleportLS", true) addEventHandler("onClientGUIClick",root,onClientGUIClick) addEventHandler("TeleportLS", root, function() getElementPosition(source) setElementPosition(source, 1187, -1323, 15) end ) PS: Sry I'm just started with scripting.
  23. Hi, I have a problem with my ServerGui. I want that if a player press the button "LS" he got teleported to a place in LS. If I press the button its not working Client-Side: local screenX, screenY = guiGetScreenSize() local width, height = 400, 400 local x = (screenX/2) - (width/2) local y = (screenY/2) - (height/2) theWindow = guiCreateWindow(x,y,width,height,"Info-Box",false) guiWindowSetSizable(theWindow,false) guiSetVisible (theWindow, false) memo1 = guiCreateMemo (0.15,0.2,0.7,0.5,"Welcome on GlobalGaming",true,theWindow) help_window_main_button_decline = guiCreateButton(0.15,0.5,0.2,0.2,"LS",true,theWindow) function onClientGUIClick() if source == help_window_main_button_decline then triggerServerEvent ("TeleportLS",getLocalPlayer()) end end function resourceStart () bindKey ("F1", "down", menuShow) end addEventHandler ("onClientResourceStart", getResourceRootElement ( getThisResource () ), resourceStart) function menuShow () visableornot = guiGetVisible (theWindow) if (visableornot == true) then guiSetVisible (theWindow, false) showCursor (false) end if (visableornot == false) then guiSetVisible (theWindow, true) showCursor (true) end end Server-Side: addEvent("TeleportLS", true) addEventHandler("TeleportLS", root, function() getElementPosition(LocalPlayer) setElementPosition(LocalPlayer,1187, -1323, 15) end ) Maybe I've done something wrong. It would be cool if you could help me
×
×
  • Create New...