-
Posts
740 -
Joined
-
Days Won
16
Everything posted by Tails
-
Btw, you can also store your pos and colors like this: pos = {x,y,z}. In example: teams = { {name = "Medic",pos = {2024.141,2045.144,22.240}}, {name = "Vagos",pos = {2024.141,2045.144,22.240}}, } for _,v in pairs(teams) do local x,y,z = unpack(v.pos) outputChatBox("Team "..v.name.."'s spawn coords are: "..x..", "..y..", "..z) end -- or for _,v in pairs(teams) do outputChatBox("Team "..v.name.."'s spawn coords are: "..table.concat(v.pos,", ")) end It's easier to work with
-
for i,t in pairs(teams) do createTeam(t.team,t.r,t.g,t.b) table.insert(peds,{ ped = createPed(t.pedID,t.x,t.y+1,t.z,270), marker = createMarker(t.x,t.y,t.z,"cylinder",0.7,t.r,t.g,t.b,255) }) end ped and marker instead. Why do you try to index ped and marker here? Do you have ped = {} and marker = {} defined somewhere? If not, just remove the i and brackets. for i,t in pairs(teams) do createTeam(t.team,t.r,t.g,t.b) local ped = createPed(t.pedID,t.x,t.y+1,t.z,270) local marker = createMarker(t.x,t.y,t.z,"cylinder",0.7,t.r,t.g,t.b,255) setElementData(marker,"team",t.team) addEventHandler("onMarkerHit",marker,markerEnter) table.insert(teamSelectors,{p = ped,mark = marker}) end
-
It's possible to have those stadium like screens and mirrors. Ren712 released this a while back: https://community.multitheftauto.com/index.php?p=resources&s=details&id=12927 You're welcome
-
Something like this should work (I'm sure there are much better ways lol) Like using regex Also your character set is very limited, what are you going to use it for? It doesn't have characters like ? ! : ( ) , . ; etc which will be used often, it will be too much anyway and you're gonna have to use regex to replace the strings properly. Unfortunately I'm bad with it, so this is all I have for you: AllowedLetters = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "_", " " } function isStringValid(str) local ch = str for _,char in pairs(AllowedLetters) do ch = string.gsub(ch:upper(),char,"") end iprint(str," matched: ",ch) if #ch < 1 then return str else return false end end I added a space to the table " ", remove it if you don't want them. Another way is to make an illegal character set and then remove those with string.gsub or again using regex
-
console Is there a way to Force a player to disconnect or quit?
Tails replied to Lord Henry's topic in Scripting
Why not just kick them? -
Replace the & with & It will show up as & when you upload it.
-
Cinema Experience updated to version 1.1! Players can no longer add the same video twice Playlist gets cleared if a player leaves and the cinema is empty Fixed messages showing up for players outside the cinema Fixed some debug errors onResoureStart Grab the latest version here! Thanks @Dutchman101 for reporting these issues!
-
Hi @Dutchman101, We already have a colshape for the cinema itself, we could easily implement such a feature if we wanted to. I'm currently working on a new version (rewritten from scratch) with custom gridlist and new features. I'll see about implementing such a thing but again, I could write that within a couple minutes. Thank you, though!
-
Thanks all! Because it can I always like to play around with APIs, not many people use them in this community. Expect a Reddit browser coming soon!
-
This resource (Player Geolocation) was created by Tails from G&T Mapping. Check us out on Facebook: https://fb.com/gtmapping About: Player Geolocation is a replacement tool for the MTA:SA default (/whois) function. This tool gives you much more information about a player with an interactive Google Maps feature (see pictures). Installation: Give the resource access to fetchRemote and your server needs to have HTTPS support (MTA:SA 1.5.2). How do I do that? Open the admin panel > resources tab > Manage ACL (upper right corner) under Groups select Admin then Add Object and name it: resource.geolocation That's it. How to use it: /lookup [name or domain name] in e.x. /lookup Jimmy or /lookup google.com Press escape to close the panel Press X to toggle the panel Download: Player Geolocation Tool 1.0
-
This thread is so useless. StefanAlmighty, might explaining what you did to fix this? I'm currently facing the same issue. I'll probably figure it out soon but it would have been nice if you had written down what you did to fix the problem.
-
Thank you!
-
You can also add the cache attribute to your meta and set it to false so the client files won't be saved to their cache folder. https://wiki.multitheftauto.com/wiki/Meta.xml It should help quite a bit.
-
Just quickly wrote this with the help of some old code of mine. It's nothing fancy. Just trying to give you an idea of how you could do it. Hold ctrl to position and left click to place. This is client side: local objectID = 3877 local objectHeightOffset = 1.6 local objectInHand = createObject(objectID,0,0,0) setElementAlpha(objectInHand,170) function holdObject(objectID) if getKeyState("lctrl") then local cx,cy,cz = getCameraMatrix() local _,_,wx,wy,wz = getCursorPosition() local _,x,y,z = processLineOfSight(cx,cy,cz,wx,wy,wz,true,true,false,true,true,false,false,false,objectInHand) if x and y and z then setElementPosition(objectInHand,x,y,z+objectHeightOffset) end end end addEventHandler("onClientRender",root,holdObject) function toggleCursor(key,pressed) if key == "lctrl" then if pressed then showCursor(pressed) else showCursor(pressed) end end end addEventHandler("onClientKey",root,toggleCursor) function placeObject(button,state) if button == "left" and state == "up" and getKeyState("lctrl") then local x,y,z = getElementPosition(objectInHand) local rx,ry,rz = getElementRotation(objectInHand) triggerServerEvent("onClientPlaceObject",localPlayer,objectID,x,y,z,rx,ry,rz) --destroyElement(objectInHand) end end addEventHandler("onClientClick",root,placeObject) And this server side: function placeObject(id,x,y,z,rx,ry,rz) createObject(id,x,y,z,rx,ry,rz) outputChatBox(getPlayerName(source).. " has placed an object at "..x..", "..y..", "..z.."!") end addEvent("onClientPlaceObject",true) addEventHandler("onClientPlaceObject",root,placeObject) The rest you can probably figure out on your own. If not feel free to ask more questions, I'll do my best to answer them.
-
You can create an object with CreateObject, then set its alpha with SetElementAlpha. Do that client-side (on player input). Tie it to the client's cursor using OnClientRenderand getCursorPostion and SetElementPosition. After that use onClientClick to trigger a server event to create an object at the same position as the low alpha object using GetElementPosition and TriggerServerEvent. Now remove the client object with DestroyElement. I've actually done something similar to this before. I can provide you some examples later if you want when I get back. Hope this helps.
-
Can you be a little more specific in terms of what you need to know, what do you want us to explain to you exactly?
-
The functions really speak for themselves. If you're planning to make an "in-game house maker" as you said, it's going to be a lot trickier in terms of position, rotation, placement and all that stuff. I can only help you a little bit with that but not that much, but I thought you just wanted to know how to get the coordinates?
-
That's really easy stuff. https://wiki.multitheftauto.com/wiki/GetCursorPosition You can use that function to get the coordinates. You can use it onClientClick.
-
Yes, it was set that way on purpose, due to users abusing the editing right and changing the topic contents after a longer while. If you need to edit your older posts, you can send a PM to moderator with the link to your post and your desired changes. Yeah I agree 100% but forbid it in the scripting section and other sections but not the tutorials or resources section. I edit my resource posts on a regular basis. Not gonna bother contacting a mod everytime.
- 84 replies
-
- mtasa
- forum stuff
-
(and 5 more)
Tagged with:
-
Yep, it is pretty weird! My local server is running 1.5.2 as well and I have opened it up for public but a lot of people can't join because they're using an older client version. And I'm not running the nightly version or anything, so I don't get that either. However, the resource is working fine for most people even for the ones that are running their servers on paid hosts. I guess the only thing you can do is to just wait for 1.5.3 or just simply do what they asked you to do, these are the only things I can think of. I think 1.5.3 will be released soon. See here: https://bugs.multitheftauto.com/roadmap_page.php
-
Another issue, we can't edit posts if someone else posts after it.
- 84 replies
-
- mtasa
- forum stuff
-
(and 5 more)
Tagged with:
-
Looks nice but a couple of problems! I lost 3-4 pages on my cinema resource topic, including the original post and possibly other topics too. The links in my signature are all pointing to this topic. There's no button at the top of the forums to show all my topics/recent posts. Please fix. Thank you
- 84 replies
-
- mtasa
- forum stuff
-
(and 5 more)
Tagged with: