eAi Posted April 17, 2008 Posted April 17, 2008 http://development.mtasa.com/index.php? ... dComponent
Touho Posted April 17, 2008 Author Posted April 17, 2008 Second question... How i can make the picture in the centre of screen? Bad english...
lil Toady Posted April 17, 2008 Posted April 17, 2008 maths local x, y = guiGetScreenSize() local w, h = guiGetSize ( pic, false ) local px, py = x / 2 - w / 2, y / 2 - h / 2
CodeMaster Posted April 17, 2008 Posted April 17, 2008 He means on SA-MP Debug I think ^^ Then take this: https://forum.multitheftauto.com/viewtopic.php?f=91&t=21674 Cheers Nidza
Touho Posted April 18, 2008 Author Posted April 18, 2008 Yeah, more... Hmm. How i can in broph mod change the spawn location? All times player spawns in same place.
50p Posted April 18, 2008 Posted April 18, 2008 In file broph.lua there is a function spawnThePlayer, you'll need to change the coords there. To make a random spawn points you'd need to make a table and store the spawns' coords in there. Eg.: local spawns = { } spawns[1].x = 123.4567 spawns[1].y = 234.5678 spawns[1].z = 345.6789 spawns[1].rot = 46.7891 spawns[2].x = 423.2495 spawns[2].y = 453.2564 spawns[2].z = 564.6321 spawns[2].rot = 120.6928 local rnd = math.random( #spawns ) spawnPlayer( player, spawns[rnd].x, spawns[rnd].y, spawns[rnd].z, spawns[rnd].rot )
CodeMaster Posted April 18, 2008 Posted April 18, 2008 Off topic: # local rnd = math.random( #spawns ) Too get table size (the max index) in lua you use #?
lil Toady Posted April 18, 2008 Posted April 18, 2008 Too get table size (the max index) in lua you use #? Yep, or table.getn ( yourtable ), but both methods only work with indexed tables (ids 1-n), not with arrays
Touho Posted April 20, 2008 Author Posted April 20, 2008 I want players spawns here: http://i26.tinypic.com/o0npzb.png. Script please?
50p Posted April 20, 2008 Posted April 20, 2008 I want players spawns here: http://i26.tinypic.com/o0npzb.png. Script please? Read my previous post. You can make it yourself and be proud at the same time.
Touho Posted April 20, 2008 Author Posted April 20, 2008 I want players spawns here: http://i26.tinypic.com/o0npzb.png. Script please? Read my previous post. You can make it yourself and be proud at the same time. Its not work... http://img142.imageshack.us/img142/9240/lolje1.png
50p Posted April 20, 2008 Posted April 20, 2008 Sorry, that was a quick reply... Try to make a table in a table before assigning values. Eg. spawns = { } spawns[1] = { } -- table should be created on each spawns index, like: spawns[2] = { }, etc. spawns[1].x = 123.2494
Touho Posted April 20, 2008 Author Posted April 20, 2008 Sorry, that was a quick reply...Try to make a table in a table before assigning values. Eg. spawns = { } spawns[1] = { } -- table should be created on each spawns index, like: spawns[2] = { }, etc. spawns[1].x = 123.2494 Where i put that?
SanZoR Posted April 20, 2008 Posted April 20, 2008 Ota paikan positionit admin paneelista, ja sitten lue mta:n wikistä miten luodaan spawn point.
CodeMaster Posted April 20, 2008 Posted April 20, 2008 Touho, one advice: Get your questions on IRC please, or scripting forum is going to have one (or more later ^^) B.L.A.S.T. threads which is quite unneeded. I was asking on IRC when I was starter, and I ask now too It just keeps forums cleaner because the subjects aren't so clear (like "How I can do 2?" because people don't get straight what do you need. Link to the #mta.scripting channel irc://irc.multitheftauto.com/mta.scripting Cheers Nidza
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now