NeverUnbeatable

Members
  • Content count

    46
  • Joined

  • Last visited

Community Reputation

6 Neutral

1 Follower

About NeverUnbeatable

  • Rank
    Rat
  1. set skin

    Probably this is what you wanna do: local validSkins = {29, 30, 100, 101, 102, 104, 106, 107, 108, 109, 110, 114, 115, 116, 118, 144, 165, 173, 174, 175, 280, 283, 285, 286, 287, 294} function spawnOnJoin() local rndSkin = validSkins[math.random(0,#validSkins)] -- get random valid skin from the table spawnPlayer(source, 0,0, 5, 0, rndSkin) -- spawn a player when he joins the server fadeCamera(source, true) setCameraTarget(source, source) end end addEventHandler("onPlayerJoin", root, spawnOnJoin)
  2. function

    onVehicleExplode is a serverside event though. Use onClientVehicleExplode instead.
  3. function

    Function attached to event onVehicleExplode has no parameters. And source is an element that the event is originated from and it's predefined. I suppose it's just a fragment of full code. I can't see veh4 table and Bfim4 element declarations. Moreover, using outputChatBox for source element in this case doesn't make sense because source is actually a vehicle. Try this code and reply if it's working. function blowveh4 () --if (veh4[source]) and isElement(veh4[source]) then destroyElement (source) setElementVisibleTo ( Bfim4, source, false ) outputChatBox("#ff0000Mission failled, your vehicle blow", root ,0,0,0,true) --else --end end addEventHandler ( "onVehicleExplode", getRootElement(), blowveh4 )
  4. Remove /me command - Its resource name?

    Any serverside .lua script. Learn how to script and ask only if you have question related to scripting problem.
  5. Remove /me command - Its resource name?

    You have to disable the default /me command and write new one. Try this code: addEventHandler("onPlayerChat", root, function(message, type) if type == 1 then -- if action message cancelEvent() -- prevent from sending it into chatbox local actionMessage = string.gsub(getPlayerName(source), "#%x%x%x%x%x%x", "").." "..message outputChatBox(actionMessage, root, 255, 255, 255, false) end end
  6. Problem in code

    Clientside events hideinventory and showinventory are missed. I don't see them in your code.
  7. MTA PROBLEM -Expected string at argument 1, got nil

    I don't see a line with error.
  8. Chat Write

    You will need event onPlayerChat and the following functions: getPlayerAccount() isGuestAccount() getAccountName() aclGetGroup() isObjectInACLGroup() getPlayerTeam() getTeamName() outputChatBox() cancelEvent() Take attempts to make this script yourself and ask for help here, if needed.
  9. Player blips dont show in long distance

    I see no blips in your code except some variables that might be related to them.
  10. New in MTA Scripting

    Learning pure Lua might be too difficult and boring for beginners who have never had any programming experience. I advise you to begin with simple scripts from MTA Wiki. You should take attempts to edit original code, experiment with it. For example, script with command "/ping" that will output your ping in the chatbox: function outputMyPing(player, cmd) local ping = getPlayerPing(player) outputChatBox("* Your ping: ".. ping, player, 255, 255, 255, false) end addCommandHandler("ping", outputMyPing) How would you improve this command? You may add some colors in the chat message, some conditions(if ping is low then message is green, red otherwise) and etc. There're no limits in ideas, and everything depends on your imagination. Note that you should have some basic programming knowledges including variables, arrays, loops and etc.
  11. [HELP]Whats the problem here ?

    Your code doesn't work because you used unknown "thePlayer" element instead of passing getRootElement which literally means "all players". Passing "thePlayer" instead of "source" in the bindKey function also causes errors.
  12. Understanding On Marker Hit

    Try to check if your marker is successfuly created. Also make sure your script is server-sided in meta.xml
  13. [Help] table index nil

    I'm not sure if this line makes sense: if (tonumber(getPlayersInDimension(860)) >= 1) then It supposed to be if (tonumber(getPlayersInDimension(plr)) >= 1) then If I'm not wrong. Write number of line where error appears.
  14. dayz type inventory

    I suppose you should give us any explanations of issues you've faced.
  15. [Help] Why can i open the FR GUI in jail?

    Add this check in function which opens freeroam menu: if getElementData(playerElement, "jailed") then outputChatBox("* You can't use freeroam menu in jail!", playerElement, 255, 0, 0, false) return end * change playerElement variable to one which is in function.