Jump to content

Need Help at Gamemode


DarkLink

Recommended Posts

Hello guys ;D

I walked for a few servers, and I found interesting the idea to start doing my stuff. However, my knowledge in programming is limited.

After that I thought that I could learn a little about Lua Scripting, I learned the introductory topics from here http://lua-users.org/wiki/TutorialDirectory. Then I came to MTA Scripting, and I could better understand the functions and the rest of things.

Still, I could not know which function should I start.. Well.. I do not want you to do things for me, I just wanted you to give some hints from where to start.

What I wanted to do was something like this:

1º Make two different teams with their spawn points.

2º Not be able to see the players on the radar, and there isn't respawn

3º Make two different goals:

3.1 Goal for Team 1 : Kill all from opposite team, then team 1 wins.

3.2 Goal for Team 2: Some of the team reach a particular point, and team 2 wins.

First I wanted to know if this is possible, then with which should I start.. I mean functions.

I now want to thank the MTA Team that has developed a mod with so many possibilities, and also to everyone that try to help.

Edited by Guest
Link to comment
...

I now want to thank the MTA QA that has developed a mod with so many possibilities, and also to everyone that I try to help.

MTA Quality Assurance team doesn't develop MTA, they are there to make sure the mod works as it should.

"and also to everyone that I try to help", that made me ROFL. You want to thank those who you try to help? :D

Anyway, if you're trying to make a gamemode you'd use maps (map files) and put your teams/spawnpoints inside of them.

Not being able to see other players on the radar is there since the start. If you want to see players on the radar you need to make a resource that creates blips on the radar. If you've visited servers that create blips on the radar it means they have such resource. You can run "broph" resource which is basically freeroam and has blips attached to players. You can take a look inside that script to find out how it's done (createBlipAttachedTo).

To make different goals, you need to know how MTA's events work. You can then execute some code whenever something happens, like when they reach a target ("red cylinder" (marker), or even collision shape).

- createTeam

- createBlipAttachedTo

- createMarker (a "red cylinder", or any other type of marker)

- col shape functions

- onMarkerHit or onPlayerHitMarker or onColShapeHit

- onPlayerWasted

Link to comment

Ohhh faack ! Gimme a break, you know my english sucks xD

I mean people that would try to help me xD and MTA QA like the "heads" of MTA :b

Hmn, So I cant see any player at radar just from start ? Thats what I want :)

And about the marker, I notice that I can put markers on map just by using editor. Then, why using this - createMarker ?

Cant I just use - onMarkerHit or onPlayerHitMarker ?

The rest of things I think I can handle, just need some time :)

And now let me thank 50p who has helped me throughout all my journey at MTA. ( What do u say 50p, hmn hmn ? its a well constructed sentence. Well btw used tradutor at this sentence^^)

Thanks ! :mrgreen:

Link to comment

createMarker is a function that you can use to place markers with script. That's what I use to create my bank locations. You don't have to use this function if you make markers in map files. onMarkerHit and onPlayerMarkerHit are events. Events are triggered whenever something happens, in this case, when you/vehicle hit (touch) the marker. So you can use one of those events to make 1 team win when they touch the marker.

Link to comment
createMarker is a function that you can use to place markers with script. That's what I use to create my bank locations. You don't have to use this function if you make markers in map files. onMarkerHit and onPlayerMarkerHit are events. Events are triggered whenever something happens, in this case, when you/vehicle hit (touch) the marker. So you can use one of those events to make 1 team win when they touch the marker.

well thanks then 50p, I think I will do the markers just my scripting. So I can learn more :)

Will start doing something, thanks ;)

Link to comment

yo guys it doesn't worth opening a new topic to ask this, but I have a problem.

its really easy functions, but I dont know how to do outputChatbox stop. it sends continues text for player. look:

saida2 = createMarker ( 3315.3486328125, -1600.228515625, 2.7354502677917, cylinder, 4, 255, 255, 102, 150 )
saida1 = createMarker ( 3314.7998046875, -1562.4345703125, 2.8354544639587, cylinder, 4, 255, 255, 102, 150 )
 
 
 
 
function saida2 ( hitPlayer, matchingDimension )
 
 
outputChatBox ( "#00FF00 Baggage sai a esquerda", 255 ,255 ,255, true )
outputChatBox ( "#00FF00 DFT-30 continua em frente", 255 ,255 ,255, true )
end
addEventHandler("onMarkerHit", getRootElement (), saida2)
 
 
 
function saida1 ( hitPlayer, matchingDimension )
 
 
outputChatBox ( "#00FF00 Baggage sai a direita", 255, 255, 255, true )
outputChatBox ( "#00FF00 DFT-30 continua em frente", 255, 255, 255, true )
end
addEventHandler ("onMarkerHit", getRootElement (), saida1)

When I am at marker, it sends continues text. It doesnt stop.. How can I stop it ? cancelEvent function ? oO

And btw how can I improve that code, how can I join all in one function ? Thanks.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...