Jump to content

tosfera

Members
  • Posts

    1,193
  • Joined

  • Last visited

Everything posted by tosfera

  1. function toggleFRWindow() if ( getPedOccupiedVehicle ( getLocalPlayer() ) ) then if ( getVehicleModShop( getPedOccupiedVehicle( getLocalPlayer() ) ) ) then return; end end if isWindowOpen(wndMain) then showCursor(false) hideAllWindows() colorPicker.closeSelect() else showCursor(true) showAllWindows() end end addCommandHandler('fr', toggleFRWindow) try that.
  2. is it a client sided script? if so, change the source in my code to getLocalPlayer()
  3. Nope, find this function: toggleFRWindow There will be something like; function toggleFRWindow() Under that line, add my code.
  4. Whenever a zombie is killed, he gives them 10 EXP. But the system gives the player 12 EXP (I dont know the system so maybe the zombies got their own experience of killing etc). If I get him right!
  5. What they are all trying to say; trigger a client sided function to start and cancel the timer. Else everyone will get the timer (cause its server sided) you could try this, please note that I haven't tested it! server startMarker = createMarker ( -5475, 2376, 15, "checkpoint", 8, 250, 0, 0, 255 ) function startRace () if ( markerHit == startMarker ) then triggerClientEvent( "startRace", hitElement, hitElement ); end end addEventHandler("onMarkerHit", getRootElement(), startRace) client addEvent("startRace", true); addEventHandler("startRace", root, function ( source ) seconds = 0; finishMarker = createMarker ( -5460, 2376, 15, "checkpoint", 8, 250, 0, 0, 255 ) countSecondsTimer = setTimer( countSeconds, 1000, 0 -- s;) --> end ); function countSeconds() seconds = seconds + 1 end addEventHandler("onClientMarkerHit", finishMarker, function ( hitElement ) if ( ( source == finishMarker ) and ( hitElement = getLocalPlayer() ) ) then killTimer ( countSecondsTimer ); destroyElement ( finishMarker ); seconds = 0; end end );
  6. If you add it to the right functions on the right places, it will. 100% sure.
  7. You can't cancel a triggerClientEvent nor triggerServerEvent. You can only cancel eventHandlers.
  8. try changing the 10 to 8 and see what happens.
  9. With this information we can't see why you get 12 EXP. Show us the addPlayerEXP function? (I'm not known with Castillo's work)
  10. Yes it is, open the freeroam source and search for the bindkey of F1, then look for the function that shows the GUI. Under the Function add this; if ( getPedOccupiedVehicle ( source ) ) then if ( getVehicleModShop( getPedOccupiedVehicle( source ) ) ) then return; end end also for the command; cv. Do the same, find the command with the linked function, add the line under the function and restart freeroam.
  11. Disable the menu to create new vehicle's, also the command plus the way to teleport away! You can do that with this function; isElement You can see if the element is an actual element on that time, for example; the GUI thats openend.
  12. okee well you got a few ways to get it out of the marker; onVehicleExplode() -- if it gets blown up onVehicleStartExit() -- if the player gets out of the car You dont got one for warped or destroyed. 'Cause the vehicle can only be destroyed if an admin destroys it. not in another way (oke, spawning millions of new vehicle's...).
  13. You can either PM him on the forums, or talk to him on skype. (Hard to reach him there I tell ya!)
  14. You want to do what? its only working for vehicle's right now. local veh = getPlayerOccupiedVehicle( source ) if veh then or do you want it like; when the vehicle explodes, it stops. When the player gets out of the car, it stops? This function might be the one thats bugging you; onVehicleStartExit -- source: [url=https://wiki.multitheftauto.com/wiki/OnVehicleStartExit]https://wiki.multitheftauto.com/wiki/OnVehicleStartExit[/url]
  15. tosfera

    ?? Need help

    then why did you do it? Its oke to give people a script but dont make it fully working. Make a start, like someone wants a command to give players cash? Oke, sure. Give them something like this; addCommandHandler("giveMoney", function ( source, command, amount ) -- source = the player -- command = the command that has been triggered (giveMoney) -- amount = the amount of money -- check if it are numbers with; tonumber -- check if the player has money with; getPlayerMoney() -- give out the money and remove the amount of money takePlayerMoney() givePlayerMoney() end ); they would learn alot more then just getting scripts, turning them on and taking all the credits for it. ( and yes, thats out of experience. I also learned it that way! )
  16. A parameter is nothing but a pre-defined variable thats being filled in while using a function. If you're working with a function that needs a true/false back to check something, like isPedInVehicle (its a function). To tell the system that its a function, you have to add " ( ) " after the name of the function. Inside these 2 brackets, you place paramaters. For example; isPedInVehicle( thePlayer ). That is also being done with commands that require more arguments then just the name of the command. You got commands like; /help, which doesn't take any other arguments and does something. /ss 29, this commands (freeroam command) requires 1 argument. /ss is the command, and 29 is the first argument. If you would open the function it will look something like this; function changeSkin (player, command, skinID) The "player" parameter is the element that triggered the command, the "command" parameter is the command name thats being triggered. The "skinID" parameter is the argument the player said in the command (in this example, its 29). So whenever you trigger a command that requires arguments, its nothing more then the command name + another word/number/letter. /ss 29 (command: ss / parameter: 29) /cv 422 (command: cv / parameter: 422) setElementPosition(0, 0, 15) (function: setElementPosition / parameter1: 0 / parameter2: 0 / parameter3: 15 ) Get it?
  17. Hmm, try using this function too. Might be handy! https://wiki.multitheftauto.com/wiki/OnElementClicked
  18. tosfera

    Pickups

    Managed to get it fixed? Else I could give you a little hand. @goluna21; you dont need to use the "createColRectangle" function. Why dont you just use the math.random and give it 2 parameters. local posX, posY, posZ = getElementPosition ( source ); local X = math.random ( posX - 150, posX + 150 ); local Y = math.random ( posY - 150, posY + 150 ); local pickup = createPickup ( X, Y, posZ, 3, 1212 );
  19. The fck InVision? O_O" if source == 1 then You should explain that to me... anyway try this; addEventHandler ( "onClientMarkerHit", root, function ( hitElement ) if ( isPedInVehicle ( getLocalPlayer() ) ) then return; end if not ( getElementType( hitElement ) == "player" ) then return; end -- just to be sure! if ( source == and hitElement == getLocalPlayer() ) then setElementInterior ( getLocalPlayer(), 1 ); setElementDimension ( getLocalPlayer(), 0 ); setElementPosition ( getLocalPlayer() , 2233.845703125, 1710.0625, 1011.0922851563 ); outputChatBox ( "* welcome to Drrb's Tower", 255, 255, 0 ) end end );
  20. Hang on, before everyone is turning crazy and talk shit on your head. I'll make a small example of that weapon stuff. Try this, commented and ready. You might find this usefull! addCommandHandler("bWeapon", function ( source, command, weapon ) -- the function will get 1 parameter, the source is the player that uses the command, the command is which command has been used. -- before you do anything with the code itself, make sure all the parameter are filled!! if ( ( weapon ) and ( tonumber ( weapon ) ) ) then -- if the paramater is filled, we continue. -- first we will create some local variables that will clean up the code abit local money = getPlayerMoney ( source ); -- secondly we create an "array" holding the ID and the price of 1 clip. local weapons = { { "1", "50" }, -- Brass Knuckles { "22", "150" }, -- Pistol { "23", "175" }, -- Silencer { "24", "250" }} -- Desert Eagle -- after that, we create a for-loop to see if the chosen weapon is in the list for index, item in ipairs ( weapons ) do if ( item[0] == tonumber( weapon ) ) then -- make sure you use tonumber, else it will crash the script here. if ( money >= item[2] ) then -- if the player has the required ammount of money takePlayerMoney ( item[2] ); -- take the players money giveWeapon ( source, item[1], 50 ); -- give the weapon + 50 ammo end else outputChatBox( "You dont got enough money!", source ); -- tell them they dont have enough money end end else outputChatBox( "Wrong usage, example: /bWeapon ", source ); -- tell them they used the command wrong. return; -- quit the entire operation! end end );
  21. The DX's are saved in the GTA3.img, you can get them out of there. You can only retrieve the path of images you placed in the gamemode / gameplay scripts yourself. :\
  22. you can also skip this part; local USAcomiteeTeam = getTeamFromName("United States Olympic Committee"); just use the parameter to this; if not checkTeam(thePlayer, "United States Olympic Committee") then return; end else you will have to create alot of those team names haha. :3 will be easier if you have to reuse the team name over and over again, but for this its easier to just do it this way.
  23. notepad++ => search in files => "Vote for next map", and there you go. local text = g_GameOptions.randommaps and 'Next map starts in:' or 'Vote for next map starts in:'
  24. tosfera

    This ID.

    I think you mean these objects; bonyrd_block2_
×
×
  • Create New...