Jump to content

FR0314

Members
  • Posts

    9
  • Joined

  • Last visited

Details

  • Gang
    -
  • Location
    Hungary
  • Occupation
    professional trying to script
  • Interests
    scripting

FR0314's Achievements

Newbie

Newbie (4/54)

1

Reputation

  1. I trigger it from a onPlayerLogin event, serversided.
  2. I've meant to use that, yes. Thanks for the help! I also want to make code here to check the name of the person who triggered the event. if getPlayerName(player) == phoenix then this doesn't work for some reason, could you sort it out please?
  3. Both of my codes are on server side; function phoenix( player ) local accName = getAccountName (getPlayerAccount ( player )) if isObjectInACLGroup("user."..accName, aclGetGroup ( "Moderator" )) or isObjectInACLGroup("user."..accName, aclGetGroup ( "Admin" )) then triggerServerEvent('phoenix', root, player) end end addCommandHandler ( "phoenix", phoenix ) function phoenixLogin( player ) --code end addEvent('phoenix', true) addEventHandler("phoenix", root, phoenixLogin) This comes back with the error code of: "resourcename/the-first-code.lua:16 attempt to call global 'triggerServerEvent' (a nil value)" What could be the problem?
  4. I will test out this code, thanks!
  5. addCommandHandler ( "s", function(source, cmd, ...) local message = table.concat({ ... }, " ") local x, y, z = getElementPosition(source) local radius = createColSphere(x, y, z, 100) local nearplayers = getElementsWithinColShape(radius, "player") destroyElement(radius) for _, player in ipairs(nearplayers) do if getElementDimension(player) == getElementDimension(source) then local chatter = pregReplace( getPlayerName(source), '_', ' ' ) or '#cf7ee6[FroMTA - Admin] #db5151'..getPlayerName(source) local MESSAGE = string.upper(message) outputChatBox(chatter..' ordítja: '..MESSAGE, player, 255, 255, 255, true) end end end) This is my new code; I only changed ... to message in string upper. This code works just as I expect it, thanks for the help!
  6. I would like to make the pervious car disappear, but only if the player that spawned it has spawned more than 2 cars. This is my current code: function makeveh( player, command, model ) local x, y, z = getElementPosition(player) local rotX, rotY, rotZ = getElementRotation(player) rotZ = rotZ + 90 y = y + 5 local vehicle = createVehicle(model, x, y, z, rotX, rotY, rotZ) warpPedIntoVehicle(player, vehicle) end addCommandHandler('makeVeh', makeveh, false, false) This would be a command that everyone could use, thanks for the help!
  7. The debugstring was just for me to check where is the problem. I took all of the out of the code. But thanks for the recommendation!
  8. I've figured it out, help is no longer needed
  9. I'm trying to make a script where you can shout if you want more people to hear what you are saying. The problem is no matter what I say only the first part displays. Like if I try to say: "/s Hey what are you doing?" It comes back as HEY! function shout( source, command, ... ) outputDebugString ( ... , 1) local message = table.concat( {...}, " " ) outputDebugString ( ... , 1) outputChatBox(..., source) local x, y, z = getElementPosition(source) local radius = createColSphere(x, y, z, 100) local nearplayers = getElementsWithinColShape(radius, "player") destroyElement(radius) for _, player in ipairs(nearplayers) do if getElementDimension(player) == getElementDimension(source) then local chatter = pregReplace( getPlayerName(source), '_', ' ' ) outputChatBox(..., player, 255, 255, 255, true) local MESSAGE = string.upper( ... ) outputChatBox(chatter..' ordítja: '..MESSAGE, player, 255, 255, 255, true) end end end addCommandHandler ( "s", shout) What could be the problem?
×
×
  • Create New...