Jump to content

lopexsw

Members
  • Posts

    23
  • Joined

  • Last visited

Posts posted by lopexsw

  1. Hello, everyone!

    I understand that cars that have paint jobs in the normal gta sa have the ability to carefully add paint jobs to them (via scripts etc.) and other cars that don't can just get 1 overall paintjob.

    Problem is I can't find the templates for those few cars so I could create my own paint job. I've been searching for hours, but still can't find a single one! Anyone can help me?

    Thank you!

  2. How exactly are car mods made? I know more or less how to install them, but how do people phisically make them and open while making them?

  3. I just want to get normal, different disigns of walls to make a house... Not use a51 doors that i have heard from somewhere else... I have also heard that they place samp object in the editor, but if you do that, how can you place the map then on your server or someone elses server? They wont have the samp objects.

  4. @Ridransh Thank you!

    I only have one problem... How do I get walls, doorways and floors? Ive seen few videos doing it. Like making it completely custom.. I want to do that, so I can make a cool interior for my organization. For some reason I can't find the walls etc. in the editors object list.. Please help!

  5. Okay so I just started mapping and I made a nice place for my organization in a server (It's not yet ON the server)

    I want to make a interior to go with it, how do I go about doing that?

    Usually you get into interiors, by going into elevators on the server, that admins can place too!

    I want to make a interior to get on the server via submission, so a admin can make elevator to it. I want to make it absolutely by myself.

    I heard you need to do it, high, very high in the air.. Okay you can do that easily, but like where? Can I just make it anywhere in the normal map? Do I have to create a new map or can I do it in the same one as my organizations mapping? Do I have to load a interrior and then from that far away make mine? If so wouldn't that replace for example that 24/7 interior with mine?

    Any and all help is appreciated! Thanks!

  6. 3 hours ago, Syntrax# said:
    
    function giveoptions( thePlayer, seat, jacked)
    	if getElementModel(getPedOccupiedVehicle( thePlayer )) ~= 572 then return end --if not in mower then just stop!
    		if (getElementModel (source) == 572) then
    			outputChatBox( "Do /startmowing to start mowing the grass!", getRootElement(), 10,255,0, false)
    		end
    	end
    addEventHandler('onVehicleEnter', root, giveoptions)
    
    -- Change it to this cause you are checking twice even though you already checked the element model once
    -- Also i've added the possibility to add several vehicles within this script in a table
    
    local AllowedVehicle = { 572 }
    -- To add more Vehicles fill in the following things in the AllowedVehicle Table AllowedVehicle = { ID, ID, ID, ...}
    
    function giveoptions( thePlayer, seat, jacked)
    	local VehicleID = getElementModel(getPedOccupiedVehicle( thePlayer ))
    		for i, v in pairs (AllowedVehicle) do
    			if VehicleID == v then
    				outputChatBox( "Do /startmowing to start mowing the grass!", thePlayer, 10,255,0, false)
    			else return end
    		end
    end
    addEventHandler('onVehicleEnter', root, giveoptions)
    

    Hope you like this and does it works because i'm writing this on my phone and not testing it :P 

    I appreciate it really much, but this part is completely new to me and I didnt understand non of it...

    local VehicleID = getElementModel(getPedOccupiedVehicle( thePlayer ))
    		for i, v in pairs (AllowedVehicle) do
    			if VehicleID == v then

    The I and V and pairs are like wtf? Can u please explain or just make it less efficiant, but easier to understand..

  7. function spawnMower()
    	createVehicle( 572, -- will edit when time
    	end
    end
    addEventHandler ( "onResourceStart", resourceRoot(), spawnMower )
    
    function giveoptions( thePlayer, seat, jacked)
    	if getElementModel(getPedOccupiedVehicle( thePlayer )) ~= 572 then return end --if not in mower then just stop!
    		if (getElementModel (source) == 572) then
    			outputChatBox( "Do /startmowing to start mowing the grass!", getRootElement(), 10,255,0, false)
    		end
    	end
    addEventHandler('onVehicleEnter', root, giveoptions)
    
    function mowing(thePlayer)
    outputChatBox("Drive through the red checkpoints to mow the grass!", getRootElement(),10,255,0,false)
    
    addCommandHandler("startmowing", mowing, false, false)

    Okay, I had some free time, this is what I got, obviously if you can point out some mistakes and things that I should to, to improve the script!

    So problems I faced and didn't really quite know what to do in:

    function mowing(thePlayer)
    outputChatBox("Drive through the red checkpoints to mow the grass!", getRootElement(),10,255,0,false)
    
    addCommandHandler("startmowing", mowing, false, false)

    1. What do I place in the "Function mowing ()" brackets? I was quite confused here, since it's not just a event handler where you place the events arguments.

    2. In my opinion (without any help yet) I got to the part, where I need to place checkpoints. I want to place 1 checkpoint then when the player with his mower drives in it, make it disapear and make a new one somewhere else.

  8. So hello everyone it's me, Lopex, once again!

    Today I have thought of something new I can try to make! It's a mower job!

    The idea is that a player goes to some mowers that would be spawner in Glen Park, then get on them and have a option like /startmowing in chat, then when they do such command they get told in chat to start driving around, and as they drive around Glen Park they would have a little bar on their screen that fills up and when it's full it goes away and gives you some money!

    So steps that I believe will be required:

    • Spawn the vehicle via spawnVehicle (coords, rotation)
    • After spawning the vehicle we check if the player is in that vehicle
    • If it's a mower then you get the option in chat, if not then nothing
    • After player does the certain command they start mowing and are required to drive around.
    • It displays a little bar that fills up as they drive
    • When set bar is full, they recieve a certain amount of money! (Doesn't get affected by speed or vehicle hp!!!)
    • Displays the option to start mowing again.

    So.. The thing I am confused about is weather to use spawnVehicle or createVehicle... Like what is the difference? I want the mower to be there all the time, not by set event, so mabey we want to do onResourceStart ? Or can we just do a cmd like spawnVehicle or createVehicle alone, without any event or anything, just at the top of the script?

    Also I got confused by one more thing.. If let's say I do something like:

    function spawnMower(--what do I place here?) --And I don't mean only on the event "onResourceStart" I mean like overall what do I place there?
    addEventHandler(onResourceStart, getRootElement(), spawnMower)

    As I say it there... What do I place in those () brackets? Does it work like: Since I have onResourceStart (Which doesn't have any arguments) I don't need to place anything there? But if it let's say had something with like 2 arguments, then I need to place those there?

    Someone please help me out with my questions and remember! THE AIM IS FOR ME TO LEARN NOT TO GET A FINISHED SCRIPT FAST!

    I will make a mini-script as far as I think I can take it. When I get home that is.

    Thanks for all your patience to read this and thanks if you replied in any, shape or form!

  9. 12 minutes ago, LoPollo said:

    my two cents:

    
    local TIME_TO_PREPARE = 3*60*1000 --3m
    local TICK_DURATION = 500 --tick every 500ms
    local DAMAGE_PER_TICK = 1 --DPS = DAMAGE_PER_TICK*(1000/TICK_DURATION) --just an example
    
    local methTimers = {}
    
    function cook(thePlayer, cmd, ...)
    	if getElementModel(getPedOccupiedVehicle( thePlayer )) ~= 508 then return end --not in Journey
    	if not hasPlayerTheIngredients(thePlayer) then outputChatBox( "No ingredients!", thePlayer ) return end --check if he has ingredients
    	if methTimers[thePlayer] and isTimer( methTimers[thePlayer][1] ) then outputChatBox( "Already cooking meth!", thePlayer ) return end
    	methTimers[thePlayer] = {}
    	methTimers[thePlayer][1] = setTimer( cookMethTick, TICK_DURATION, math.floor(TIME_TO_PREPARE/TICK_DURATION), thePlayer )
    	setElementFrozen( thePlayer, true )
    	methTimers[thePlayer][2] = setTimer( setElementFrozen, TIME_TO_PREPARE, 1, thePlayer, false )
    	--if you want, remove ingredients here
    end
    addCommandHandler( "cookmeth", cook, false, false )
    
    
    function cookMethTick(thePlayer)
    	if hasPlayerTheGasMask(thePlayer) then
    		setElementHealth( thePlayer, getElementHealth( thePlayer ) - DAMAGE_PER_TICK )
    	end
    	local _, tickLeft, _ = getTimerDetails ( methTimers[thePlayer] )
    	if tickLeft == 0 then --last tick
    		--use inventory to add meth or wathever you want (remove the ingredients if you didn't at start!)
    		--also clear the methTimers table
    		methTimers[thePlayer] = nil
    	end
    end
    
    function hasPlayerTheIngredients( thePlayer )
    	--use exported functions/data provided from the inventory script
    	return true or false
    end
    
    function hasPlayerTheGasMask( thePlayer )
    	--use exported functions/data provided from the script that handles gas masks
    	return true or false
    end
    
    
    
    
    function alertPlayerEnteringJourney(theVehicle)
    	if getElementModel(getPedOccupiedVehicle( thePlayer )) ~= 508 then return end --not in Journey
    	outputChatBox( "You can cook meth! /cookmeth", source )
    end
    addEventHandler( "onPlayerVehicleEnter", root, alertPlayerEnteringJourney )
    
    
    --explain more the point:
    --At the same time display a countdown of the 3 minutes saying "3 minutes of cooking remaining" or something like that that goes down.
    --DX?
    

    UNTESTED

    PS: 3 minutes? what if other players starts attacking you? Should you stay frozen watching you beign killed?

     

    You most likely nailed it exactly,

    BUT MY AIM ISN'T TO GET A SERVER LEVEL SCRIPT TO USE!

    My aim is to learn how to do this all, so no offence, but I didn't learn almost crap from this xD

    Would you be willing to get in contact or something and possibly explain this and/or teach me a bit?

    • Like 1
  10. function giveoptions( thePlayer, seat, jacked)
    	if (getElementModel (source) == 508) then
    		outputChatBox( "Do /cookmeth to start cooking methamphetamine!", getRootElement(), 10,255,0, false)
    		function cook (thePlayer, command)
    			if inventory[player]['Gas Mask'] >= 1 and inventory[player]['Hidrogen Poroxide'] >= 1 and inventory[player]['Toxic soap'] >= 1 then
    				outputChatBox("Now wait while the methamphetamine is beeing cooked", getRootElement(), 10,255,0,false)
    				setElementFrozen(thePlayer, true)
    				setTimer(setElementFrozen,180000, 1, false)
    				--Start timer on clients screen
    				--After, give the item
    				outputChatBox("You have succesfully made some methamphetamine!", getRootElement(), 10,255,0,false)
    				else outputChatBox("You don't have the required ingredients to cook methamphetamine!", 10,255,0,false)
    			end
    		end
    	else nil
    	end
    end
    addEventHandler ("onVehicleEnter", getRootElement(), giveoptions)
    addCommandHandler("cookmeth", cook)

    Okay, so this is what I've got so far.. I do not have any inventory, nor client side timer yet!

    So the idea here is that, first it check the cars model if its = to 508, then it tells you the option of cooking meth, otherwise it doesn't do anything. Then if you do /cookmeth then it will trigger the function "Cook", then if a player has that random crap in theyr inv, they get a msg that it's cooking ad get frozen for 3 mins, then when the timer ends they should recieve a item (Not yet made that part) and after that, get a msg that they have made some meth, otherwise it says you don't have the ingredients.

    Problems I faced that I would like some help with:

    1. I didn't get quite how the "addCommandHandler" works, since I know to enter the name without the / as first argument, to create a cmd in-game, but the other one i didn't quite understand from the wiki!
    2. How do I check if a play does a certain cmd? I undestood it as if someone does cookmeth, it will trigger my function "cook", thus starting the if etc.
    3. If I do a timer via "setTimer" does that mean, that ONLY AFTER the timer has run out, the next line of code will go? For ex where I do the 3 min timer, that only after the 3 minutes, it will continue, thus giving the person the end product?

    Okay so as always any help is appreciated and remember the #1 goal here is for me to learn how to do this! It doesn't matter for me to get this on a server or something!

  11. Hello everyone, It's Lopexsw again here!

    So I have thought of a new script I want to make with your (The Pro scripters) help! My aim is to make a script that when a player gets into a certain vehicle for example 

    Journey 508 Journey.png

     they have the option to do /cookmeth and then if they have the required ingredients in their inventory, they can start cooking meth! But if for example they don't have a gas mask (Which is possible to get in the server I play, but I doubt this script will be there ever.) they're health would go a bit down while they do it!

    So as I see the steps are something along the lines of this:

     

    • When a player gets into a vehicle, check what vehicle that is.
    • If it's a Journey (id 508) then display message in chat that they have a option to cook meth.
    • *If it's not a journey don't show anything*
    • When the player writes /cookmeth check they'r inventory for certain items.
    • If they have the certain items, then freeze them for 3 minutes.
    • *If not, display message you can't do it*
    • At the same time display a countdown of the 3 minutes saying "3 minutes of cooking remaining" or something like that that goes down.
    • After 3 minutes, unfreeze the player.
    • Take the items required and give the meth to the player!

    So 1 problem that I thought of, is this client side or a server side script? I think it's server sided.

     

    As always, any help is hugely appreciated, and I will try to make something myself too, not just get a result from you guys! #1 priority is learning! #2 is a done well made script for someone's server! I think this will be a very intresting script!

  12. IT WORKED! Thank you guys! You are the best! I will most likely soon, make a new post, thus continueing my learning!

    Thank you alot for this! The script works exactly, like I want it to!

    Mods can lock this :)

  13. 6 hours ago, Bananovy said:

    Small tip:
    You can use ">= 1000" instead of "> 1001". It will mean if player has equal or more than 1000$

    Thank you, but how the hell do I fix that garage door??? Help!

    Also since I haven't changed anything from what  you said I should be in freeroam, but I don't have anything on F1 and the "gp" or "/getpos" or anything along those lines doesn't show my coordinates. (I have the newest version of the game)

  14. 38 minutes ago, pa3ck said:

    If you look at the garage functions on the wiki you will see the link for the garage ID's and positions then you can just go to that position, use the command "gp" (if you're running freeroam) that will show your current position.

    Whell, the gp doesn't work, but I'm not sure what you mean by "If you're running freeroam" Cause I literally am just running the server, I haven't messed with the servers options yet or auto loading resources.

    Thanks on the info about the meta files, that helped. I'm currently messing around with the numbers to try to get it to work... No luck so far.

    Edit: Okay, I have no freaking idea what I'm doing wrong, but it just won't work :(

  15. Okay so i used a pre-made script, that is similar to what I'm making, but a bit different. I tried to only make the idlewood pay'n'spray, so I changed a few commands and this is my garage spraying script:

    fixMarker = createMarker (2062, -1831.69739, 12.18634,"cylinder", 4, 0, 0, 0, 255)
    fixBlip = createBlip(2062.00781, -1831.69739, 12.18634,63,2)
    
    function fix(thePlayer)
    veh = getPedOccupiedVehicle(thePlayer)
    outputChatBox ("Welcome to Jacks repair shop! Please wait while we fix up your car!", thePlayer, 127, 127, 0)
    if getElementHealth(veh) < 999.0 and (getPlayerMoney(thePlayer)) > 1001.0
    then price = 1001.0
    takePlayerMoney(thePlayer, price)
    fixVehicle(veh)
    setElementFrozen(veh, true)
    setTimer(setElementFrozen, 6000, 1, false)
    outputChatBox( "Your vehicle has been fixed for 1000$, come back again!", thePlayer, 127,127,0)
    else
    outputChatBox("You don't have enough money to pay for the services!",thePlayer,127,127,0)
    end
    end
    addEventHandler("onMarkerHit",fixMarker,fix)

    So that is what I have gotten so far. Making a marker inside the pay'n'spray, then makeing a Blip on the map where it is.

    Then I got the check for the car if it has a player inside it. Then it says the msg. Then if the car is under max health and the player has over 1k money, then it takes the money (price=1001.0) and fixes the vehicle, while also freezing it for 6 seconds.

    Then it says the msg, otherwise if the "if" turns out false, then it outputs the false msg.

     

    Now the biggest problem I ran into is actually testing my script on my own server, since there is a garage door there. I have tried literally everything, so what I turned out to do is copy the wiki's guide on how to open/close a garage door! I placed the id in, but I got confused with:

    1. The garage doors x,y,z coords.
    2. The block thingys sizes..(Collision shapes)

    This is the end result of my other script for the garage door.

    GARAGE_ID = 8
    
    -- create a collision shape and attach event handlers to it when the resource starts
    addEventHandler("onResourceStart", getResourceRootElement(),
    function (resource)
    	local garageCube = createColCuboid(2050, -1828, 0,15, 15, 15)
    	addEventHandler("onColShapeHit", garageCube, onGarageCubeHit)
    	addEventHandler("onColShapeLeave", garageCube, onGarageCubeLeave)
    end)
    
    -- open the door when someone enters the garage's collision shape
    function onGarageCubeHit(hitElement, matchingDimension)
    	if (getElementType(hitElement) == "player") then
    		-- check to make sure the door is closed
    		if (not isGarageOpen(GARAGE_ID)) then
    			-- open the door
    			setGarageOpen(GARAGE_ID, true)
    		end
    	end
    end
    
    -- close the door when someone leaves the garage's collision shape
    function onGarageCubeLeave(leaveElement, matchingDimension)
    	if (getElementType(leaveElement) == "player") then
    		-- check to make sure the door is open
    		if (isGarageOpen(GARAGE_ID)) then
    			-- close the door
    			setGarageOpen(GARAGE_ID, false)
    		end
    	end
    end

    This garage door is a individual script that I made aside from the garage script itself, but I'm not sure what does it go under. The garage door script goes under "Map" in the meta.xml file, but I don't know what does the garage door go under, so I  just placed "Map" in that scipts meta.xml too..

    So the problems I feel I'm facing currently:

    1. Making the meta.xml files, since I'm not sure what script ideas go under what category type. For ex: Gamemode or map.
    2. Placing the coords x,y,z of the collision boxes for the open garage door script.

    Possibly something more, but I can't remember right now.

    I would really, really appreciate if you cool guys could help me with these problems.

  16. So I understand the steps are these:

     

    • When you drive in the marker recognizes if a vehicle is inside
    • Display message to the player if he drove in like "Welcome to Jacks repair shop, wait a couple of seconds for your ride to get all fixed up."
    • Start a countdown or something similar (Not visible to the player) and then fix the car via fixVehicle but only inside the marker not all map or something.
    • When the car if fixed display message "Thank you for coming to Jacks repair shop!"
    • Charge a certain amount of money at the same time as the message gets displayed.

    Okay, I decided to remove the garage door in general, it's not required..

    It seems more understandable in steps what to do now, but I still have a few questions:

    1. Okay so you create the marker via lua script in your resources, but how do you make it invisible? Most likely I will place a Checkpoint marker, it needs to be invisible and then have a sense of when a car comes in or some cmd, that tests if someone drove in and then gives a true/false answer, thus making it fix the vehicle inside the checkpoint.

    2. How do you make the fixVehicle only fix the persons car that is inside the invisible marker? Would it follow something along the lines of getting the source of the true/false (aka the player) then fixing his vehicle?

    3. Oh and if a player drives in the marker wouldn't it disapear? We don't want that :P

  17. Okay so I just very, very recently got into scripting in general. I'm very interested in it and I already followed the first page of the scripting wiki and made the car spawner command.

    The thing I next want to make is a car fixing/washing spot. I don't plan to download just a recource and have it done, my aim is to do it, but learn the stuff along the way.

    So as much as I know:

    bool fixVehicle ( vehicle theVehicle )

    That is the function to fix a vehicle, but how can I make this into a command that will fix a vehicle in a certain place in a certain amount of time.

    For example: You drive your damaged car into a pay'n'spray and then whait a couple of seconds and it fixes the car for you.

    That would be my end goal with this, but as I already mentioned I want to learn along the way!

  18. Is there any way to get a cinematic view or something in wich you could make a kick ass trailer in? Please help me I have a competition in a rolepaly server I play.

  19. 5 hours ago, Army@1 said:

    Players can use it for unfair advantages and server owners may not like it.

    Ask the owner of the server in which you play.

    I asked one of the admins in the server ( the server is not super popular) he said its ok, because to get various specific things in the server such as houses/cars etc. you dont need just money, but also hours of gametime... And normal afk anywhere isent allowed, but he said if u have a house and in it there is a bed, then its ok if u use it.. dosent matter if u do the anim of sleeping or whatever.

  20. Hi all,

    I request a simple thing, because I really want to see this exist though I dont know how to make it myself.

    I request that u make a little program or something like that that I can just go in game then press a button or alt tab out and activate it and it will move my character randomly ever few seconds, so that let's say you don't get kicked or something like that. Please if u could do this you would make my day really.

    Hope to see some, your's truly,

    Lopexsw.

×
×
  • Create New...