
pa3ck
Members-
Posts
1,141 -
Joined
-
Last visited
-
Days Won
7
Everything posted by pa3ck
-
No offence, but you are just copy-pasting links and stuff, did you actually check that link yourself? In my post I referenced MTA wiki, but I'll quote it again, this control list will only work with the functions toggleControl and toggleAllControls So I guess you can't use it with getPedControlState. The code you posted should work with every other controls, but not these ones. So whatever you tried to achieve, you'll need to find a different solution or if you tell us your goal, we might be able to help you.
-
I think you would be better off using onClientPlayerDamage since it runs on the client side --server side script function DM_Zone(thePlayer) if (source == DMOut and getElementType(thePlayer) == "player") then setElementPosition(thePlayer, 154.69999694824, 381.70001220703, 905.70001220703) setElementFrozen(thePlayer,false) setTimer(setElementFrozen, 1000, 1, thePlayer, false) getElementPosition(thePlayer, 129.30000305176, 386, 859.20001220703) giveWeapon ( thePlayer, 31, 250 ,true ) setElementData( thePlayer, "inDMZone", true ) elseif (source == DMInt and getElementType(thePlayer) == "player") then setElementPosition(thePlayer, 143.390625, 1875.515625, 17.843418121338) setElementFrozen(thePlayer,false) setTimer(setElementFrozen, 1000, 1, thePlayer, false) takeWeapon ( thePlayer, 31 ) setElementData( thePlayer, "inDMZone", false) end end addEventHandler("onMarkerHit", root, DM_Zone) ----- client addEventHandler("onClientPlayerDamage", root, function(att) if getElementData(source, "inDMZone") and att and getElementType(att) == "player" then cancelEvent() end end)
-
Okay, all you have to do is check the player's team in the if statement inside onMarkerHit event handler. if ( getElementType ( p ) == 'player' and not isPedInVehicle ( p ) and not isPedDead ( p ) and getPlayerTeam ( p ) == getTeamFromName("YOUR_TEAM_NAME") ) then
-
MTA hard-coded commands The following are names of hard-coded MTA commands which do not use bindKey, but can act as bindKey by using them in an addCommandHandler. Other than that, this control list will only work with the functions toggleControl and toggleAllControls. Please note that toggleControl can't disable screenshot. Probably you can't use "radar_move_x" with getPedControlState since they're MTA hard-coded commands.
-
The problem I think is that you actually let the person login and then attempt to save with the new login details (account), so if my account is "John" and I login to "Jane", when you do a getPlayerAccount to save my stuff, you would save to "Jane" instead of "John". You would need to modify the code, so it would save on the oldAccount parameter in the "onPlayerLogin" event. Edit: Yea, just seen your reply...
-
You still don't understand what I said. If you use setTeamFriendlyFire to false, it will be disabled for every single player, no matter where they are or what color their eyes are.. That is why you should remove the player(s) from the team when they use the pvp command and that way the friendlyFire will be disabled. By the way, you have so many things going on, elementData, team, col... not sure what you essentially want. Pvparea = createColRectangle ( 909, 525, 2100, 2600 ) function Pvpzone ( thePlayer ) setElementPosition ( thePlayer, 2032.6420898438, 1429.3059082031, 10.8203125 ) outputChatBox ( getPlayerName ( thePlayer ) .. " has Entered in PVP zone!" ) setPlayerTeam( thePlayer ) end addCommandHandler ( "pvp", Pvpzone ) function Pvezone ( thePlayer ) setElementPosition ( thePlayer, 2032.6420898438, 1429.3059082031, 10.8203125 ) -- change PVE position outputChatBox ( getPlayerName ( thePlayer ) .. " has Entered in PVE zone!" ) setPlayerTeam( thePlayer, getTeamFromName("Players") ) end addCommandHandler ( "pve", Pvezone )
-
I'm not sure if there's a native MTA function that will do that, but as far as I remember, it only presses random buttons (eg. direction change, brake/accelerate), which can easily be done with Lua.
-
Did you even read what he said? He said he joined a server, downloaded models and he want's to use them, but obviously the meta was not downloaded to the client folder... he didn't say anything about a map. To create the meta, look at this: https://wiki.multitheftauto.com/wiki/Meta.xml PS.: I know MTA allows it, but it's not a nice thing to do..
-
I don't think that's the right event for you, if you look at the wiki: onClientFileDownloadComplete - Clientside event - This event is triggered when a file has been downloaded after downloadFile has been successfully called. Since you are not using downloadFile, you would need to manually check if the user is still downloading. local loginTimer = setTimer(function() if not isTransferBoxActive() then addEventHandler("onClientRender", root, "myLoginPanel") killTimer(loginTimer) end end, 2000, 0)
-
Look at this post and edit/add the needed details accordingly In short, tell us what's not working, any debug errors and steps you tried to solve your problem so far.
-
Please don't "up" your post, this is not an advertisement website where you need to bump your post. To be able to rotate the steering wheel, you'll need a special model that has a steering wheel component that let's you access it using setVehicleComponentRotation
-
That's basically the same as a relative GUI and something * 0.2 = 20%, not 2%.
-
Csak 2 eve lett postolva
-
The line I added was: local thePlayer = getPlayerFromName(playerName) It is needed to get the player by the name, make sure playerName is the same as the player's name, you'll need to use string.gsub to remove HEX color code from the name as well.
-
triggerServerEvent("addPlayerToGroup", getRootElement(), guiGetText(name), guiGridListGetSelectedItem(groupGrid)) The parameter I highlighted is a string, not a player element.. try this: function addGroup(playerName, group) local thePlayer = getPlayerFromName(playerName) local playerToAdd = getPlayerAccount(thePlayer) if not exports.acl:isPlayerInGroup(playerToAdd, group)then exports.acl:addAccountToGroup(playerToAdd,group) exports.msj:sendMessage("You've been added to: " ..group.. "!", 0, 150, 0,thePlayer) end end
-
Hale already asked you to provide more details / code, since we can't see what parameters are being passed to the event addPlayerToGroup, we won't be able to help you without it.
-
Okay, so you asked a question, but you already have the answer as well, what do you expect from us..?
-
If you want to disable friendly fire for specific players, you will need to approach it from a different direction, since if you disable with the nativa MTA function, it will be disabled for everyone else in the team. Try to use the event onClientPlayerDamage with cancelEvent, get the player's team + the zone name using getZoneName which can return Los Santos, Las Venturas, San Fierro if you pass the "cities only" argument as true.
-
That works great if the scrollbarPosition is ranging between 0 - 1, but AFAIK the GUI scrollbar is ranging between 0 - 100, so a division by 100 would need to be added minValue + scrollbarPosition / 100 * (maxValue - minValue)
-
addictional content =/= additional content, I thought you were on about drugs and stuff.. Pretty sure there are fully functional resources like this, you don't need to re-invent the wheel. Take a look at this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=11265
-
The error kinda explains itself, where is accountname defined? You forgot the line local accountname = getAccountName(getPlayerAccount(player))
-
And also the guidelines here: