Search the Community

Showing results for tags 'player'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • Open Source Contributors
    • Suggestions
  • General MTA
    • News
    • Media
    • Site/Forum/IRC/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • community.mtasa.com
    • Scripting
    • Maps
    • Resources
    • Other Creations
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash
  • Private Bugtracker

Found 24 results

  1. --Client local shader = dxCreateShader("tex.fx",0, 0, true, 'ped') addEvent("broadcastEnableShader", true) -- allow remotely triggered (from server) addEventHandler("broadcastEnableShader", root, function(some_data) -- receive broadcast from the server local img = dxCreateTexture(""..math.random(1,3)..".png") dxSetShaderValue(shader, "tex", img) engineApplyShaderToWorldTexture(shader, "Hoodie_green_co",some_data) end ) addEventHandler( 'onClientResourceStart', resourceRoot, function() for _, p in ipairs(getElementsByType('ped')) do if isElementStreamedIn(p) then local clothing = getElementData(p, 'blood') if clothing then triggerServerEvent("announceEnableShader", localPlayer, p) end end end for _, p in ipairs(getElementsByType('player')) do if isElementStreamedIn(p) then local clothing = getElementData(p, 'blood') if clothing then triggerServerEvent("announceEnableShader", localPlayer, p) end end end end) addEventHandler( 'onClientElementStreamIn', root, function() if getElementType(source) == 'player' or getElementType(source) == 'ped' then local clothing = getElementData(source, 'blood') if clothing then triggerServerEvent("announceEnableShader", localPlayer, source) end end end) addEventHandler( 'onClientElementDataChange', root, function(name) if (getElementType(source) == 'player' or getElementType(source) == 'ped') and isElementStreamedIn(source) and name == 'blood' then if getElementData(source, 'blood') then triggerServerEvent("announceEnableShader", localPlayer, source) end end end) --SERVER addEvent("announceEnableShader", true) addEventHandler("announceEnableShader", root, function (some_data) -- triggerClientEvent(root, "broadcastEnableShader", source, some_data) end ) Ita not Synchronization((
  2. function test() setElementPosition ( mark, pos.x,pos.y,pos.z ) end addEventHandler("onMarkerHit", mark, test) this is the code. if i hit the marker, the element position change for all players.. how to fix this? sorry for my bad english.
  3. [HELP] How to make such timer?

    Hello. I want create a dx timer which when the player disconnect, and connect again to the server then not reset the timer. Sorry for my bad english :c
  4. GET account ID

    Boton8 = guiCreateLabel(137, 142, 111, 25, "LEGAJO2", false, Ventana);guiSetProperty(Boton8, "NormalTextColour", "FF27F512") addCommandHandler("p", function() local team = getPlayerTeam(localPlayer) if team then local teamName = getTeamName(team) if teamName == "MOBSA" then local getGui = guiGetVisible(Ventana) if not getGui then guiSetVisible(Ventana, true) guiSetText(Boton10, getPlayerMoney(localplayer)) guiSetText(Boton2, teamName) guiSetText(Boton4, getPlayerName(localPlayer)) guiSetText(Boton8, ID ) --<<Aca necesitaria poner la id del jugador, digamos que aparesca su id showCursor(true) else guiSetVisible(Ventana, false) showCursor(false) print ("Tu trabajas de chofer actualmente") end else print ("Tu trabajas de chofer actualmente") end end end ) Buenas, mi duda es como sacar la id de los jugadores? Veo cual son porque quedan guardadas pero como hago para volcar esos datos en estos textos? Gracias!
  5. Hello, guys. It is possible to create effect and attach it to player/ped? This code doesn't works, may be I doing something wrong? addCommandHandler('eff1', function() local eff local x, y, z = getElementPosition(localPlayer) eff = createEffect('fire', x, y, z, 0.0, 0.0, 0.0) setElementInterior(eff, getElementInterior(localPlayer)) attachElements(eff, localPlayer) end) Please help
  6. Hello! I've made a login panel. After the player logs in, he'll need to select which character he wanna play with. At this point, the player see the selected character in gta world (interior: 0) and a window with his characters. Because if it's interior 0, I want to make only the local player see that character in the world, how is that possible if I can't set the camera's dimension?
  7. [QUESTION] Movement replay

    Hello. Is it possible to make a script that records your movement and then makes a ped do it after you? The exact same thing? Because I tried to do that, with 3 or 4 methods, but the closest I got was like a 5 meters miss at the end of the replay.
  8. set ped rotation to player rotation

    hi guys i have a problem to set ped rotation like player rotation always i mean if you change yor rotation the ped change his rotation too sorry for bad English here is the code local pylonid = 2662 local pylon_x, pylon_y = 0, 0.5 local pylon_c, pylon_v = 0, 0 local pylonheight = 0 local pylonscale = 1.3 local function pylonHead(player, command) if not pylon or pylon == nil then local px, py, pz = getElementPosition( player ) pylon = createObject( pylonid, px, py, pz) attachElements(pylon, player, pylon_x-1, pylon_y, pylonheight, 0, 0, 180) setObjectScale( pylon, pylonscale ) setElementCollisionsEnabled( pylon, true ) myBlip = createBlipAttachedTo ( player, 19 ) ped = createPed( 105, px, py, pz) attachElements( ped, player, pylon_c-2, pylon_v, pylonheight) setPedAnimation(ped, "wuzi", "wuzi_walk") peda = createPed( 33, px, py, pz) attachElements( peda, player, pylon_c-1, pylon_v-1, pylonheight) setPedAnimation(peda, "wuzi", "wuzi_walk") pedb = createPed( 33, px, py, pz) attachElements( pedb, player, pylon_c, pylon_v-1, pylonheight) setPedAnimation(pedb, "wuzi", "wuzi_walk") pedc = createPed( 105, px, py, pz) attachElements( pedc, player, pylon_c-2, pylon_v-1, pylonheight) setPedAnimation(pedc, "wuzi", "wuzi_walk") else detachElements( pylon, player ) detachElements( ped, player ) detachElements( peda, player ) detachElements( pedb, player ) detachElements( pedc, player ) destroyElement( pylon ) setPedAnimation(ped, "riot", "riot_angry") setPedAnimation(peda, "riot", "riot_chant") setPedAnimation(pedb, "riot", "riot_punches") setPedAnimation(pedc, "riot", "riot_shout") destroyElement( myBlip ) pylon = nil end end addCommandHandler("bnr", pylonHead) i want the peds (ped , peda , pedb and pedc) moveing with me i need only to set rotation changing with me thank you ... mta server write like this [00:53:36] WARNING: banner\pylonhead.lua:28: Bad argument @ 'setElementRotation' [Expected element at argument 1, got number '0']
  9. السلام عليكم المشكلة باختصار انه انا اريد اسوي بيد (ped) واخلي الروتيشن حقه مثل الروتيشن حق اللاعب يعي يتغير باستمرار قصدي من يفتر اللاعب يفتر معاه البيد يعني من يغير اللاعب الروتيشن حقه ابي يسوي البيد setElementRotation(thePed, (getPlayerRotation (thePlayer) ) ) بس حاليا المشكلة اني ما اعرف كيف اجيب كود انه اذا تغير روتيشن اللاعب ولعلمكم انا مخلي ped attached with player pedc = createPed( 105, px, py, pz) attachElements( pedc, player, pylon_c-2, pylon_v-1, pylonheight) setPedAnimation(pedc, "wuzi", "wuzi_walk")
  10. i have this script: exports.scoreboard:addScoreboardColumn('Játszott idő') local t = { } function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hours' ] = tonumber( t[ source ][ 'hours' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hours"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hours = tonumber( t[ v ][ 'hours' ] or 0 ) setElementData( v, "Játszott idő", tostring( hours )..' óra '..tostring( min )..' perc' ) end end, 1000, 0 ) function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local sValue = getElementData( source,'Játszott idő' ) local hours = tonumber( t[ source ][ 'hours' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) setAccountData ( playeraccount, "Játszott idő-hours", tostring(hours) ) setAccountData ( playeraccount, "Játszott idő-min", tostring(min) ) setAccountData ( playeraccount, "Játszott idő-sec", tostring(sec) ) setAccountData ( playeraccount, "Játszott idő", tostring(sValue) ) end t[ source ] = nil end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local time = getAccountData ( playeraccount, "Játszott idő" ) local hou = getAccountData ( playeraccount, "Játszott idő-hours") local min = getAccountData ( playeraccount, "Játszott idő-min") local sec = getAccountData ( playeraccount, "Játszott idő-sec") if ( time ) then setElementData ( source, "Játszott idő", time ) t[ source ]["hours"] = tonumber(hou) t[ source ]["min"] = tonumber(min) t[ source ]["sec"] = tonumber(sec) else setElementData ( source, "Játszott idő",0 ) setAccountData ( playeraccount, "Játszott idő",0 ) end end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) and i want add a function, what get players played time, and when reach xy played time (for example 30), then do something (for example output a text to chat box) How is it possible?
  11. i downloaded this script https://community.mtasa.com/index.php?p=resources&s=details&id=10944 but this doesn't save the player coint to account, how to ad this function?
  12. function someName(killer,weapon,bodypart) if(killer == getLocalPlayer()) then return end if bodypart == 9 then local sound = playSound("headshot.mp3",false) end end addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), someName ) fileDelete("client.lua") what wrong?
  13. Why not working isPlayerMuted?

    function privateMessage(thePlayer,commandName,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) if sendToName then if (getPlayerFromParticalName (sendToName)) then toPlayer = (getPlayerFromParticalName (sendToName)) if isPlayerMuted ( thePlayer ) then outputChatBox ( "You Cannot Send Pm Message, Because You Are Muted" thePlayer, r, g, b, true ) else if not (toPlayer == thePlayer) then if not (pmMessage == "") then outputChatBox("#0088FF[#c8c8c8Privát]#FFFFFF Üzenet neki: #FFFFFF" .. getPlayerName(toPlayer) .. "#FF0000: " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#0088FF[#c8c8c8Privát]#FFFFFF Üzenet tőle: #FFFFFF" .. getPlayerName(thePlayer) .. "#00FF00: " .. pmMessage, toPlayer, 255, 255, 255, true) else outputChatBox("#0088FF[#c8c8c8Privát]#FFFFFF Helytelen használat! Helyes:#FFFFFF /pm <név> <üzenet>", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0088FF[#c8c8c8Privát]#FFFFFF Magaddal nem tudsz csevegni#FFFFFF!", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0088FF[#c8c8c8Privát]#FFFFFF Játékos nem található! #FFFF00(#FFFFFF"..sendToName.."#FFFF00)", thePlayer, 255, 255, 255, true) return false end else outputChatBox("#0088FF[#c8c8c8Privát]#FFFFFF Helytelen használat! Helyes:#FFFFFF /pm <név> <üzenet>", thePlayer, 255, 255, 255, true) return false end end addCommandHandler("pm", privateMessage) i want, when a player muted, he cannot send pm to other player, why not working this? sorry for my very bad English:c
  14. function fvalt( prevSlot, newSlot ) if getElementData (target, "greenzone") then setPedWeaponSlot(source,0) end end addEventHandler ( "onClientPlayerWeaponSwitch", localPlayer, fvalt ) i added this to a greenzones script, but this doesn't working, why?
  15. So I'm working on a gamemode/server that I plan to possibly host on a larger scale. The project is only for my own amusement and may never be hosted on a large scale, or even finished, however I'd still like to prepare for that. While player interactions on a small scale can be tested easily by using a laptop, virtual pc etc. I was also wondering how one would test load specific things. For example what happens when a player enters a populated area and has to stream in many elements that require shaders or similar. What happens to per player dxDraws like nametags or chat bubbles? Does anyone have any experience with such things and would share? Can peds be used instead of actual players? (I imagine some extra script would be possible but that shouldn't be to big a problem)
  16. SaveAccount

    Hallo, please help me!
  17. problem, did Shader skin player, but it only sees the player who entered the command, or only those who have the same skin. other players who did not enter and command them not to be schöder How to make that it was visible Shader .
  18. Why not working onPlayerLogout?

    addEventHandler("onPlayerLogout", getRootElement(), function () local name = getPlayerName ( source ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then exports[getResourceName(resource)]:addNotification(root, name.." kilépett a tulajdonos szolgálatból!", "success") end end ) what wrong? onPlayerLogin working with this.. wtf?!
  19. changer problem

    hey guys. How can i change a changer for only one player in server side? thx, for help!
  20. [HELP] Move player

    How can I move a player naturally from one point to another? setElementPosition
  21. Well...I need to freeze a player during 3 seconds when he collides a ColCuboid, independent if he is in a vehicle or not. After this time, the player is unfreezed and will be only freeze again if he goes out the collider and enters it again. The collider is on a serverside script, but I read at the "Wiki MTA" an information that Freeze commands are only clientside... I tried to make all the script clientside but when I did, the script simply doesn't work and don't show any error. Reason: The player must wait the gate's movement ending so he can pass. The gate's movement lasts 3 seconds. PS: The gate is already working fine with the collider. Here is the serverside script working well without the freeze commands: gateilhaFA1 = createObject ( 968, -3341.7001953125, 458.5, 10.5, 0, 270, 270 ) ZonailhaFA1 = createColCuboid ( -3356.7001953125, 459.89999389648, 9.6999998092651, 15.0, 5, 5.0 )--Zona em cubo de colisão. function GateIlha1Open (source) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("MapEditor")) then moveObject ( gateilhaFA1, 3000, -3341.7001953125, 458.5, 10.5, 0, 90, 0 ) outputChatBox ( "Acesso permitido.", source, 0, 255, 0, true ) else outputChatBox ( "Acesso negado.", source, 255, 0, 0, true ) end end addEventHandler ( "onColShapeHit", ZonailhaFA1, GateIlha1Open ) function GateIlha1Close () moveObject ( gateilhaFA1, 3000, -3341.7001953125, 458.5, 10.5, 0, -90, 0 ) end addEventHandler ( "onColShapeLeave", ZonailhaFA1, GateIlha1Close ) And here is the script with the freeze command and timer: gateilhaFA1 = createObject ( 968, -3341.7001953125, 458.5, 10.5, 0, 270, 270 ) ZonailhaFA1 = createColCuboid ( -3356.7001953125, 459.89999389648, 9.6999998092651, 15.0, 5, 5.0 )--Zona em cubo de colisão. function GateIlha1Open (source, player) local player = getLocalPlayer() if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("MapEditor")) then outputChatBox ( "Acesso permitido.", source, 0, 255, 0, true ) moveObject ( gateilhaFA1, 3000, -3341.7001953125, 458.5, 10.5, 0, 90, 0 ) setElementFrozen( player, true ) toggleAllControls( player, false ) setTimer ( function( source ) setElementFrozen( player, false ) toggleAllControls( player, true ) end, 3000, 1 ) outputChatBox ( "Aguarde o portão se abrir.", source, 0, 255, 0, true ) else outputChatBox ( "Acesso negado.", source, 255, 0, 0, true ) end end addEventHandler ( "onColShapeHit", ZonailhaFA1, GateIlha1Open ) function GateIlha1Close () moveObject ( gateilhaFA1, 3000, -3341.7001953125, 458.5, 10.5, 0, -90, 0 ) end addEventHandler ( "onColShapeLeave", ZonailhaFA1, GateIlha1Close ) How to create a Freeze with collider and timer?
  22. Hello everyone. I was testing some commands on Console, and I can use normally this to make the player User#ff00ffname logout from the server. aexec User#ff00ffname logout BUT If I try this below, it doesn't work. aexec User#ff00ffname disconnect or aexec User#ff00ffname quit Can someone explain a way to make it? Or it is not possible anyway?
  23. Hey, I want to move some parts of my script to be completly clientside as it doesn't need to be serverside. So instead of creating a vehicle on the server, I thought about creating it on the client. But warpPedIntoVehicle does not allow to warp the player, who is a serverside element, into the clientside vehicle. Therefore I need to trigger a server event just to create the vehicle and warp the player into it, even though the server has nothing much to do with it. Since its a race gamemode, the player cannot just enter the vehicle manually. Does anyone know a workaround for this problem? Bonsai
  24. Why not working takeplayermoney?

    function giveWeaponsOnSpawn0 ( ) giveWeapon ( source, 31, 3000 ) -- Gives the M4 weapon with 200 ammo takePlayerMoney ( source, 20 ) else outputChatBox("You do not have enough money.", source, 255, 0, 0, false) end addEvent( "giveweaponm4", true ) addEventHandler( "giveweaponm4", root, giveWeaponsOnSpawn0 ) what wrong in this?