Jump to content

WhoAmI

Members
  • Posts

    1,248
  • Joined

  • Last visited

Everything posted by WhoAmI

  1. You have to get vehicle server side to make it works.
  2. That is mainly math and trigonometric functions.
  3. WhoAmI

    Info!

    Oh yea, mistake.
  4. WhoAmI

    Info!

    I made you such a script.
  5. WhoAmI

    Info!

    local minutes = 5 --for what period of time message would be shown on chatbox setTimer ( outputChatBox, minutes * 60000, "Message" )
  6. WhoAmI

    Help

    That's just database where you can store datas whatever you want.
  7. Check this out local chat = true function chatDis(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then outputChatBox("#E3E8B7The chat has been disabled by "..getPlayerName(thePlayer)..".",root,255, 255, 255, true) chat = false end end addCommandHandler("chatoff", chatDis) function chatEn(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then outputChatBox("#E3E8B7The chat has been enabled by "..getPlayerName(thePlayer)..".",root,255, 255, 255, true) chat = true end end addCommandHandler("chaton", chatEn) function onChat ( _, messageType ) if ( messageType == 0 or messageType == 2 ) then if ( not chat ) then cancelEvent ( ) end end end addEventHandler ( "onPlayerChat", root, onChat )
  8. That marker is made by dxDrawLine functions.
  9. This is code from today function onPlayerWasted ( _, attacker ) if ( attacker ) then if ( getPlayerTeam ( source ) == getTeamFromName ( "Police" ) ) then if ( getElementType ( attacker ) == "player" ) then setPlayerWantedLevel ( attacker, getPlayerWantedLevel ( attacker ) + 1 ) end end end end addEventHandler ( "onPlayerWasted", root, onPlayerWasted ) You mean that if policeman kills policeman he doesn't get wantedlevel? If so function onPlayerWasted ( _, attacker ) if ( attacker and getPlayerTeam ( attacker ) ~= getTeamFromName ( "Police" ) then if ( getPlayerTeam ( source ) == getTeamFromName ( "Police" ) ) then if ( getElementType ( attacker ) == "player" ) then setPlayerWantedLevel ( attacker, getPlayerWantedLevel ( attacker ) + 1 ) end end end end addEventHandler ( "onPlayerWasted", root, onPlayerWasted )
  10. addCommandHandler("comprar",function(player) timer = setTimer ( function() givePlayerMoney (player, 25000 ) end, 5000, 0 ) end addCommandHandler("vender",function(player) killTimer ( timer ) end
  11. Polski język, piękny język, aczkolwiek angielski się przydaje.
  12. For example bindKey ( player, "d", "down", function () --trailer turns right end ) bindKey ( player, "d", "up", function () --trailer ends turning right end )
  13. WhoAmI

    Help

    You have to save data into DB.
  14. WhoAmI

    Music

    local currentPlaying function proxy() if isElement(currentPlaying) then destroyElement(currentPlaying) currentPlaying = playSound("music/proxy.mp3") setSoundVolume(currentPlaying, 50) --setSoundMaxDistance( currentPlaying, 5000 ) end end addEvent( "proxy", true ) addEventHandler( "proxy", getRootElement(), proxy ) function crackin( name ) if isElement(currentPlaying) then destroyElement(currentPlaying) currentPlaying = playSound("music/crackin.mp3") setSoundVolume(currentPlaying, 50) setSoundMaxDistance( currentPlaying, 5000 ) end end addEvent( "crackin", true ) addEventHandler( "crackin", getRootElement(), crackin )
  15. WhoAmI

    Music

    local currentPlaying function proxy() if isElement(currentPlaying) then destroyElement(currentPlaying) local currentPlaying = playSound("music/proxy.mp3") setSoundVolume(currentPlaying, 50) end end addEvent( "proxy", true ) addEventHandler( "proxy", getRootElement(), proxy ) function crackin( name ) currentPlaying = playSound("music/crackin.mp3") setSoundVolume(currentPlaying, 50) setSoundMaxDistance( currentPlaying, 5000 ) end addEvent( "crackin", true )
  16. Just put timer into variable and then destroyElement ( some_variable )
  17. Server function ZapiszEQ ( StringEQ ) local mysqlId = getElementData ( source, "mysqlNick" ) local EQ = exports.SQL:zapytanie ( "UPDATE dane SET EKWIPUNEK=? WHERE IMIE=?", StringEQ, mysqlId ) outputServerLog( "Gracz o nicku: ".. getPlayerName ( source ) .." zapisal swoj ekwipunek na konto: " .. mysqlId ) end addEvent ( "ZapiszPrzedmioty", true ) addEventHandler ( "ZapiszPrzedmioty", root, ZapiszEQ ) function GraczWyszedl ( ) triggerClientEvent ( source, "GraczWyszedl", root ) end addEventHandler ( "onPlayerQuit", root, GraczWyszedl ) Client function SaveEQ ( ) triggerServerEvent ( "ZapiszPrzedmioty", localPlayer, table.concat ( zapiszEkwipunek ( ), "|" ) ) end addEvent ( "GraczWyszedl", true ) addEventHandler ( "GraczWyszedl", root, SaveEQ ) If it doesn't work show me 'zapiszEkwipunek' funciton.
  18. WhoAmI

    Help

    Good job. But after restarting the resource, the data won't save.
  19. You have to use this function serverside, then all sever could see it.
  20. WhoAmI

    Music

    I want just to say, that you dont need this part == true it can be like this if isElement(sound) then
  21. WhoAmI

    Help

    In this forum there are few tutorials about usage.
  22. WhoAmI

    Muting Sound

    Just start music sometime, f.e. onClientResourceStart and set his volume to 0. And put in your script such a thing local checkbox = (...) local sound = playSound (...) setSoundVolume ( sound, 0 ) addEventHandler ( "onClientGUIClick", checkbox, function ( ) if ( guiCheckBoxGetSelected ( checkbox ) ) then setSoundVolume ( sound, 1 ) else setSoundVolume ( sound, 0 ) end end, false )
  23. WhoAmI

    Help

    You have to use db function (dbQuery or executeSQLQuery) to do such a thing. Create table, where would be serial and mute duration and when player connects to the server, check if serial is in database if so - mute him.
  24. function onPlayerWasted ( _, attacker ) if ( attacker ) then if ( getPlayerTeam ( source ) == getTeamFromName ( "Police" ) ) then if ( getElementType ( attacker ) == "player" ) then setPlayerWantedLevel ( attacker, getPlayerWantedLevel ( attacker ) + 1 ) end end end end addEventHandler ( "onPlayerWasted", root, onPlayerWasted ) @UP: Why are you using localPlayer variable in serverside code? If you can't help, just don't post, couse an author of this topic would got mindf**k.
×
×
  • Create New...