-
Posts
1,248 -
Joined
-
Last visited
Everything posted by WhoAmI
-
[SOLVED] Apply velocity to vehicle synced with server
WhoAmI replied to Einheit-101's topic in Scripting
You have to get vehicle server side to make it works. -
That is mainly math and trigonometric functions.
-
local minutes = 5 --for what period of time message would be shown on chatbox setTimer ( outputChatBox, minutes * 60000, "Message" )
-
That's just database where you can store datas whatever you want.
-
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 )
-
That marker is made by dxDrawLine functions.
-
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 )
-
addCommandHandler("comprar",function(player) timer = setTimer ( function() givePlayerMoney (player, 25000 ) end, 5000, 0 ) end addCommandHandler("vender",function(player) killTimer ( timer ) end
-
Polski język, piękny język, aczkolwiek angielski się przydaje.
-
[SOLVED] Apply velocity to vehicle synced with server
WhoAmI replied to Einheit-101's topic in Scripting
For example bindKey ( player, "d", "down", function () --trailer turns right end ) bindKey ( player, "d", "up", function () --trailer ends turning right end ) -
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 )
-
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 )
-
Just put timer into variable and then destroyElement ( some_variable )
-
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.
-
Good job. But after restarting the resource, the data won't save.
-
[SOLVED] Apply velocity to vehicle synced with server
WhoAmI replied to Einheit-101's topic in Scripting
You have to use this function serverside, then all sever could see it. -
I want just to say, that you dont need this part == true it can be like this if isElement(sound) then
-
In this forum there are few tutorials about usage.
-
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 )
-
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.
-
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.
