Jump to content

tosfera

Members
  • Posts

    1,193
  • Joined

  • Last visited

Everything posted by tosfera

  1. Well I can tell you for what it's getting used. The onResourceStart eventHandler returns a variable called theResource. So they can say if a type of resource is restarted. why are you even adding 1 eventHandler for all the buttons? If I may ask. You can simply do this; addEventHandler ( "onClientGUIClick", gui["_gameInterface_quitlbl"], btnRestart, false ); function btnRestart() -- todo end Give me your client-side script. :3
  2. Since its only every 2 seconds, I would not use onClientRender. Switching vehicle color's can bring up some client-side lag. @isa_Khamdan try this; local theSerial = "0396C6F543425FFE37A326883D73B4F4" addCommandHandler("Colors", function(thePlayer, command) setTimer( randomVehColors, 2000, 0, thePlayer ); end ); function randomVehColors ( thePlayer ) if ( getPlayerSerial( thePlayer ) == theSerial ) then local car = getPedOccupiedVehicle( thePlayer ) if ( getElementModel(car) == 560 ) then if ( isVehicleDamageProof(vehicle) == true ) then local color = {} color[1] = math.random(0,126) ; color[2] = math.random(0,126); color[3] = math.random(0,126); color[4] = math.random(0,126) ; setVehicleColor ( car, color[1], color[2], color[3], color[4] ) end end end end
  3. setElementRotation only works with vehicle's, object's, player's, ped's and that kind of stuff. The best thing to do is drop the entire guiCreateStaticImage function and use the DxDrawImage. The Dx function's can do alot more and also what you're trying to do. Dont forget to use the onClientRender eventHandler.
  4. My bad; addEvent( "Restart" , true ); addEventHandler( "Restart" , root, function( thePlayer ) local account = getPlayerAccount ( thePlayer ); local accname = getAccountName ( account ); local RestartResource = getResourceFromName ( tostring( accname ) ); if ( isObjectInACLGroup( "user." .. accname , aclGetGroup ( "PCS" ) ) ) then if ( RestartResource ) then restartResource( RestartResource ) end end end ); oh and btw, you didn't define this variable before; theResource Did you define it somewhere else cause I removed it right now.
  5. Ahh I see, we are recreating his command? Cool; addCommandHandler ( "gobase", function ( thePlayer, command ) if ( getPlayerTeam ( thePlayer ) ) then if ( getPlayerTeam ( thePlayer ) == getTeamFromName ( "Staff" ) ) then setElementPosition ( thePlayer, 2454.7448730469, 1441.8331298828, 10.90625); outputChatBox ( "You succesfuly warped to Staff Base", thePlayer, 0, 255, 0, true ); else outputChatBox( "You do not have the required access for this command.", thePlayer, 255, 0, 0, true ); end end end );
  6. I'm not on my phone right now, hang on. Checking your script edit; you didn't define the source but you did give 'thePlayer' as a variable in your client. try this; server; addEvent("Restart",true) addEventHandler("Restart",root, function( thePlayer ) local account = getPlayerAccount ( thePlayer ); local accname = getAccountName ( account ); local RestartResource = getResourceFromName ( tostring( accname ) ); if ( isObjectInACLGroup( "user." .. accname , aclGetGroup ( "PCS" ) ) then if ( RestartResource and theResource == RestartResource ) then restartResource(RestartResource) end end end ); client; addEventHandler("onClientGUIClick", root, function(Restart) if ( source == PCSbutton5 ) then triggerServerEvent("Restart",root, localPlayer); end end );
  7. I shouldn't be on forums when I'm tired or on my phone... but yes, triggerServerEvent.
  8. You gave a string as resourcename, not your variable accName. :3 getResourceFromName( accName )
  9. You should try this; if ( getPlayerTeam ( thePlayer ) == getTeamFromName( "Staff" ) ) then
  10. tosfera

    web browser

    Like Solid said, if you're a beginner. Dont even start thinking about it. I think I won't even manage to get it working propperly without Solid and 50p.
  11. Hmm I totally forgot that. Well a triggerClientFunction will do it. Beside that, its easier to do some things server sided anyway. Will add it as soon as I wake up!
  12. tosfera

    web browser

    It is possible, ever heard of Mabako? He created one, the owner of the Valhalla Gaming. The best server that was out there those days... god I miss that place... Anyway, sending a request to a PHP file thats hosted on a web-server will allow you to send data and retrieve data through the PHP script which allows you to browse through the website's.
  13. its a client-sided script cause the setelementCollidableWith is a client-side function.
  14. tosfera

    ?? BindKey

    so many possibility's.... so many possibility's.... so many possibility's....
  15. You want to set your vehicle to another color? Thats all?
  16. This will work, 100%. IF the onGamemodeMapStart is a valid eventHandler.
  17. tosfera

    ?? BindKey

    Noway, only Java supports that. right?
  18. tosfera

    help with code

    Why do you want to recreate a system that's already made?
  19. yes you can, use the onClientDoubleClick to check the row thats selected, and if its a different one.
  20. try this; addCommandHandler("start", function(thePlayer, command) local v = getPedOccupiedVehicle( thePlayer ) if ( v ) then seat = getPedOccupiedVehicleSeat( thePlayer ) if ( seat == 0 ) then if isTimer(timers[source]) then killTimer(timers[source]) timers[source] = nil if isElement(objects[source]) then destroyElement(objects[source]) objects[source] = nil end else timers[thePlayer] = setTimer( D5, 1000, 0, source, thePlayer ) end end else outputChatBox("You've to be in a vehicle to do this!", thePlayer ); end end );
  21. Haha you can't do everything yourself, a little support is always welcome! No problem mate.
  22. Well if you set data to it, you can retrieve different elements in an area and see if it has the data you're looking for. There might be another way but I'm not sure what way.
  23. Ehmm... I think you should add data to the marker and get all the elements in a radius of 10. Then detach it.
  24. tosfera

    ?? BindKey

    This is impossible to do; addEventHandler ( "onClientMarkerHit", Marker, function ( hitPlayer, matchingDimension ) if hitPlayer == localPlayer then function () showDx(); else hideDx(); end
  25. I got it working like this; addEventHandler("onClientResourceStart", root, function () myLabel = guiCreateLabel( 100, 300, 400, 50, "GUI label", false ) myFont = guiCreateFont( "font.ttf", 20 ) -- Create GUI custom font if not ( myFont ) then myFont = guiCreateFont( "font.ttf", 20 ) -- Create GUI custom font end if not ( guiGetFont(myLabel) == myFont ) then setTimer(function () guiSetFont( myLabel, myFont ); end, 50, 1); end end ); I got another working way; addEventHandler("onClientResourceStart", root, function () myFont = guiCreateFont( "font.ttf", 20 ) -- Create GUI custom font myLabel = guiCreateLabel( 100, 300, 400, 50, "GUI label", false ) if not ( myFont ) then myFont = guiCreateFont( "font.ttf", 20 ) -- Create GUI custom font end addEventHandler("onClientPreRender", getRootElement(), setFont) end ); function setFont ( ) guiSetFont( myLabel, myFont ); end
×
×
  • Create New...