Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by MAB

  1. MAB


    I opened the ports in the wifi router that is the pc connected with and in the windows firewall as well but the mta server says that they are still closed... The IP is correct and etc..
  2. How to make a line do like a circle progress bar.. it's a circle and it appears more and more with increasing the value but it is a line not a circle
  3. getLocalization This function gets the MTA general language on the player's PC? How i know these language codes or name? am i magician? and what does ["code"] mean? local languageCode = getLocalization()["code"]
  4. MAB

    Top bar chat

    I tried to prevent this resource from changing the text alpha, just show it and after its time remove it.. i failed.. little help?
  5. Damn.. I am going to use images
  6. look at this function.. edges are missed up, how to fix it
  7. It is called "on Shop Markers Hit" but idk why the forum change it to :~ try it without spaces and you will see
  8. "object" is wrong, you can't pass elements as strings. local IdAA = getElementModel(selecteda[object])
  9. MAB

    Few questions.

    create a new table ( you should know how to do this, if not use the spoiler ) After that, allow users to chat in those channels by either loading their nickname in there, or username, or id, or what ever the hell you want. Add a new command that allows them to switch to channels, create their channel or what so ever. Once they used the command, load their specific data into the table, or just their character. After they joined a channel, using a command to talk will output a message to all the users which are in that channel. A quick tiny example would be; local channels = { }; addCommandHandler ( "joinChannel", function ( thePlayer, _, channel ) if ( channel ) then if not ( channels [ channel ] ) then channels [ channel ] = { }; outputChatBox ( "Creating a new channel with the name: ".. channel, thePlayer ); end table.insert ( channels [ channel ], thePlayer ); setElementData ( thePlayer, "channel", channel ); else outputChatBox ( "Please provide us a channelname.", thePlayer ); end end ); addCommandHandler ( "cc", function ( thePlayer, _, ... ) local channel = getElementData ( thePlayer, "channel" ); if ( channels [ channel ] ) then if ( channels [ channel ] [ thePlayer ] ) then for i = 1, #channels [ channel ] do if ( not isElement ( channels [ channel ] [ i ] ) ) then channels [ channel ] [ i ] = nil; else outputChatBox ( "[".. channel .."] ".. getPlayerName ( thePlayer )..": ".. table.concat ( {...}, " " ), channels [ channel ] [ i ] ); end end end end end ); You think i can't do this? I am looking for the chat channels that looks like the main chat one like in SAUR.
  10. MAB

    Element Data

    If I recall correctly MTA already uses element data for pretty much all entities. For example; local oX, oY, oZ = getElementPosition(object) -- Is the same as local oX, oY, oZ = getElementData(object, "posX"), getElementData(object, "posY"), getElementData(object, "posZ") @Godbless: Noki is right, however. You're making very poor use of the element data. The general idea is good and you can use element data for it with good results - but it's your way of executing it that is bad. Instead of adding 7 new data entires for every marker, you could just add one containing an array instead. Better yet, you could use tables instead of element data. I understand, i am just giving an example of any element data use and the main and only target from it is explaining more about element data functions for better understanding.
  11. MAB

    Few questions.

    Any example of chat channel?
  12. MAB

    Element Data

    Hahahaha. Read it well and you will see that i wasn't setting the marker position as data. If you don't use element data functions much that doesn't mean that others do the same. You just don't know how useful they are.
  13. MAB

    Few questions.

    What i don't understand is why there are dbFree and dbPoll don't SELECT return it already? Example: m = dbQuery(connection,"SELECT x,y,z.....) can i do now: setElementPosition(element,m[1],m[2],m[3])
  14. MAB

    Floating markers

    Thanks, haven't test yet but thanks for the information. I overwrite t float function by mistake.
  15. MAB

    Element Data

    Hi, i am Michael Amir and i am going to explain setElementData and getElementData because much people don't understand them also i didn't at first. This is for you to understand them only, don't use them much and try to avoid them as possible as you can. Lets say you are wearing a coat with 100 pockets. You want but your wallet on one of them without forgetting it, so we will name that pocket "wallet pocket" and put a mark on it. That is what setElementData do. The server got million of places to store data (like pockets to put stuff in) and it mark them too. setElementData will go to one of these places and name it and store something in it for example: setElementData(localPlayer,"carKeys",true) what we did here is that we went to a pocket of localPlayer pockets and named it "carKeys" and we stored the value "true" on it. You can name the pocket whatever you want and store whatever you want too. string, int, float and etc .. any thing you want. now getElementData returns the stored value in the given place. example: getElementData(localPlayer,"carKeys") This returns us the value "true" because we set it to "true" before (look up) What will happen if we used getElementData on a empty place? it will return us the value "false". Example: getElementData(localPlayer,"watchPocket") It returns false because the place "watchPocket" is empty. we stored nothing in it. Example of script using element data to shortcut coding on shops resource:
  • Create New...