-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
The password argument is used to check if password matches.
-
function save() local team = getPlayerTeam(source) -- Gets the players team local account = getPlayerAccount(source) -- Checks to see if the player is a guest or not setAccountData(account, "team", getTeamName(team)) --saves team setAccountData (account, "funmodev2-weaponID0", getPedWeapon (source, 0)) setAccountData (account, "funmodev2-weaponID1", getPedWeapon (source, 1)) setAccountData (account, "funmodev2-weaponID2", getPedWeapon (source, 2)) setAccountData (account, "funmodev2-weaponID3", getPedWeapon (source, 3)) setAccountData (account, "funmodev2-weaponID4", getPedWeapon (source, 4)) setAccountData (account, "funmodev2-weaponID5", getPedWeapon (source, 5)) setAccountData (account, "funmodev2-weaponID6", getPedWeapon (source, 6)) setAccountData (account, "funmodev2-weaponID7", getPedWeapon (source, 7)) setAccountData (account, "funmodev2-weaponID8", getPedWeapon (source, ) setAccountData (account, "funmodev2-weaponID9", getPedWeapon (source, 9)) setAccountData (account, "funmodev2-weaponID10", getPedWeapon (source, 10)) setAccountData (account, "funmodev2-weaponID11", getPedWeapon (source, 11)) setAccountData (account, "funmodev2-weaponID12", getPedWeapon (source, 12)) setAccountData (account, "funmodev2-weaponAmmo0", getPedTotalAmmo (source, 0)) setAccountData (account, "funmodev2-weaponAmmo1", getPedTotalAmmo (source, 1)) setAccountData (account, "funmodev2-weaponAmmo2", getPedTotalAmmo (source, 2)) setAccountData (account, "funmodev2-weaponAmmo3", getPedTotalAmmo (source, 3)) setAccountData (account, "funmodev2-weaponAmmo4", getPedTotalAmmo (source, 4)) setAccountData (account, "funmodev2-weaponAmmo5", getPedTotalAmmo (source, 5)) setAccountData (account, "funmodev2-weaponAmmo6", getPedTotalAmmo (source, 6)) setAccountData (account, "funmodev2-weaponAmmo7", getPedTotalAmmo (source, 7)) setAccountData (account, "funmodev2-weaponAmmo8", getPedTotalAmmo (source, ) setAccountData (account, "funmodev2-weaponAmmo9", getPedTotalAmmo (source, 9)) setAccountData (account, "funmodev2-weaponAmmo10", getPedTotalAmmo (source, 10)) setAccountData (account, "funmodev2-weaponAmmo11", getPedTotalAmmo (source, 11)) setAccountData (account, "funmodev2-weaponAmmo12", getPedTotalAmmo (source, 12)) end addEventHandler("onPlayerWasted", getRootElement(), save)
-
for i=1,2,3 do Should be: for i=1, 3 do
-
vehicleIDS = { 602, 545, 496, 517, 401, 410, 518, 600, 527, 436, 589, 580, 419, 439, 533, 549, 526, 491, 474, 445, 467, 604, 426, 507, 547, 585, 405, 587, 409, 466, 550, 492, 566, 546, 540, 551, 421, 516, 529, 592, 553, 577, 488, 511, 497, 548, 563, 512, 476, 593, 447, 425, 519, 520, 460, 417, 469, 487, 513, 581, 510, 509, 522, 481, 461, 462, 448, 521, 468, 463, 586, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 485, 552, 431, 438, 437, 574, 420, 525, 408, 416, 596, 433, 597, 427, 599, 490, 432, 528, 601, 407, 428, 544, 523, 470, 598, 499, 588, 609, 403, 498, 514, 524, 423, 532, 414, 578, 443, 486, 515, 406, 531, 573, 456, 455, 459, 543, 422, 583, 482, 478, 605, 554, 530, 418, 572, 582, 413, 440, 536, 575, 534, 567, 535, 576, 412, 402, 542, 603, 475, 449, 537, 538, 441, 464, 501, 465, 564, 568, 557, 424, 471, 504, 495, 457, 539, 483, 508, 571, 500, 444, 556, 429, 411, 541, 559, 415, 561, 480, 560, 562, 506, 565, 451, 434, 558, 494, 555, 502, 477, 503, 579, 400, 404, 489, 505, 479, 442, 458, 606, 607, 610, 590, 569, 611, 584, 608, 435, 450, 591, 594 } addEvent ( "onPlayerReachCheckpoint", true ) addEventHandler ( "onPlayerReachCheckpoint", root, function ( checkpoint ) if ( checkpoint == 5 ) then local vehicle = getPedOccupiedVehicle ( source ) if ( vehicle ) then setElementModel ( vehicle, vehicleIDS [ math.random ( #vehicleIDS ) ] ) end end end ) When a player reaches checkpoint number 5, it'll set his vehicle model to a random one.
-
I'm not sure, but if I'm right, it's ordered by server rank.
-
You either removed the table musicplayerGUI or didn't read the error correctly, because I copied it, removed the comma I told you in my first reply and worked, then there was another small error. local volume = 1 --Default Song Volume local guiShowing = false --Hide/Open local currentPlaying = nil --Coming with the next update. local state = nil --State Playing / Not Playing function stopGTAradio() setRadioChannel(0) cancelEvent() end addEventHandler("onClientPlayerRadioSwitch",getRootElement(),stopGTAradio) addEventHandler("onClientPlayerVehicleEnter",getRootElement(),stopGTAradio) ------------------------------------------------------------------------------- GUIEditor = { label = {}, scrollbar = {}, } musicplayerGUI = {} musicplayer = {} musicplayerGUI.window = guiCreateWindow(340, 195, 494, 578, "FNF// - Music Player 1.3", false) guiWindowSetSizable(musicplayerGUI.window, false) musicplayer.logo1 = guiCreateStaticImage(10, 559, 475, 9, "Img/tab.png", false, musicplayerGUI.window) musicplayerGUI.grid = guiCreateGridList(128, 315, 350, 225, false, musicplayerGUI.window) guiGridListAddColumn(musicplayerGUI.grid, "Songs list", 0.9) for i = 1, 2 do guiGridListAddRow(musicplayerGUI.grid) end guiGridListSetItemText(musicplayerGUI.grid, 0, 1, "-", false, false) guiGridListSetItemText(musicplayerGUI.grid, 1, 1, "-", false, false) GUIEditor.scrollbar[1] = guiCreateScrollBar(328, 18, 18, 189, false, false, musicplayerGUI.grid) musicplayerGUI.button2 = guiCreateButton(21, 376, 97, 25, "Stop", false, musicplayerGUI.window) musicplayerGUI.button3 = guiCreateButton(20, 515, 97, 25, "Close", false, musicplayerGUI.window) musicplayerGUI.button1 = guiCreateButton(21, 325, 97, 25, "Play", false, musicplayerGUI.window) musicplayerGUI.logo2 = guiCreateStaticImage(262, 45, 212, 220, "Img/logo.png", false, musicplayerGUI.window) musicplayerGUI.label1 = guiCreateLabel(32, 66, 160, 17, "Hey laddies and gentleman..!", false, musicplayerGUI.window) guiSetFont(musicplayerGUI.label1, "default-bold-small") musicplayerGUI.label2 = guiCreateLabel(32, 83, 160, 17, "To play music in the player", false, musicplayerGUI.window) guiSetFont(musicplayerGUI.label2, "default-bold-small") musicplayerGUI.label3 = guiCreateLabel(32, 100, 160, 17, "Select the song from the list", false, musicplayerGUI.window) guiSetFont(musicplayerGUI.label3, "default-bold-small") musicplayerGUI.label4 = guiCreateLabel(32, 117, 160, 17, "And hit PLAY! < Enjoy >", false, musicplayerGUI.window) guiSetFont(musicplayerGUI.label4, "default-bold-small") musicplayerGUI.label5 = guiCreateLabel(314, 288, 160, 17, "Visit : [url=http://WWW.FNF-MTA.TK]http://WWW.FNF-MTA.TK[/url]", false, musicplayerGUI.window) guiSetFont(musicplayerGUI.label5, "default-bold-small") musicplayerGUI.volumeBar = guiCreateScrollBar(10, 469, 112, 17, true, false, musicplayerGUI.window) guiScrollBarSetScrollPosition(musicplayerGUI.volumeBar, 100.0) musicplayerGUI.label6 = guiCreateLabel(42, 434, 46, 15, "Volume", false, musicplayerGUI.window) guiSetFont(musicplayerGUI.label6, "default-bold-small") guiScrollBarSetScrollPosition (musicplayerGUI.volumeBar, volume*100) guiWindowSetMovable (musicplayerGUI.window, true) guiWindowSetSizable (musicplayerGUI.window, false) guiSetVisible (musicplayerGUI.window, false) addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) -- Some Events -- addEventHandler ( "onClientGUIDoubleClick", musicplayerGUI.grid, onGuiClick, true) -- DoubleCLickPlaySong addEventHandler ( "onClientGUIDoubleClick", musicplayerGUI.grid, stopGTAradio, true) -- StartMusicTurnOffRadio addEventHandler ( "onClientGUIClick", musicplayerGUI.button1, onGuiClick, true) addEventHandler ( "onClientGUIClick", musicplayerGUI.button2, onGuiClick, true) addEventHandler ( "onClientGUIClick", musicplayerGUI.button3, onGuiClick,true) -- Events End -- end ) stationsNames = {} stations = {} function showGui () if guiShowing then guiShowing = false guiSetVisible (musicplayerGUI.window, false) showCursor (false) else guiShowing = true guiSetVisible (musicplayerGUI.window, true) showCursor (true) end end addCommandHandler("startmusic",showGui) bindKey("f3","down","startmusic") function onGuiClick (button, state, x,y) if source == musicplayerGUI.button1 and state == "up" then --play button local selected = guiGridListGetSelectedItem (musicplayerGUI.grid) if selected then local stationName = guiGridListGetItemText (musicplayerGUI.grid, selected, musicplayerGUI.column) if stationName then if currentPlaying then stopSound (currentPlaying) end currentPlaying = playSound (stations[stationName]) setSoundVolume (currentPlaying, volume) state = "play" else outputChatBox ("[Music Player]: Cant Strean This Song") end elseif state == "pause" and isSoundPaused(currentPlaying) then setSoundPaused (currentPlaying, false) end end if source == musicplayerGUI.button2 and state == "up" then --pause button if isSoundPaused (currentPlaying) == false then setSoundPaused (currentPlaying, true) end end if source == musicplayerGUI.button3 and state == "up" then -- 3d local selected = guiGridListGetSelectedItem (musicPlayerGUI.grid) if selected then local stationName = guiGridListGetItemText (musicplayerGUI.grid, selected, musicplayerGUI.column) if stationName then triggerServerEvent ("onClientRadioCreate", getLocalPlayer(), getLocalPlayer(), stationName) end end end if source == musicplayerGUI.button3 and state == "up" then -- close showGui () end if source == musicplayerGUI.grid and state == "up" then -- grid list click local selected = guiGridListGetSelectedItem (musicplayerGUI.grid) if selected then local stationName = guiGridListGetItemText (musicplayerGUI.grid, selected, musicplayerGUI.column) if stationName then if currentPlaying then stopSound (currentPlaying) end currentPlaying = playSound (stations[stationName]) setSoundVolume (currentPlaying, volume) else outputChatBox ("[Music Player]: This Song Is Offline, Please report to admin") end end end end function OnScroll(Scrolled) if source == musicplayerGUI.volumeBar then volume = guiScrollBarGetScrollPosition (source) / 100 if currentPlaying then setSoundVolume (currentPlaying, volume) end end end addEventHandler("onClientGUIScroll",getRootElement(),OnScroll) function onRadioCreate (x,y,z,path) local sound = playSound3D (path, x,y,z) setSoundVolume (sound, volume) setSoundMaxDistance (sound, 20) end addEvent ("onNewRadioCreate", true) addEventHandler ("onNewRadioCreate", getRootElement(), onRadioCreate) function onStart () triggerServerEvent ("requestForRadios", getLocalPlayer(), getLocalPlayer()) end addEventHandler ("onClientResourceStart", getResourceRootElement(getThisResource()), onStart) function onJoin (radia, names, st) for k,v in ipairs(radia) do local sound = playSound3D (v[4], v[1], v[2], v[3]) setSoundVolume (sound, volume/100) setSoundMaxDistance (sound, 20) end stationsNames = names stations = st for k,v in ipairs(stationsNames) do local row = guiGridListAddRow ( musicPlayerGUI.grid ) guiGridListSetItemText ( musicplayerGUI.grid, row, musicplayerGUI.column, v, false, false ) end end addEvent ("sendAllRadios", true) addEventHandler ("sendAllRadios", getRootElement(), onJoin)
-
Well, it's saying "musicplayerGUI" table does not exist, but that script you posted has it.
-
Mind posting the exact line? not the number, but the script line itself.
-
Here: musicplayerGUI = {}, Try removing that COMMA.
-
function setSkin() local playeraccount = getPlayerAccount(source) -- gets players account if getAccountData (playeraccount, "standardskin") == 0 then setElementModel(source, 0) else local skin = getAccountData (playeraccount, "standardskin") -- gets players skin setElementModel(source, skin) local playerWeaponID0 = getAccountData (playeraccount, "funmodev2-weaponID0") local playerWeaponID1 = getAccountData (playeraccount, "funmodev2-weaponID1") local playerWeaponID2 = getAccountData (playeraccount, "funmodev2-weaponID2") local playerWeaponID3 = getAccountData (playeraccount, "funmodev2-weaponID3") local playerWeaponID4 = getAccountData (playeraccount, "funmodev2-weaponID4") local playerWeaponID5 = getAccountData (playeraccount, "funmodev2-weaponID5") local playerWeaponID6 = getAccountData (playeraccount, "funmodev2-weaponID6") local playerWeaponID7 = getAccountData (playeraccount, "funmodev2-weaponID7") local playerWeaponID8 = getAccountData (playeraccount, "funmodev2-weaponID8") local playerWeaponID9 = getAccountData (playeraccount, "funmodev2-weaponID9") local playerWeaponID10 = getAccountData (playeraccount, "funmodev2-weaponID10") local playerWeaponID11 = getAccountData (playeraccount, "funmodev2-weaponID11") local playerWeaponID12 = getAccountData (playeraccount, "funmodev2-weaponID12") local playerWeaponAmmo0 = getAccountData (playeraccount, "funmodev2-weaponAmmo0") local playerWeaponAmmo1 = getAccountData (playeraccount, "funmodev2-weaponAmmo1") local playerWeaponAmmo2 = getAccountData (playeraccount, "funmodev2-weaponAmmo2") local playerWeaponAmmo3 = getAccountData (playeraccount, "funmodev2-weaponAmmo3") local playerWeaponAmmo4 = getAccountData (playeraccount, "funmodev2-weaponAmmo4") local playerWeaponAmmo5 = getAccountData (playeraccount, "funmodev2-weaponAmmo5") local playerWeaponAmmo6 = getAccountData (playeraccount, "funmodev2-weaponAmmo6") local playerWeaponAmmo7 = getAccountData (playeraccount, "funmodev2-weaponAmmo7") local playerWeaponAmmo8 = getAccountData (playeraccount, "funmodev2-weaponAmmo8") local playerWeaponAmmo9 = getAccountData (playeraccount, "funmodev2-weaponAmmo9") local playerWeaponAmmo10 = getAccountData (playeraccount, "funmodev2-weaponAmmo10") local playerWeaponAmmo11 = getAccountData (playeraccount, "funmodev2-weaponAmmo11") local playerWeaponAmmo12 = getAccountData (playeraccount, "funmodev2-weaponAmmo12") giveWeapon(source, playerWeaponID0, playerWeaponAmmo0, true) giveWeapon(source, playerWeaponID1, playerWeaponAmmo1, false) giveWeapon(source, playerWeaponID2, playerWeaponAmmo2, false) giveWeapon(source, playerWeaponID3, playerWeaponAmmo3, false) giveWeapon(source, playerWeaponID4, playerWeaponAmmo4, false) giveWeapon(source, playerWeaponID5, playerWeaponAmmo5, false) giveWeapon(source, playerWeaponID6, playerWeaponAmmo6, false) giveWeapon(source, playerWeaponID7, playerWeaponAmmo7, false) giveWeapon(source, playerWeaponID8, playerWeaponAmmo8, false) giveWeapon(source, playerWeaponID9, playerWeaponAmmo9, false) giveWeapon(source, playerWeaponID10, playerWeaponAmmo10, false) giveWeapon(source, playerWeaponID11, playerWeaponAmmo11, false) giveWeapon(source, playerWeaponID12, playerWeaponAmmo12, false) end end addEventHandler("onPlayerSpawn",root,setSkin)
-
local marca = createMarker ( 1200, 4521, 10, "checkpoint", 5.1, 200, 0, 0, 100, getRootElement() ) function check ( hitPlayer ) if ( getElementType ( hitPlayer ) == "player" ) then setElementHealth ( hitPlayer, 100 ) local health = getElementHealth ( hitPlayer ) outputChatBox ( "Tu Vida ahora es: ".. health, hitPlayer ) end end addEventHandler ( "onMarkerHit", marca, check )
-
Tenes que hacerlo vos mismo, es bastante facil, funciones que tenes que usar: addCommandHandler getPedOccupiedVehicle setVehicleDamageProof
-
Should be visible for all clients, since is created client side, but every player. Maybe they can't see it because of the same reason I couldn't, the position difference between resolutions.
-
That nothing was saved on these account data names.
-
Obviously the weapon ID is wrong or returning false.
-
function addTimer(hitElement) if (getElementType(hitElement) ~= "player") then return end addedtimer[hitElement] = setTimer(killPed, 60000, 1, hitElement) end addEventHandler( "onColShapeHit", safecol, addTimer) function removeTimer(hitElement) if (isTimer(addedtimer[hitElement])) then killTimer(addedtimer[hitElement]) end end addEventHandler( "onColShapeLeave", safecol, removeTimer) Ehm, te olvidaste de definir la tabla 'addedtimer'.
-
https://wiki.multitheftauto.com/wiki/Server_Manual
-
Don't give anyone access to your server files, but still clients will download the client side scripts, you can compile them though.
-
This is not a request forum, you either learn how to do it by yourself or you pay someone to do it for you.
-
function="changePos" type="server" /> function="setElementPosition" type="server"/> function="addEventHandler" type="server"/> Is that a kind of joke? remove it.
-
Wow, this is really good information... But I don't really know where to start... Isn't there any youtube vid. where i could just see how to script? -Jay I gave you a working tutorial, you just need to read.
-
If you create a variable server sided, it'll be global, for every player, but if you create it client side, it'll be unique for each client.
-
https://community.multitheftauto.com/ind ... tails&id=7 Podrias ver como esta hecho y creas uno propio.
-
Podes crear un colshape y desactivar el control de disparar al entrar. Funciones: createColRectangle toggleControl Evento: onColShapeHit