simstosh
Members-
Posts
44 -
Joined
-
Last visited
Everything posted by simstosh
-
Yea, I know, but, how can I set a dimension to a marker? Using getElementType and SetElementDimension? Can u give me a example?
-
Hi. I've downloaded the LSAN resource (Los Santos Ammunation), and do some adaptations on the script, adding a marker to all ammunations accessible to players and recreate the GUI menu (who are bugging with other GUI's on my script). But, when I enter on a Ammunation, the script works (cause he gets the player position and shows the menu), but the marker won't show, because the 'interiors' resource uses different dimensions for the teleports won't bug depending of the ammunation you enter. So, when the dimension = 0, the marker shows normally, but the player go to any ammunation in SA. How can I set the marker to show to the player when he enters in any ammunation? Here is the .lua, on Pastebin: http://pastebin.com/MXDFSKy7 Thanks
-
I don't know too, but, u can try the radio3d resource https://community.multitheftauto.com/index.html?p ... ils&id=532 But, what I've seen and understanded, you need to put the musics (.mp3 files) on a web host and set up the resource to show the musics for the players. U can try
-
Thanks 50p, very useful, now works Last question, to "close" my questions... I set up a PM system, but how can I do to return a full name only typing a part of the name? Ex.: /pm sim Hi = "PM to simstosh: Hi" I do here, but only with getPlayerFromName, so he needs the full name... And how can I disable the GTA clock to use a fixed time? I searched but haven't results... Thanks
-
lol, I haven't noticed about the missing ".." Now the command works But I've put the follow lines to show the entire message local words = {...} local message = table.concat(words, " ") but now he wasn't checking if exists some message, to return the 'Correct Usage' phrase... What I need to do?
-
Well, I don't know why, but the chat and the /do works normally. I do other commands (/o & /ooc, /b, and the /me), but I can't put this working... The /me doesn't work. I think it's because MTA already has this function on onPlayerChat (messageType = 1). I've used him on sendMessageToNearbyPlayers function, but I want to put "Correct Usage: /me [text]" on him, to the player who doesn't know the function usage. If stays at this function, I can't put to show the message. The (/o)oc and the /b, if I use only the command, he returns "Uso correto: /b [texto]" or something like that, and if I put the text after the command, nothing returns on game, buton on console shows this: [17:24:24] ERROR: zmrp\zmrp.lua:217: attempt to call local 'message' (a string value) >> refeer to (/o)oc [17:24:28] ERROR: zmrp\zmrp.lua:227: attempt to call local 'message' (a string value) >> refeer to /b Here is the lines. I tried to put all on one function to the commands use the same variables, like on Wiki, but still don't working. function chatFunctions (player, commandName, message) local posX, posY, posZ = getElementPosition( player ) local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) local playerNameIs = getPlayerName (player) if(commandName == "ooc" or commandName == "o") then if(message) then if(AllowOOC == 1) then outputChatBox( "(( [GLOBAL OOC]"..playerNameIs..": "..message" ))" ) else outputChatBox ( "O Chat OOC foi bloqueado por um administrador.", player, 255, 153, 0 ) end else outputChatBox ( "Uso Correto: /(o)oc [texto]", player, 255, 153, 0 ) end elseif(commandName == "b") then for index, nearbyPlayer in ipairs( nearbyPlayers ) do if(message) then outputChatBox( "(( [LOCAL OOC]"..playerNameIs..": "..message" ))", nearbyPlayer ) else outputChatBox ( "Uso Correto: /b [texto]", player, 255, 153, 0 ) end end elseif(commandName == "do") then for index, nearbyPlayer in ipairs( nearbyPlayers ) do if(message) then outputChatBox ( message.." (( "..playerNameIs.." ))", nearbyPlayer, 255, 153, 0 ) else outputChatBox ( "Uso Correto: /do [ação]", player, 255, 153, 0 ) end end elseif(commandName == "me") then for index, nearbyPlayer in ipairs( nearbyPlayers ) do if(message) then outputChatBox( playerNameIs.." "..message, nearbyPlayer, 153, 51, 153 ) else outputChatBox ( "Uso Correto: /me [ação]", player, 255, 153, 0 ) end end end end addCommandHandler( "ooc", chatFunctions ) addCommandHandler( "o", chatFunctions ) addCommandHandler( "b", chatFunctions ) addCommandHandler( "do", chatFunctions ) addCommandHandler( "me", chatFunctions ) Thanks
-
@varez Yeah, I haven't use MySQL on MTA, I think it his use is only on extreme cases (too much data for a server, or espcially for web use). On my case, i'm using the SQLite, cause is a simple server. On SA-MP I do a fully integrated server/website, but SA-MP's MySQL plugin uses too much resources (memory leaks), so for SA-MP I don't recommend MySQL.
-
i've changed 'source' by 'player', now /do works, but the normal chat returns the bad argument errors...
-
No, you didn't understand... The normal chat works perfectly. the ChatRadius stays at the start of the script (local chatRadius = 20). I just copied the functions from the "sendMessageToNearbyPlayers" and put on the commands. The chat works normal, but the commands not (Chat doesn't return any error, but the commands yes, and the base stays at the same)... Understand now?
-
Hi. I'm working on a Zombie Roleplay script (isn't complex like a default roleplay server, but a "basic" version of him, only some commands/gameplay style like) to put on my server. I search about the proximity chat on wiki and i got one on onPlayerChat section. The chat (without commands) works normally... I've tried to do the same thing to the commands, but he gave me only errors on console, like: [2010-08-11 01:12:30] WARNING: zmrp\zmrp.lua:224: Bad argument @ 'getElementPosition' [2010-08-11 01:12:30] WARNING: zmrp\zmrp.lua:225: Bad argument @ 'createColSphere' [2010-08-11 01:12:30] WARNING: zmrp\zmrp.lua:226: Bad argument @ 'getElementsWithinColShape' [2010-08-11 01:12:30] WARNING: zmrp\zmrp.lua:227: Bad argument @ 'getPlayerName' [2010-08-11 01:12:30] WARNING: zmrp\zmrp.lua:228: Bad argument @ 'destroyElement' [2010-08-11 01:12:30] ERROR: zmrp\zmrp.lua:230: bad argument #1 to 'ipairs' (table expected, got boolean) This errors shows whenever I use /me text or /do text. Here is the complete chat lines: function sendMessageToNearbyPlayers( message, messageType ) if messageType == 0 then local posX, posY, posZ = getElementPosition( source ) local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) local playerNameIs = getPlayerName (source) destroyElement( chatSphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do outputChatBox( playerNameIs.." diz: "..message, nearbyPlayer ) end end end addEventHandler( "onPlayerChat", getRootElement(), sendMessageToNearbyPlayers ) function TalkMe (player, commandName, message ) if(message == "") then OutputChatBox ( "USO: /me [ação]", player, 255, 255, 0 ) end local posX, posY, posZ = getElementPosition( source ) local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) local playerNameIs = getPlayerName (source) destroyElement( chatSphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do outputChatBox ( playerNameIs.." "..message, nearbyPlayer, 238, 18, 147 ) end end addCommandHandler ( "me", TalkMe ) function TalkDo (player, commandName, message) if(message == "") then OutputChatBox ( "USO: /do [ação]", player, 255, 255, 0 ) end local posX, posY, posZ = getElementPosition( source ) local chatSphere = createColSphere( posX, posY, posZ, chatRadius ) local nearbyPlayers = getElementsWithinColShape( chatSphere, "player" ) local playerNameIs = getPlayerName (source) destroyElement( chatSphere ) for index, nearbyPlayer in ipairs( nearbyPlayers ) do outputChatBox ( message.." (("..playerNameIs.."))", nearbyPlayer, 238, 18, 147 ) end end addCommandHandler ( "do", TalkDo ) function blockChatMessage() cancelEvent() end addEventHandler( "onPlayerChat", getRootElement(), blockChatMessage ) And how can I force to show a message, like "Correct Usage: /me [action]" if the player only type /me or /do? Thanks for all
-
I think u gonna need to do a big job involving all... Also I recommend to use the sqlitedb included on mta, cause is too much easy to manage, and you don't need to use third-party resources... Well, u gonna need to use MySQL to link the stats to a website?
-
I saw on a server that the cars around have little grey blips, like on SA-MP... How can I do that for my server? Thanks
-
Slothman, have some way to activate the zombies_client after the player login or register? I've tried to use TriggerClientEvent and added clientsetupstarter as a single event, but doesn't work. I don't want to show the zombies count on a black screen Oh, and use dxscoreboard instead of use the default scoreboard? Have some way?
-
You are running the server only with the resources, you need a gamemode to work. Try to add this after zombies
-
@Remp Ty, that's what I was talking. Now works. I've searched on the parameters but haven't noticed about this parameter Well, this is very useful for much people, and for me... Thanks so much. @varez I've tried the OnClientGUIClick event, but doesn't work... But the Remp tip worked the way that I thought. Anyway, thanks too...
-
@BlackNova You need to use this script with any gamemode, otherwise doesn't work... And I get the compare boolean Errors too, but works normally here (except GUI's bug).
-
Slothman, I want to use your script with dxscoreboard, not with the traditional scoreboard... What I need to do? It's possible? The default scoreboard seems a little bugged here, I don't know why... Have a way to activate the zombies_client.lua by other function to the people can register/choose your teams by GUI? I've tried to put many things but nothing works: Tried to put this on zombie_client.lua after function clientsetupstarter: addEvent("clientsetupstarter", true) addEventHandler("clientsetupstarter", getRootElement(), clientsetupstarter) And tried to put this on my login_client.lua/chooseteam_client.lua (if the player are registered, login_client activates, else, he goes to chooseteam_client): chooseteam_client.lua function hideLoginWindowSpawn2() guiSetInputEnabled(false) guiSetVisible ( GUIEditor3_Window[1], false ) showCursor ( false ) triggerServerEvent ( "onPlayerLogged", localPlayer, localPlayer ) triggerClientEvent ( thePlayer, "clientsetupstarter", getResourceRootElement(getThisResource()), getResourceRootElement(getThisResource()) ) end login_client.lua function hideLoginWindowSpawn() guiSetInputEnabled(false) guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) triggerServerEvent ( "onPlayerLogged", localPlayer, localPlayer ) triggerClientEvent ( thePlayer, "clientsetupstarter", getResourceRootElement(getThisResource()), getResourceRootElement(getThisResource()) ) end I've tried to put triggerClientEvent ( thePlayer, "clientsetupstarter", GetRootElement(), getResourceRootElement(getThisResource()) ) too but i haven't any success... Thanks
-
No, i haven't forgot anything, this is the "complete" client-side lua file (Pastebin link). So, i've tried to add a EventHandler to the image (onClientGUIClick) referring to the images, but doesn't work (I think is because it's only for buttons ). Exist some parameter to "transform" the images "invisible" to the mouse, or something like that? I've tried the AlwaysOnTop to the button, guiMoveToBack() to the image but nothing works...
-
Hi... I'm starting with lua about 5/7 days, but I've learned how to use the language and some functions (I script PHP/Pawn, and some others, so I have an idea how lua works)... But I want to do something that I can't solve... I've created some GUI's (Login GUI / After Login GUI (Setup Player Info) / Team Choose) integrated each other, and some checks to show the right menu depending on value presented by DB. My problem's related to the Team Choose GUI. I do some buttons for the teams, with a Image in, but if you click on the image, the button doesn't work, u need to click around him to works. I want to do if a player clicks on the button and/or image, the function works. Pastebin Link (chooseteam_client.lua) http://pastebin.com/t1PcTGYd Here some images of the GUI's: <<<< Login Screen <<<< Setup Info Screen <<< Choose Team Screen (With the mouse around the image and over a portion of the button, marked with a red circle) <<<< Choose Team Screen (With the mouse over the image, marked with a red circle) So, what I need to do, in this case? I've tried to associate the image to the window and put in the back of the button, but he doesn't show... (Normally, the image is associated with the button) (Obs: I have problem only with the image/button GUI, not with the codes, well, all are working perfectly, I only want to "split" the image and the button in the same "button") Thanks
