-
Posts
370 -
Joined
-
Last visited
-
Days Won
2
Posts posted by AJXB
-
-
7 hours ago, FernandoMTA said:
oooo interesting
Is the project available for contribution on GitHub or something?
7 hours ago, TMTMTL said:Nice work!
As Nando said it would be cool if this was a Git repo so it could be contributed to, it couldbe used in many instances I would thinkThank you! Yes, I just added the Github link: https://github.com/MrgSub/mtasa-ai
-
1
-
-
Use AI in your MTA:SA resources.
Powered by providers like OpenAI, Anthropic & Groq. You can now bake Artificial Intelligence into your resources, gamemodes and systems.
This resource exports the below functions:
init(config) generateText(prompt,system) generateObject(prompt, system) getProviders() getModels(provider) getConfig()
Example usage:
The below code initializes the AI agent (add your API key from the provider) and creates a ped and a marker. when the player hits the marker, the ped says something funny.
addEventHandler("onResourceStart", resourceRoot, function() AI.init({ api_key = "", provider = "groq", model = "llama3-8b-8192", temperature = 0.7, max_tokens = 150 }) createPed(0, 0, 0, 5) local marker = createMarker(0, 0, 2, "cylinder", 5, 10, 244, 23, 10, root) local function handleMarkerHit(hitElement) local elementType = getElementType(hitElement) if elementType ~= "player" then return end local playerName = getPlayerName(hitElement) outputDebugString("Player "..playerName.." hit marker") AI.generateText(playerName.." got close to you, say something funny, and out of pocket. Limit is 255 characters. Your name is Pedro. Don't use quotes.", "You are a random pedestrian living in San Andreas, grand theft auto.")( function(result, error) if error then outputDebugString("Error: " .. error) return end if (result:len() >= 254) then result = result:sub(1, 254) .. "..." return end outputChatBox("[Pedro]: "..result, hitElement, 255, 255, 255) end ) end addEventHandler("onMarkerHit", marker, handleMarkerHit) end )
Download:
https://community.multitheftauto.com/index.php?p=resources&s=details&id=18946
Roadmap:
- Support conversation history
- Support streaming
-
Contributing:
Contributions are welcome on Github: https://github.com/MrgSub/mtasa-ai
-
1
-
-
2 hours ago, LoveFist said:
You can make bots easily. Check this out https://wiki.multitheftauto.com/wiki/CreatePed
He's talking about bots to replace players and you're talking about creating peds. Not the same thing
-
How about no
-
Get the default acl.xml file and try again?
-
2 hours ago, Sorata_Kanda said:
I do use the db functions too, but I'm sort of worried that my meta.xml turns to a mess due to the amount of functions I export.
The healthy thing to do is to make one resource and just export the functions.
Otherwise, you're just repeating code and that's useless.
-
On 02/09/2018 at 05:25, Simple01 said:
// SERVER function nickHandler( playerNick ) if ( playerNick and ( #playerNick <= 3 ) ) then // DO SOMETHING cancelEvent() // KICK end end addEventHandler( 'onPlayerConnect', root, nickHandler )
Way to reinvent how Lua comments are supposed to be.
-
1
-
-
3 hours ago, Mr.Solo said:
EDIT, We decided to make everything from scratch. we are not going to use anything From OWL or any other Leaked Source.
MORE ABOUT THE SERVER HERE http://goo.gl/qDrn8Z
Wow that's so cute that you don't wanna use leaked sources.. lmfao
I can make the entire gamemode in no time, but are you paying well enough?
-
On 7/15/2018 at 12:57, Lampard1 said:
Thank you for your feedback. All the resources we are providing on our shop will get updated, with new versions being released regularly. In one of the version, we will surely change our GUIs!
And if I may ask, do you update the purchased resources for each client after you update the versions?
Also, how are you protecting these resources from being leaked? (someone can purchase one resource and leak it since you're selling the source code, I presume)
-
10 hours ago, vectorvc97 said:
للاسف ما ضبط
يا حبيبي مافي شي بالبرجمة اسمه "ما ضبط".. شو الخطأ؟ شي استوا؟
-
16 hours ago, iSubvibe said:
you both don't know what you're talking about. show me how u can make a theme?'
themes aren't useless. i've sold themes for 200 euros you just dont know the work people put in IPS themes.
They aren't useless, they look good, and your theme looks good. but if you think it's worth 200 euros, it's not. at least not to me. But I wouldn't be surprised if "clans" pay that much.
Anyway, good luck
-
First you wanted to trigger the event onWasted, then onDamage, now you're asking onWasted again.
What. Do. You. Want?
-
Or trigger an event when the player types anything and set a timer to reset the status
-
local team = getTeamFromName('Players') setPlayerTeam(source,team)
-
I just added it in the right place and added an "end" for the if.
Just copy my code, you need to learn more from the wiki how Lua works
-
Doesn't work that way, functions in single player are different, yes, they have the same result, but they're not written in plain Lua, they're compiled.
What's the point of your question? or is it just knowledge?
-
On 6/10/2018 at 18:22, Fist said:
server has been closed for a long time but then i sold it and it somehow got leaked by a brazilian guy named "Sil3nce". Whatever, maybe i'll soon release full original code.
You should
-
1
-
-
local serialMute = { } function doAction(thePlayer, cmd, actionId, playername, arg3) if (isElement( thePlayer )) then if actionId then local actionId = tonumber(actionId) local player = getPlayerFromNamePart(playername or "") local name = getPlayerName(thePlayer) if player then if actionId == 1 then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then local duration = (tonumber(arg3) or 0) * 60 * 1000 setPlayerMuted(player, true) outputChatBox(getPlayerName(player).." #005A0Ehas been muted by #FFFFFF"..name.."#005A0E.#FFFFFF Reason: insulting #005A0EDuration #FFFFFF["..math.floor((duration *1.66666667 * 1/100000)).." mins].", root, 255, 255, 255, true) local timer = setTimer ( unmute, duration, 1, player ) serialMute [ getPlayerSerial ( player ) ] = { duration, timer }) end end else outputChatBox("Could not find the player.",thePlayer, 255, 0, 0) end end end end addCommandHandler("action", doAction) function unmutePlayer(player,command,victimName) if victimName then local victim = getPlayerFromNamePart(victimName or "") if victim then if ( isPlayerMuted(victim) ) then setPlayerMuted(victim, false) end end end end addCommandHandler("unmute",unmutePlayer) function onJoin () local serial = getPlayerSerial(source) local muted = serialMute [ serial ] if ( type ( muted ) == "table" ) then if ( muted [ 1 ] ) then setPlayerMuted ( source, true ) local timer = setTimer ( unmute, muted [ 1 ], 1, source ) serialMute [ serial ] [ 2 ] = timer return end end setPlayerMuted ( source, false ) end addEventHandler ( "onPlayerJoin", getRootElement(), onJoin ) addEventHandler ( "onPlayerQuit", root, function ( ) local serial = getPlayerSerial ( source ) local muted = serialMute [ serial ] if ( type ( muted ) == "table" ) then if isTimer ( muted [ 2 ] ) then local timeLeft = getTimerDetails ( muted [ 2 ] ) killTimer ( muted [ 2 ] ) serialMute [ serial ] [ 1 ] = timeLeft end end end ) function unmute ( thePlayer ) if isElement ( thePlayer ) then setPlayerMuted ( thePlayer, false ) serialMute [ getPlayerSerial ( thePlayer ) ] = nil outputChatBox ( "You have been unmuted by Console.", thePlayer, 0, 255, 100 ) end end function getPlayerFromNamePart(name) if name then for i, player in ipairs(getElementsByType("player")) do if string.find(getPlayerName(player):lower(), tostring(name):lower(), 1, true) then return player end end end return false end
Try this
-
What the hell is that? line 74 and 75 are not in a function.. What..
-
You can.
-
See, it depends on many factors if changing the config didn't work. try writing a resource that starts these two resources for you (give it admin ACL)
And then see where that takes you
-
Did you restart the server after you added yourself?
If so, repost your code.
-
cancelEvent()
-
Did you add yourself in the ACL file?
Realistic Billiards
in Resources
Posted
Very cool! And to be done with limited resources is great!