-
Posts
1,803 -
Joined
-
Last visited
-
Days Won
8
Everything posted by Citizen
-
Please don't help others when you can't even help yourself ... Well, the script should be fine, can you show us a screen when the hp bar fits correctly ? Thanks
-
Yeah maybe this at line 38: triggerEvent("getSavePassword", source, playerAccount) and --//Check password saved or no function getSavePassword( playerAccount ) if ( playerAccount ) then local getSavePassword = getAccountData(playerAccount, "savePassword") local Password = getAccountData(playerAccount, "password") if (getSavePassword == true) then triggerClientEvent("addPassword", getRootElement(), Password, Login) end else outputChatBox ( "I got no account" ) end end addEvent("getSavePassword", true) addEventHandler("getSavePassword", getRootElement(), getSavePassword) Also, you did a typo here: kickPlayer(players, "Restart Gamemoge") Gamemode*
-
There is no client-side only functions in this code o_O Myeah but half are just working solutions. And here is again a not working solution. Read carefully the code when you want to help someone. There is not only one problem most of the time. addCommandHandler( "wantedoff", function ( thePlayer ) setElementData( thePlayer, "wantedlevelB4death", getPlayerWantedLevel( thePlayer ), false ) local wantedlevel = getElementData( thePlayer, "wantedlevelB4death" ) takePlayerMoney ( thePlayer, 5000 ) if wantedlevel > 0 then setPlayerWantedLevel( thePlayer, wantedlevel ) end end) By the way, I just fixed the syntax. Can you explain what did you want to do with this command ??
-
Stop saying it's your last help request, you are creating 2 new topics a day. It's just ridiculous. Please stop your current project for at least 1 months and learn: https://wiki.multitheftauto.com/wiki/Main_Page Otherwise you will keep asking on this forum forever. Functions you need: getElementsByType --to get all vehicles on the map for k, veh in ipairs ( vehicleTableHere ) do --the lua loop to iterate over the list of the cars getElementModel --to get the modelID of the vehicle getElementPosition --to get the position of the vehicle getElementRotation --to get the rotation of the vehicle (optional) getVehicleColor --to get the color of the vehicle xmlCreateFile --to create an xml file xmlOpenFile --to load the file if it already exist xmlCreateChild --to create a new entry in the list (1 entry per vehicle) xmlNodeSetAttribute --to add an attribute to the entry with its value xmlSaveFile --to save the modifications xmlUnloadFile --to release the opened xml file (important) xmlNodeGetChildren --to get all the entries (must be called on the root node returned by xmlCreateFile or xmlOpenFile for k, node in ipairs ( entriesTableHere ) do --the lua loop to iterate over the list of the entries (1 entry = 1 xml node) xmlNodeGetAttribute -- to get the value (as a string) for a specific attribute on a node createVehicle --to create a vehicle As you can imagine, no one will do it for you for free. (And yeah all these functions are needed to make your save system.)
-
Open INSTALL.md and read ! https://github.com/mabako/mta-paradise/ ... INSTALL.md
-
But if you wanna still use triggers here is what you should have done. Client ask the server for the account name of the player --Client function askServerForAccName() triggerServerEvent("onAccNameRequest", localPlayer) end Server gets the account name of the player and send it to the client using another event --Server addEvent("onAccNameRequest", true) function sendAccNameToClient() if not client then return end local account = getPlayerAccount( client ) local accName = getAccountName( account ) if accName then triggerClientEvent(client, "onAccNameResponse", client, accName) end end addEventHandler("onAccNameRequest", root, sendAccNameToClient) Client receive the accName through that event and finally set the text of your gui: addEvent("onAccNameResponse", true) function fillGuiWithAccName( accName ) guiSetText(AccName, tostring( accName )) end addEventHandler("onAccNameResponse", root, fillGuiWithAccName)
-
Are you sure that onPlayerFinishDD is triggered when someone dies ?? I would say onPlayerRaceWasted when a player dies
-
You can't because MTA doesn't support it.
-
function onBotTargeting( player ) setElementData( source, "playerTargeted", player) end addEventHandler("onBotFollow", getRootElement(), onBotTargeting) function check3DDistance(leader) for k, bot in ipairs ( getElementsByType("ped") ) do local targetedPlayer = getElementData(bot, "targetedPlayer") if targetedPlayer then local pX, pZ, pY = getElementPosition( targetedPlayer ) local bX, bZ, bY = getElementPosition( bot ) local distance = getDistanceBetweenPoints3D ( pX, pZ, pY, bX, bZ, bY ) if distance < 5 then --do your stuff here outputChatBox ( "the distance between "..getPlayerName(leader).." and a zombie is under 5 ("..distance..")" ) end end end end setTimer(check3DDistance, 1000, 0)
-
function destroyVehicle( thePlayer ) https://wiki.multitheftauto.com/wiki/AddCommandHandler
-
What's the point of doing that ? to make this line even longer ?
-
Well you can create a timer when onBotFollow is triggered and will call check3DDistance function every secs or 2 secs with the argument leader.
-
Yeah but don't forget to use a setTimer to remove that element data after like 5 or 8 seconds like arezu said. Because if the guy dies for another reason 20 mins after he got damaged by the rocket, then your script will think that the creator of this rocket killed that guy.
-
Jacobob is right, stop asking when we already told you the answer:
-
Check the comments: phone = guiCreateButton(17, 84, 46, 40, "Phone", false, img) sms = guiCreateButton(63, 84, 46, 40, "sms", false, img) radio = guiCreateButton(109, 84, 46, 40, "radio", false, img) --- Here is how to add a clic listener on a button --- function phoneClick( button ) if button ~= "left" then return end --only allow left mouse clic --Do something here like showing others images etc end addEventHandler("onClientGUIClick", phone, phoneClick, false) ------------------------------------------------------ --Copy paste and replace names to add clic listener on the two others buttons
-
Your table is called MedKit1 and not MedKit. Also, why did you remove the line that was setting the table cell to nil ? It's nedded with your script: local source = source if MedKit1[source] then destroyElement(MedKit1[source]) MedKit1[source] = nil end if MedKit2[source] then destroyElement(MedKit2[source]) MedKit2[source] = nil end
-
This make no sense, you can't test anything more by puting it as a global
-
Ce forum n'est que très peu actif et tu voudrais avoir eu une réponse de quelqu'un intéressé en plus ? C'est pas possible en si peu de temps dans cette section. Et puis ce n'est qu'un serveur MTA DayZ.
-
Please use local variables as soon as you can: local liczbaPrzedmiotow = 0
-
I meant: Give me the line numbers of the buttons you added (use google translate to understand what I'm asking for) I don't have time to check if a gui element doesn't have its handler for this event.
-
You have to use these functions: dxCreateScreenSource dxUpdateScreenSource --and then your dxDrawImage See the wiki pages examples.
-
As always by using percentages (so relative to the screen). So the numbers will be basically between 0 and 1 (0 = 0% of the screen and 1 = 100% of the screen) But of course, the dx functions only accept absolute values (pixels) so you just have to multiply the relatives value by the current screen width or height, depending on the axes (X or Y). So you will then just say: I want it to shake the rectangle only by 10% of the screen height and 10% = 0.1 like in the example of teQuilla. You will then multiply the relative value you will get by the current screen height to get the value in pixels.
-
What are the buttons you want to add onClientGUIClick event on ?