Jump to content

Smart.

Members
  • Posts

    340
  • Joined

  • Last visited

Everything posted by Smart.

  1. Wouldn't it be easier to just pass the object element in setTimer as an argument? items = { {-1434, 2668 , 55.68 }, {-1460, 2669, 55.66 }, } addEventHandler ( "onResourceStart", resourceRoot, function() for_,v in pairs ( items ) do local object = createObject ( 929, v[1], v[2], v[3] ) setTimer(destroy, 5000, 1, object) end end ) function destroy(element) if (not isElement(element)) then return end destroyElement(element) end
  2. Smart.

    country ban ability

    You can get the player country from an exported function in the default admin panel if I remember correctly then check if the country is one of the "forbidden" ones when they join and ban them if they are
  3. Or do a variable, count = 0 before the loop then count = count + 1 inside.
  4. In case you haven't realized yet, I'm not fixing this if you want to use it you'll have to fix it yourself.
  5. you should upload CEDmisc I'll have it updated asap for now the resource does NOT work. (Can't update it right now as I've changed computer and seems like I lost couple of resources but will fix it asap as I said)
  6. Not entirely sure, seems like I fucked up something when I added the log option yesterday and I'm currently on my mac which i need to install windows on, will take a look at it later. Is there any debug about the .slua file not being loaded?
  7. Smart.

    bans

    You need to use a custom ban system for that, pretty sure Arran released his SQLbans quite a while ago, look on the community site and see if you can find it.
  8. Releasing a group system I made for a project that never was finished and instead of it taking up space on my hdd and doing no good I decided to release it. The group system comes with: Group List Custom Ranks Group Chat (/gc text) Group Info Group Invites Group Warnings (100+ warning level = kick) Ability to change turf and/or group color (/chatcolor R G B /turfcolor R G B) It works well with both sqlite and MySQL. Export functions: viewWindow(player) -- opens the group window for the player getGroupRankCount(rank) -- returns an integer of how many things the rank has access to getPermissionCount(player) -- returns an integer of how many things the player has access to checkGroupAccess(player, actionID or actionString) -- checks if the player has access to the action. I'll provide you with a table later, either the number or the string works well. outputGroupMessage(message, group) -- outputs a message to every player in the group with the group color getPlayerJoinDate(player) -- get the date when the player joined his group getPlayerWarningLevel(player) -- get the current warning level of the player getPlayerGroupRank(player) -- get the rank string of the player getPlayerGroup(player) -- get the group string of the player getGroupMembers(group) -- returns a table of the player(s) inside that group (not entirely sure whether I finished this function, if not I will soon) isRank(string) -- checks if the rank exists removeRank(group, rank) -- removes the given rank from the group getGroupChatColor(group) -- returns a R G B with the chat color. -- The permission table: local permToTable = { [1] = "invite", [2] = "promote", [3] = "demote", [4] = "kick", [5] = "warn", [6] = "delete", [7] = "deposit", -- -- Irrelevant because feature is not made, yet. [8] = "withdraw", -- -- Irrelevant because feature is not made, yet. [9] = "editInfo", [10] = "viewLog", -- Irrelevant because feature is not made, yet. [11] = "viewBlacklist", -- -- Irrelevant because feature is not made, yet. [12] = "addBlacklist", -- Irrelevant because feature is not made, yet. [13] = "changeTurfColor", [14] = "modifyAlliance", -- Irrelevant because feature is not made, yet. [15] = "modifyRanks", } Download Link: https://community.multitheftauto.com/index.php?p= ... ls&id=8291 Couple of screenshots: Little Extra: If you use it with MySQL which I suggest then you can do fun things like a group list on a website using this php code (Note: Isn't tested might not work but it should) : <?php$con=mysqli_connect("localhost","root","password","name");// Check connectionif (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM groups ORDER BY date DESC"); while($row = mysqli_fetch_array($result)) { echo "Group Name: " . $row["name"] . " - Leader: " . $row["leader"] . " - Created: " . $row["date"]; echo " "; } mysqli_close($con);?>
  9. use guiSetVisible(source, false) assuming the source is the button (a button is a gui element so guiSetVisible does work)
  10. This is a small chat .php code I made, you will have to make the lua code yourself but this should give you an idea on how it works. <?php $con=mysqli_connect("localhost","user","pass","db_name"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM chat"); while($row = mysqli_fetch_array($result)) { echo $row["message"]; echo "<br>"; } mysqli_close($con); ?> To order the chat, making the newest input the first you could create a date table and then use "ORDER BY date DESC"
  11. You could make a button and set it's alpha to 0 to make it invisible, but I'd suggest you to use onClientClick and get the absoluteX and absoluteY and check if they're close to, or the same as the dx one.
  12. https://wiki.multitheftauto.com/wiki/SetTimer
  13. Smart.

    Server list spam

    Our server is still in development but some lowlifer is having a server with our name except that the guy changed International to Internetnational and they're using our resources too, which unfortunately was leaked http://i.imgur.com/BSclmaA.png their: mtasa://193.183.98.104:22006 our: mtasa://188.40.40.150:22010
  14. Smart.

    isPedBlood ?

    He means if someone is bleeding this function would return true because onPlayerDamage can be a bit laggy (I think)
  15. player = getLocalPlayer() is a waste, you could just do setElementModel(localPlayer, 286)
  16. I bet your wont understand but you can use getElementData/setElementData to set and get the account name of a player
  17. If this is a server sided script you're aware that every player will get those messages? and oh, the player isn't passed onto the function. Also, all those markers/blips will be visible for every player. If it's a client script which I guess then change player to localPlayer and remove the second argument of outputChatBox as there isn't any visibleTo argument when using outputChatBox client sided.
  18. Smart.

    asdasd

    You have to have your own drug system for it to work I just realized
  19. Smart.

    asdasd

    lol? Are those the only ones you made? If not can you PM Me the others because these are useful and I bet the others would be too. I've made a couple others but I lost them and can't access them anymore OH, I found the druglab resource which was/is mainly used on S2 I believe, it can be downloaded here: https://community.multitheftauto.com/in ... ls&id=6786
  20. you claiming to be a programmer because you know lua is ridiculous
  21. lol oh and ur not an mta programmer, you're a lua scripter.
  22. Smart.

    Mechanic

    You sure that the setElementHealth is 1000 not 100 in the script?
  23. Smart.

    Mechanic

    a vehicle got 1000 health so if (getElementHealth(clickedElement) <= 999) then
×
×
  • Create New...