Jump to content

Charlie_Jefferson

Members
  • Posts

    242
  • Joined

  • Last visited

Everything posted by Charlie_Jefferson

  1. Charly-man post the script you've got and I'll try fixing it.
  2. guiGetScreenSize, for god fucking sake!
  3. function setCameraOnPlayerJoin() -- slowly fade the camera in to make the screen visible fadeCamera(source, true, 5) -- set the player's camera to a fixed position, looking at a fixed point setTimer ( (fadeCamera, source, 1), 5000, 1, 0.5 ) setCameraMatrix(source, 1000.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) setTimer ( (fadeCamera, source, 1), 5000, 1, 0.5 ) end addEventHandler("onPlayerJoin", getRootElement(), setCameraOnPlayerJoin) I've left two errors in, where you made a big mistake. Find them via debug in game .
  4. That's because you have to add the gates by scripting them. addObject or something.
  5. function weaponSwitchDisableMinigun ( previousWeaponID, currentWeaponID ) if currentWeaponID == 38 or 36 or 35 or 37 then outputChatBox ( getPlayerName (source) .. " was kicked for spawning a " .. getWeaponNameFromID ( currentWeaponID ), getRootElement(), 255,0,0 ) kickPlayer(source) end end addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), weaponSwitchDisableMinigun )
  6. https://wiki.multitheftauto.com/wiki/GuiSetFont
  7. Not really... Displayed means that the thing is shown, however disabled means it doesn't show up until you tell it to. Also, your Arab(?) makes me think your insulting someone in your language .
  8. function beepClient(thePlayer) if isVehicleLocked(source) then local x, y, z = getElementPosition(thePlayer) local beep = playSound("sound/Alarm.mp3", x, y, z, false) setSoundVolume(beep, 2.0) setSoundMaxDistance(beep, 100) stopSound( beep ) end end addEventHandler("onClientVehicleStartEnter", getRootElement(), beepClient) stop = setTimer ( stopSound, 10000, 1 ) kill = killTimer ( stop ) Even though it does make a lot of logic to me, I'm not sure if it will work.
  9. Thanks for correcting my script TAPL. I made a load of mistakes >.>. Haven't scripted in a while.
  10. function pmessage(thePlayer, cmd, tarPlayer, ...) msg = table.concat({...}, " ") tplayer = tarPlayer outputChatBox("Private message from " .. thePlayer .. " : " .. msg .., tplayer) end addCommandHandler("pm", pmessage) Here's a start which I don't expect to work, since it's too simple.
  11. He wants us to tell him what to write. if ( source ) == checkBox1 then if ( guiCheckBoxGetSelected (checkboxnamegoeshere) ) then do this action else do a different action end He wants our ideas, or somethin'.
  12. I found the resource and went through it and I was about to post when I saw benxamix2's post.
  13. Not the player, the ped D: Can you upload the zombie script here, so I can see how the peds are defined?
  14. local frozeTime = "60" -- Seconds as frozen local timeLeft = {} local timeLeftText = {} addEvent("Froze", true) addEventHandler("Froze", rootElement, function() if getPlayerMoney(source) >= 2000 then local players = getElementsByType("player") takePlayerMoney(source, 2000) outputChatBox("All players successfully frozen", source, 255, 255, 0, true) for theKey,thePlayer in ipairs(players) do setElementFrozen(thePlayer, true) setElementData(thePlayer, "Timeleft", frozeTime) showTimeLeft(thePlayer) end else outputChatBox("Not enough money.", source, 255, 0, 0, true) end end) function showTimeLeft(player) timeLeft[player] = textCreateDisplay() textDisplayAddObserver(timeLeft[player], player) timeLeftText[player] = textCreateTextItem("Time left: " .. getElementData(player, "Timeleft"), 0.45, 0.1, "high", 255, 255, 255, 255) textDisplayAddText(timeLeft[player], timeLeftText[player]) setTimer(updateTimeLeft, 1000, getElementData(player, "Timeleft"), player) end function updateTimeLeft(player) setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1) textItemSetText(timeLeftText[player], "Time left: " .. getElementData(player, "Timeleft")) if getElementData(player, "Timeleft") == 0 then textDestroyDisplay(timeLeft[player]) for theKey,thePlayer in ipairs(players) do setElementFrozen(thePlayer, false) end end This should unfreeze them.
  15. Use race checkpoints which are only visible to the player that is doing the bus course. Edit: You want the bus to move automatically? If so, I don't think there's a way to do that.
  16. local playerTeam = getPlayerTeam ( source )
  17. addCommandHandler("b", function(player, cmd, ...) local word = {...} local message = table.concat(word, " ") local px, py, pz = getElementPosition(player) for k,v in ipairs(getElementsByType("player")) do if getElementData(v, "char.name") ~= false then local vx, vy, vz = getElementPosition(v) local dist = getDistanceBetweenPoints3D(px, py, pz, vx, vy, vz) if dist < 20 then outputChatBox(message, v, 0, 0, 0, true) end end end end)
  18. Don't think you can. You can however edit the .txd of an object, upload that and use the object... Also, if you want to add an object that is already in MTA, use createObject
  19. function createTeamsOnStart () teamRed = createTeam ( "Red", 255, 0, 0 ) teamBlue = createTeam ( "Blue", 0, 0, 255 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) function balanceTeams ( thePlayer, source ) local RedTeam = getTeamFromName ( "Red" ) local BlueTeam = getTeamFromName ( "Blue" ) local RedCount = countPlayersInTeam ( RedTeam ) local BlueCount = countPlayersInTeam ( BlueTeam ) if not RedCount == BlueCount then if RedCount > BlueCount then setPlayerTeam ( source , teamBlue ) outputChatBox("You've been moved to the blue team!", thePlayer) elseif RedCount < BlueCount then setPlayerTeam ( source , teamRed ) outputChatBox("You've been moved to the red team!", thePlayer) end end end addEventHandler ( "onPlayerJoin", getRootElement(), balanceTeams ) Forgot to add an end.
  20. function createTeamsOnStart () teamRed = createTeam ( "Red", 255, 0, 0 ) teamBlue = createTeam ( "Blue", 0, 0, 255 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) function balanceTeams ( thePlayer, source ) local RedTeam = getTeamFromName ( "Red" ) local BlueTeam = getTeamFromName ( "Blue" ) local RedCount = countPlayersInTeam ( RedTeam ) local BlueCount = countPlayersInTeam ( BlueTeam ) if not RedCount == BlueCount then if RedCount > BlueCount then setPlayerTeam ( source , teamBlue ) outputChatBox("You've been moved to the blue team!", thePlayer) elseif RedCount < BlueCount then setPlayerTeam ( source , teamRed ) outputChatBox("You've been moved to the red team!", thePlayer) end end addEventHandler ( "onPlayerJoin", getRootElement(), balanceTeams ) This should work. Learn from this. Study what I've changed. You have potential, but your lazy, honestly. Good luck!
  21. For god's sake, don't help him. It's EASY. If you'll keep helping him, he will "script" a whole server. Stop it!
×
×
  • Create New...