Jump to content

tosfera

Members
  • Posts

    1,193
  • Joined

  • Last visited

Everything posted by tosfera

  1. lmao it doesn't? You're telling me that it doesn't work? Where did you add it, client or server side? Cause mine is server sided. edit; just tested it and it works like a charm!
  2. Ehmm in alot of servers you see the mech's smashing a vehicle on the roof like; Look, I'm repairing your car. But I can't seem to find it. (Its for a requested script haha)
  3. its not mine, but it works for me.
  4. This is wrong. You are creating every frame a label... Use this: addEventHandler( "onClientResourceStart", getRootElement(), function() label = guiCreateLabel(0.0, 0.95, 0.1, 0.1, "Time: ", true); addEventHandler("onClientRender", getRootElement(), timestart) if isTimer(timer) then killTimer(timer) end timer = setTimer(function() removeEventHandler("onClientRender", getRootElement(), timestart) end,1000000,1) end) function timestart() guiSetText(label, "Time: " ..convertMS(math.ceil(getTimerDetails(timer) / 1000)) ) end function convertMS( timeMs ) local minutes = math.floor( timeMs / 60 ) local timeMs = timeMs - minutes * 60; local seconds = math.floor( timeMs / 60 ) local ms = timeMs - seconds * 60; return string.format( '%02d :%3d', minutes, ms ); end yes I was, and I did that because the onClientPreRender kept placing new characters into the screen and it became unable to read.
  5. try it this way; addEventHandler("onResourceStart", getRootElement(getThisResource()), function() Staff = createTeam ( "Staff", 126, 0, 145 ); end ); addCommandHandler ( "staff", function ( player, command ) setElementModel ( player, 217 ); setPlayerTeam ( player, getTeamFromName("Staff") ); end );
  6. The onResourceStart doens´t know a localPlayer. The localPlayer is a predefined variable in the client side scripting. You can give everyone a vehicle with the onResourceStart. Since you only want to receive a car, try this command; addCommandHandler("giveMeVehicle", function ( thePlayer, command ) local x, y, z = getElementPosition( thePlayer ); local v = createVehicle(411, x, y, z, 0, 0, 90, "BradFord"); if ( v ) then setVehicleColor(v, 255, 0, 0); warpPedIntoVehicle(thePlayer, v); end end );
  7. Sec, making something. edit; try this: local walkingStyles = { { -------------------------------------- ----------- @@@ boys @@@ ------------- -------------------------------------- { "0", "132" }, { "7", "132" }, { "14", "132" }, { "15", "132" }, { "16", "132" }, { "17", "132" }, { "18", "132" }, { "19", "132" }, { "20", "132" }, { "21", "132" }, { "22", "132" }, { "23", "132" }, { "24", "132" }, { "25", "132" }, { "26", "132" }, { "27", "132" }, { "28", "132" }, { "29", "132" }, { "30", "132" }, { "32", "132" }, { "33", "132" }, { "34", "132" }, { "35", "132" }, { "36", "132" }, { "37", "132" }, { "43", "132" }, { "44", "132" }, { "45", "132" }, { "46", "132" }, { "47", "132" }, { "48", "132" }, { "49", "132" }, { "50", "132" }, { "51", "132" }, { "52", "132" }, { "57", "132" }, { "58", "132" }, { "59", "132" }, { "60", "132" }, { "61", "132" }, { "62", "132" }, { "66", "132" }, { "67", "132" }, { "68", "132" }, { "70", "132" }, { "71", "132" }, { "72", "132" }, { "73", "132" }, { "78", "132" }, { "79", "132" }, { "80", "132" }, { "81", "132" }, { "82", "132" }, { "83", "132" }, { "84", "132" }, { "94", "132" }, { "95", "132" }, { "96", "132" }, { "97", "132" }, { "98", "132" }, { "99", "132" }, { "100", "132" }, { "101", "132" }, { "111", "132" }, { "112", "132" }, { "113", "132" }, { "117", "132" }, { "118", "132" }, { "120", "132" }, { "121", "132" }, { "122", "132" }, { "123", "132" }, { "124", "132" }, { "125", "132" }, { "126", "132" }, { "127", "132" }, { "128", "132" }, { "132", "132" }, { "133", "132" }, { "134", "132" }, { "135", "132" }, { "136", "132" }, { "137", "132" }, { "142", "132" }, { "143", "132" }, { "144", "132" }, { "146", "132" }, { "147", "132" }, { "153", "132" }, { "154", "132" }, { "155", "132" }, { "156", "132" }, { "158", "132" }, { "159", "132" }, { "160", "132" }, { "161", "132" }, { "162", "132" }, {"163", "132" }, { "164", "132" }, { "165", "132" }, { "166", "132" }, { "167", "132" }, { "168", "132" }, { "170", "132" }, { "171", "132" }, { "176", "132" }, { "177", "132" }, { "179", "132" }, { "180", "132" }, { "181", "132" }, { "182", "132" }, { "183", "132" }, { "184", "132" }, { "185", "132" }, { "186", "132" }, { "187", "132" }, { "188", "132" }, { "189", "132" }, { "200", "132" }, { "202", "132" }, { "203", "132" }, { "204", "132" }, { "206", "132" }, { "209", "132" }, { "210", "132" }, { "212", "132" }, { "213", "132" }, { "217", "132" }, { "220", "132" }, { "221", "132" }, { "222", "132" }, { "223", "132" }, { "224", "132" }, { "225", "132" }, { "226", "132" }, { "227", "132" }, { "228", "132" }, { "229", "132" }, { "230", "132" }, { "234", "132" }, { "235", "132" }, { "236", "132" }, { "240", "132" }, { "241", "132" }, { "242", "132" }, { "247", "132" }, { "248", "132" }, { "249", "132" }, { "250", "132" }, { "252", "132" }, { "254", "132" }, { "255", "132" }, { "258", "132" }, { "259", "132" }, { "260", "132" }, { "261", "132" }, { "262", "132" }, { "264", "132" }, { "274", "132" }, { "275", "132" }, { "276", "132" }, { "277", "132" }, { "278", "132" }, { "279", "132" }, { "280", "132" }, { "281", "132" }, { "282", "132" }, { "283", "132" }, { "284", "132" }, { "285", "132" }, { "286", "132" }, { "287", "132" }, { "288", "132" }, -------------------------------------- ----------- @@@ girls @@@ ------------ -------------------------------------- { "9", "129" }, { "10", "129" }, { "11", "129" }, { "12", "129" }, { "13", "129" }, { "31", "129" }, { "38", "129" }, { "39", "129" }, { "40", "129" }, { "41", "129" }, { "53", "129" }, { "54", "129" }, { "55", "129" }, { "56", "129" }, { "63", "129" }, { "64", "129" }, { "69", "129" }, { "75", "129" }, { "76", "129" }, { "77", "129" }, { "85", "129" }, { "87", "129" }, { "88", "129" }, { "89", "129" }, { "90", "129" }, { "91", "129" }, { "92", "129" }, { "93", "129" }, { "129", "129" }, { "130", "129" }, { "131", "129" }, { "138", "129" }, { "139", "129" }, { "140", "129" }, { "141", "129" }, { "145", "129" }, { "148", "129" }, { "150", "129" }, { "151", "129" }, { "152", "129" }, { "157", "129" }, { "169", "129" }, { "178", "129" }, { "190", "129" }, { "191", "129" }, { "192", "129" }, { "193", "129" }, { "194", "129" }, { "195", "129" }, { "196", "129" }, { "197", "129" }, { "198", "129" }, { "199", "129" }, { "201", "129" }, { "205", "129" }, { "207", "129" }, { "211", "129" }, { "214", "129" }, { "215", "129" }, { "216", "129" }, { "218", "129" }, { "219", "129" }, { "224", "129" }, { "225", "129" }, { "226", "129" }, { "231", "129" }, { "232", "129" }, { "233", "129" }, { "237", "129" }, { "238", "129" }, { "243", "129" }, { "244", "129" }, { "245", "129" }, { "246", "129" }, { "251", "129" }, { "256", "129" }, { "257", "129" }, { "263", "129" }, -------------------------------------- --------- @@@ gangsters @@@ ---------- -------------------------------------- { 102", "121" }, { 103", "121" }, { 104", "121" }, { 105", "121" }, { 106", "121" }, { 107", "121" }, { 108", "121" }, { 109", "121" }, { 110", "121" }, { 114", "121" }, { 115", "121" }, { 116", "121" }, { 173", "121" }, { 174", "121" }, { 175", "121" }, addEventHandler ( "onPlayerLogin", root, function ( ) walkstyleTimer = setTimer ( function() local skin = getElementModel ( source ); for id, value in ipairs ( walkingStyles ) do if ( value == skin ) then setPedWalkingStyle ( source, value[2] ); end end, 3000, 0); end ); addEventHandler( "onPlayerLogout", root, function ( ) if ( isTimer ( walkstyleTimer ) ) then killTimer ( walkstyleTimer ); end end );
  8. tosfera

    Ayuda

    Wrong section mate. :\
  9. awhhh I feel so bad for you right now. BUT HEY! You gave me an idea! thanks mate
  10. I've had the same problem like you, let me find the thread... edit; there ya go; viewtopic.php?f=91&t=58303&p=557274&hilit=billboard#p557274
  11. @Donis, if you want, I can support you in this script. I'm doing some free scripts (small ones) atm. Just join my server, you'll find it fast enough.
  12. just try this, is this what you want? addEventHandler( "onClientResourceStart", getRootElement(), function() addEventHandler("onClientPreRender", getRootElement(), timestart) if isTimer(timer) then killTimer(timer) end timer = setTimer(function() removeEventHandler("onClientPreRender", getRootElement(), timestart) end,1000000,1) end) function timestart() guiSetText(label, "Time: "); label = guiCreateLabel(0.0, 0.95, 0.1, 0.1, "Time: ".. convertMS(math.ceil(getTimerDetails(timer) / 1000)), true); end function convertMS( timeMs ) local minutes = math.floor( timeMs / 60 ) local timeMs = timeMs - minutes * 60; local seconds = math.floor( timeMs / 60 ) local ms = timeMs - seconds * 60; return string.format( '%02d :%3d', minutes, ms ); end
  13. Melo, explain me. What does the function has to do? You want to see your time left? Why in a GUI? Why dont you just create a label on your screen that keeps updating?
  14. Thats impossible, this wont be accepted; addEventHandler( "onClientResourceStart", getRootElement(), function timestart()
  15. I'll give it a go. Whats the script supposed to do, start a timer when the resource starts and print it out to the screen?
  16. haha thanks, thats how I got all my knowledge. Nice to meet you, I'm mars.
  17. You cant add a custom paintjob (so you can switch ingame) on vehicle's that doesn't have paintjobs as default. (not yet.)
  18. Well,,, Want to hear a great story about a average programmer? "It started a while ago, around 9 years ago. The little fella called Mars was being bullied in school for quite some years back then. He didn't had friends in real life, only online friend. There was 1 guy that realy helped him alot. But one day, 9 years back. Mars found out about making a website. He came back from school and started his computer, searched some things out and started to type. Error's, bug's, glitches everything tried to put him down but they failed. Years have passed and the errors made him better, gave him more information and knowledge about different things. This day, Mars is still programming. Ever new language is a new challenge for him, nothing will back him off. Cause he know's, you have to replace your line, to achieve your goal." Now think again, are you to bad to program with SQLite?
  19. remove the Local from local timeLeft. try this; addEventHandler( "onClientResourceStart", getRootElement(getThisResource()), function() addEventHandler("onClientRender", getRootElement(), timestart) if isTimer(timer) then killTimer(timer) end timer = setTimer(function() removeEventHandler("onClientRender", getRootElement(), timestart) end,1000000,1) end) GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Label = {} GUIEditor_Window[1] = guiCreateWindow(0.2537,0.13,0.42,0.715,"Panel Test",true) guiSetAlpha(GUIEditor_Window[1],1) y = guiCreateLabel(25,33,307,30,"Time:",false,GUIEditor_Window[1]) guiLabelSetColor(y,0,255,0) guiSetText ( y, (tostring(convertMS(timeLeft)) or 'BUG')) function timestart() if isTimer(timer) then timeLeft = math.ceil(getTimerDetails(timer) / 1000) if not guiGetVisible(GUIEditor_Window[1],true) then guiSetText(y,"Time :"..(tostring(convertMS(timeLeft)) or 'BUG')) end end end function convertMS( timeMs ) local minutes = math.floor( timeMs / 60 ) local timeMs = timeMs - minutes * 60; local seconds = math.floor( timeMs / 60 ) local ms = timeMs - seconds * 60; return string.format( '%02d :%3d', minutes, ms ); end
  20. That could be done, yeah. But why dont you just create a small system that checks the ElementData of the vehicle? Or save it into a SQLite server and retrieve the information. If you'd ask me I'd make it like this; - The player receives a car from an admin -- The car is being spawned -- The car's elementData is being set to his name (the player's name) -- Data is being saved into a SQLite database (including VehicleID, VehicleOwner) If you done that, you can respawn, repair and keep the progress of the car saved. It will be save and locked up in a database. So, how can you unlock and lock these car's you might ask. Well that's easy; - create a command; lock -- when the player triggers the command, make a loop through all the vehicle's --- when the vehicle's elementData (vehicleOwner) equals the name of the player ---- (un)lock the vehicle --- else, do nothing. the functions you need for this are; addCommandHandler dbConnect executeSQLQuery setElementData getElementData getElementsByType setElementPosition createVehicle
  21. Yeah but wtf, the source of a command ins't a vehicle... try this; local C = createVehicle ( 547, 2506.1220, -1680.1697, 13.5765 ) setVehiclePaintjob ( C, 2 ); addEventHandler("onResourceStart",resourceRoot, function() setVehicleDamageProof( C, true ); setElementData( c, "eventVehicle", true ); end ); addCommandHandler("obj", function (thePlayer, command ) if not ( isPedInVehicle ( thePlayer ) ) then outputChatBox("You're not in a vehicle.", source); return; end if ( getElementData( getPedOccupiedVehicle( thePlayer ), "eventVehicle" ) ) then if ( isElement ( marker ) ) then destroyElement ( marker ); else local x,y,z = getElementPosition(C) local marker = createObject ( 1318, x,y,z+2, 0, 0, 0 ); attachElements (marker,C, 0, 0, 2 ); end else outputChatBox("You're in the wrong vehicle.", source); end end ); try that.
  22. local C = createVehicle ( 547, 2506.1220, -1680.1697, 13.5765 ) setVehiclePaintjob ( C, 2 ) addEventHandler("onResourceStart",resourceRoot, function() setVehicleDamageProof(C,true) end ); addCommandHandler("obj", function () if (source==C) then if ( isElement ( marker ) ) then destroyElement ( marker ); else local x,y,z = getElementPosition(C) local marker = createObject ( 1318, x,y,z+2, 0, 0, 0 ); attachElements (marker,C, 0, 0, 2 ); end else outputChatBox("You need to be in a vehicle to do this.", source); end end ); You forgot to close your function on line 4.
  23. Sorry for my late respond. The first thing you will have to learn while doing SQL is the Auto Increment type. The ID field is an AI field, it keeps counting whigher and higher with steps from 1 (default). All rows will become unique because of the AI. Easy to delete rows like that!
×
×
  • Create New...