Jump to content

Newbie

Members
  • Posts

    208
  • Joined

  • Last visited

Details

  • Gang
    None

Newbie's Achievements

Chump

Chump (17/54)

0

Reputation

  1. Alright, i fixed it. If someone faces same problem the answer is inside the maps, i found a map which loads .COL and .DFF, and then affects all other maps on the server, and if i join other server, same shit happens, it crashes MTA engine. Hope this post will be helpful!
  2. Im getting strange collision bug for object: vcarshade This bug only happens sometimes, i can drive through the object.. I've tryed to: Server function RestoreCols ( ) triggerClientEvent ( "collisionRestore", getRootElement(), collisionRestore ) end addCommandHandler("eik", RestoreCols) function RestoreModel ( ) triggerClientEvent ( "restoreClientModel", getRootElement(), restoreClientModel ) end addCommandHandler( "nx", RestoreModel ) Client function RestoreCollision ( ) engineRestoreCOL ( 8557 ) engineRestoreCOL ( 8558 ) engineRestoreCOL ( 3458 ) engineRestoreCOL ( 8838 ) end addEvent ( "collisionRestore", true ) addEventHandler ( "collisionRestore", getRootElement(), RestoreCollision ) function ResetModel ( ) engineRestoreModel ( 8557 ) engineRestoreModel ( 8558 ) engineRestoreModel ( 3458 ) engineRestoreModel ( 8838 ) -- Object / Vehicle to restore to default GTA one. end addEvent ( "restoreClientModel", true ) addEventHandler ( "restoreClientModel", getRootElement(), ResetModel ) Does have no effect.. Im getting annoying by this bug
  3. Thanks for help. I've taken server sided code from MTASA Resources. Changed variables, it working fine now.
  4. I'll already did it by other way. It adds account! function registerr ( username, password ) if ( username and password and type ( username ) == 'string' and type ( password ) == 'string' ) then account = addAccount ( username, password ) exports.bar_messages:outputMessageBar("Successfully signed up! Now you can play", source, 0, 0, 0, 5000) end end addEvent( "register1", true ) addEventHandler( "register1", root, registerr ) How can i make that when player click's register button "as shown upper" to check if account already exists ?
  5. outputChatBox("Error creating account, contact the server admin.",source) Client addEventHandler("onClientGUIClick", root, function (button, state) if button == "left" and state == "up" then if (source == buttonHover) then username = exports.dxEditBox:getText( "1" ) password = exports.dxEditBox:getText( "2" ) triggerServerEvent("register1", localPlayer, username, password) outputChatBox("Username: ".. username .." Password: " .. password .."",255,255,255,true) end end end) Server function registerr( username, password ) if(password ~= "" and password ~= nil and username ~= "" and username ~= nil) then local accountAdded = addAccount(username,password) if(accountAdded) then outputChatBox("Thank you " .. getPlayerName(source) .. ", you're now registed, you can login with /login",source) else outputChatBox("Error creating account, contact the server admin.",source) end else outputChatBox("Error creating account, correct syntax: /register ",source) end end addEvent( "register1", true ) addEventHandler( "register1", root, registerr )
  6. You can only execute commands created by Lua. You cannot execute MTA harcoded commands due to security reasons. Oh..
  7. Newbie

    Hunter pickup

    function checkForHunter(number,sort,model) if sort == "vehiclechange" then if model == 425 then if (getElementData(source, "Hunter") == false) then setTimer(hunterBonus,200,1,source) end end end end addEvent('onPlayerPickUpRacePickup') addEventHandler("onPlayerPickUpRacePickup",getRootElement(),checkForHunter) addEvent("onMapStarting", true) addEventHandler("onMapStarting", getRootElement(), function() for i,v in ipairs(getElementsByType('player')) do setElementData(v, "Hunter", false) end end) So far i made that player cannot take a hunter again, but there's problem, some maps has "stacked" hunter pickups, and it gives me bonus many times.. is there any way to fix it ?
  8. Newbie

    [Solved]

    Thanks for help, i made what i needed for!
  9. Newbie

    [Solved]

    Nah.. I've tested it again, same problem lol
  10. Thanks Tasty! I've did it in my way, tested,working fine: addEvent("15s",true) addEventHandler("15s",getRootElement(), function () for i, sound in ipairs(getElementsByType("sound")) do setSoundVolume(sound, 0.1) local sound1 = playSound("data/files/wreckingball.ogg") setSoundVolume(sound1, 1) local soundLength = getSoundLength(sound1) setTimer(unmuteSounds, soundLength*1000, 1) end end) ----- function unmuteSounds () for i, sound in ipairs(getElementsByType("sound")) do setSoundVolume(sound, 1) end end
  11. For those who don't understand what im trying to do: i need to play this: local sound1 = playSound("data/files/wreckingball.ogg") louder than any other server sounds.
  12. Newbie

    [Solved]

    ) expected near =, line 4
  13. Thanks for your help, but that's a radio made by .pls streams So, okay. Here's my sound (this should hear loudest) addEvent("15s",true) addEventHandler("15s",getRootElement(), function () local sound1 = playSound("data/files/wreckingball.ogg") setSoundVolume(sound1, 1) end) And theres way to make him loudest, set all other sounds volume to 0.5 and keep my sounds as 1. function muteSounds () for i, sound in ipairs(getElementsByType("sound")) do setSoundVolume(sound, 0.5) if sound == sound1 then setSoundVolume(sound1, 1) end end end addEventHandler("onClientResourceStart", root, function () setTimer(muteSounds, 50, 0) --To make sure that the sound is already playing end) It seems to be playing my sound at 0.5
×
×
  • Create New...