Leaderboard
Popular Content
Showing content with the highest reputation on 11/07/17 in all areas
-
No offence here at all, I know you just started programming(?) and new to MTA scripting.. but you should really think about certain things. Stop coding and before you touch your mouse and keyboard, which is really hard, I know, do the logic in your head. You want to spawn a truck when player enters the marker -> simple. But how am I gonna do that? Well, do I need client or server? Server, because cars must be spawned on the server. This brings up the question, do I create the marker client or server side? Well, I can do it client side, but that wouldn't make sense since I still need to trigger to server.. why don't I create the marker on server to spawn my truck right away? The problem in your code is that you assumed you will have hitElement on the server, but you won't, since you never passed the "hitElement" argument in your triggerServerEvent. I know this community here is great, people will always help you, but you should really trace down the problems yourself. I'm pretty sure MTA is complaining about that hitElement not being defined...3 points
-
Thanks @pa3ck Needed that you're right, not thinking it out, should make plan then use wiki to find stuff..... Otherwise I'll get nowhere.2 points
-
Hello to whoever is reading this topic, today I've decided to take some time and explain in (personally) easiest possible way how to make a drawing or a GUI that will fit all resolutions, no matter if it's 1280x1024 or 640x480. Here are the following steps: Let's say you're using 1280x1024 resolution. You have the following function: dxDrawText("$10000000", 990, 200, 1100, 250, tocolor ( 0, 0, 0, 255 ), 1, "pricedown") Take out the positionings from the function: 990, 200, 1100, 250 Divide 1280 with X positions (990, 1100) separately. You'll get 1280/990=1.292929 and 1280/1100=1.16363 Do the same with Y positions, but use 1024 as that is maximum height (aka Y of the screen). You'll get 1024/200=5.12 and 1024/250=4.096 The numbers you got are the scales that will work in every resolution as they work in your resolution (1280x1024). To use those scales, simply divide the clients' resolution with the scale, for example: screenWidth, screenHeight = guiGetScreenSize() dxDrawText("$10000000", screenWidth/1.292929, screenHeight/5.12, screenWidth/1.16363, screenHeight/4.096, tocolor ( 0, 0, 0, 255 ), 1, "pricedown") That's it! There's an extra scaling you can do for text size, which is tricky to work with (due to text getting blurred, ugly and unreadable) but if you're up for it: screenWidth, screenHeight = guiGetScreenSize() scale = (screenWidth/1280)*(screenHeight/1024) -- this will give you a number that will vary around 1, depending on clients' resolution (if resolution is smaller, scale will be below 1, if higher then above 1) dxDrawText("$10000000", screenWidth/1.292929, screenHeight/5.12, screenWidth/1.16363, screenHeight/4.096, tocolor ( 0, 0, 0, 255 ), scale*1, "pricedown") -- as you can see I multiplied the text size (1) with the scale, which means the text will be bigger or smaller (again, depending on the clients' screen resolution) Hope I helped, please provide some feedback for future references!1 point
-
Heya, This is a small project I've spend three days on so far. I was bored of the same old desert so I decided to add a canyon. I feel like this gives the desert a fresh, new feeling while still retaining the good ol' San Andreas vibe. https://www.youtube.com/watch?v=RwetzEnNs-8&feature=youtu.be Things I've yet got to do: Create LOD models. Prelight the models so they fit in more with the enviroment. Small tweaks here and there. Let me know what you think! -Noah1 point
-
اقبل ولكن بمقابل مادي طرق الدفع كروت سوا او تحويل بنكي كلمني هدا سكايبي elkihel.aassim1 point
-
Yes. <meta> <script src="bug.lua" type="server" /> <script src="bug.lua" type="client" /> </meta>1 point
-
كلينت addEvent ( "setPlaces" , true ) addEventHandler ( "setPlaces" , root , function ( Table ) guiGridListClear ( GridList ); for index,values in ipairs ( Table ) do local row = guiGridListAddRow ( GridList ) ; guiGridListSetItemText ( GridList , row , 1 , values [ 'name' ] , false , false ) guiGridListSetItemData ( GridList , row , 1 , fromJSON ( values [ 'position' ] ) ) end end ) سيرفر executeSQLQuery ( "CREATE TABLE IF NOT EXISTS aTails_Places ( name , position )" ); addEvent ( "addNewPlace" , true ) addEventHandler ( "addNewPlace" , root , function ( aName ) local aResult = executeSQLQuery ( "SELECT * FROM aTails_Places WHERE name=?" , aName ) if ( aResult and #aResult == 0 ) then local aPos = { getElementPosition ( source ) } ; executeSQLQuery ( "INSERT INTO aTails_Places ( name , position ) VALUES ( ? , ? )" , aName , toJSON ( aPos ) ); outputChatBox("تم إضافة المكان",source,255,255,0,true) else outputChatBox ( "هذا المكان موجود سابقا" , source ) end end ) ; addEvent ( "getPlaces" , true ) addEventHandler ( "getPlaces" , root , function ( ) local aResult = executeSQLQuery ( "SELECT * FROM aTails_Places" ) if ( aResult and type ( aResult ) == "table" and #aResult ~= 0 ) then triggerClientEvent ( source , "setPlaces" , source , aResult ) ; end end );1 point
-
@iMr.Omar ماينفع تخزن الاحداثيات في التيبل وانت مسوي كولمنين فقط راح يخزن الاسم واحداثي اكس @Talis انت تبيه فقط لك تضيف اماكن والزوار يشوفها ولا اي زائر يضيف اماكن ؟1 point
-
1 point
-
1 point
-
1 point
-
--- Client Side addEventHandler ( "onClientGUIClick" , resourceRoot , function ( ) if ( source == create ) then local aName = guiGetText ( editwarp ) ; if ( aName ~= "" or aName ~= " " ) then triggerServerEvent ( "addNewPlace" , localPlayer , aName ) ; end end end ); addEventHandler("onClientResourceStart",resourceRoot,function() setTimer ( function ( ) triggerServerEvent ( "getPlaces" , localPlayer ); end,1500,1) end); addEvent ( "setPlaces" , true ) addEventHandler ( "setPlaces" , root , function ( Table ) guiGridListClear ( GridList ); for index,values in ipairs ( Table ) do local row = guiGridListAddRow ( GridList ) ; guiGridListSetItemText ( GridList , row , 1 , values [ 'name' ] , false , false ) guiGridListSetItemData ( GridList , row , 1 , values['position'] ); end end ) ; --- Server Side executeSQLQuery ( "CREATE TABLE IF NOT EXISTS aTails_Places ( name , position )" ); addEvent ( "addNewPlace" , true ) addEventHandler ( "addNewPlace" , root , function ( aName ) local aResult = executeSQLQuery ( "SELECT * FROM aTails_Places" ) if ( aResult and type ( aResult ) == "table" and #aResult ~= 0 ) then for i,v in ipairs ( aResult ) do if ( v [ "name" ] == aName ) then return end end end local x , y , z = getElementPosition ( source ) ; executeSQLQuery ( "INSERT INTO aTails_Places ( name , position ) VALUES ( ? , ? )" , aName , tostring(x)..","..tostring(y)..","..tostring(z) ); outputChatBox("تم إضافة المكان",source,255,255,0,true) end ) ; addEvent ( "getPlaces" , true ) addEventHandler ( "getPlaces" , root , function ( ) local aResult = executeSQLQuery ( "SELECT * FROM aTails_Places" ) if ( aResult and type ( aResult ) == "table" and #aResult ~= 0 ) then triggerClientEvent ( source , "setPlaces" , source , aResult ) ; end end ); لو تبي تخليه لو ظغط زر وينتقل للامكان إستخدم guiGridListGetItemData split setElementPosition1 point
-
unbindKey("t", "down", "chatbox", "say") bindKey("t", "down", "chatbox", "عام") addCommandHandler("عام", function (cmd, ...) local msg = table.concat (..., " ") if not msg then return end executeCommandHandler("say", msg) end )1 point
-
you should use wiki before creating a plan... if the plan fails use GOOOGlE and then forum.1 point
-
@pa3ck Belive me, i would comment "use /debugscript 3 and read this" everywhere, in every post.Nah, even if you know enligsh, than u can suppose whats the error..For example i never have read that Debugging turorial. P.S. bad enlgish... sometimes1 point
-
I want to help you, but i cant write a script now..Use some setElementData, and some if statements.And, if you have a custom minimap, that its much easier Btw, if the blip is created client side, i think you can destroy it with destroyElement(), but im not sure about that(and im lazy to look at the element list) Edit ==> Blip is an element.Element list ==> elements.1 point
-
@Pirulax good try but it'll never work. getElementsByType("object") and not getElementByType("objects") will only return objects created from createObject(). I don't think that kind of function exists, sorry.1 point
-
If it's a leaked script, the MTA community will not help him.1 point
-
MTA is not that kind of game which loves trailers...There will be some syncing bugs1 point
-
I would change that root to just resourceRoot, because the eventHandler is in the same resource.You can save a little bit of cpu. addEventHandler("onColShapeHit", resourceRoot, function(player, dimension) if colshapes[source] then outputChatBox("player entered the col shape", player) end end) btw i think everything is working fine.1 point
-
1 point
-
@#BrosS ماينفع لازم اكثر من ماركر وكل ماركر يحطه بدمنشن كودك راح يحطه من 1 الى 20 وبعدين اخر دمنشن 20 يعني يصير في 20 فقط1 point
-
I doubt about such level of customization as MTA, but perhaps with time we'll see something worthy. And rockstar already have closed few multiplayers and will try to stop that alternative stuff, so progress is slower then it could be. As for me the best for now is Rage multiplayer, at least because of good synchronization1 point
-
What - The - :O ? Please explain correctly what do you want to make ? How could we help you ?1 point
-
1 point
-
1 point
-
Section Rules 1. Any fulfilled requests or discarded offers shall be reported via the report system in order to be locked and/or archived. This is mandatory, as the goal is to keep this section as clean and accurate as possible. 2.Topics must have a sufficient description of what are you offering or looking for. Eg. if you're looking for a scripter for your gamemode, you must detail what would you need the scripter for. This doesn't exactly involve giving away the whole concepts or whatever you don't want to disclose to the public, but it would be appreciated if you could include more details than just straight single line offers, such as "I need a scripter for a zombie gamemode". Whether or not the amount of detail is sufficient for the nature of your request is a subject to moderator judgement, and failing to meet criteria may result in your post being discarded. Formatting your topic In order to keep the section clean, accurate and easily viewable, it would be appreciated if you could use the following guidelines for your topic: 1. Topic titles should have the form [LF/OFFERING] Brief description [Paid/Non-Paid]. Please make the description as brief as possible here. Eg: [OFFERING] Skilled scripter [Paid] [OFFERING] Rookie modeller looking for some practice [Non-paid] [LF] Any-level scripter for a small server [Non-Paid] 2. The first post should be written in at least 2 parts: first part should contain a brief description of yourself (and/or the server or community you are from) second part should elaborate on what are you requesting/offering, once again, as detailed as you possibly can/want1 point
