Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. Вообще когда кто - то что нибудь пишет в чате это сохраняется в логе . Вот функция : https://wiki.multitheftauto.com/wiki/OutputServerLog
  2. function banSerial( source, command, noob, reason ) if ( noob ) then local theNoob = getPlayerFromName( noob ) if ( theNoob ) then local theNoobSerial = getPlayerSerial( theNoob ) addBan( nil, nil, theNoobSerial, source, reason ) outputChatBox(getPlayerName(theNoob) .." has been serial banned by " .. getPlayerName(source)..".",getRootElement(),255,255,0,false) else outputChatBox("#ff0000ERROR:#fff000 Invalid player name.", source ,255 ,255 ,0, true) end end end addCommandHandler( "sban", banSerial )
  3. Kenix

    Problems

    Jaysds1,oh ... You can use my function example : getPlayerCount = function() return #getElementsByType('player') end addCommandHandler('getCount',function() outputChatBox(getPlayerCount()) end) in client side
  4. Try <meta> <script src="Cars.lua" type="client" /> <file src="dffs/O.dff" /> <file src="txds/O.txd" /> </meta> function replace() local txd = engineLoadTXD ( "txds/O.txd" ) engineImportTXD ( txd, 462 ) local dff = engineLoadDFF ( "dffs/O.dff", 462 ) engineReplaceModel ( dff, 462 ) end addEventHandler("onClientResourceStart", resourceRoot, replace)
  5. Kenix

    Problems

    I create client side function : getPlayerCount = function() return #getElementsByType('player') end use it (tested).
  6. Use slothbot resource .
  7. You can use : setPedFrozen on teleporting and in seconds unfreeze player.
  8. try: function staff ( thePlayer, commandName) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then setElementHealth ( thePlayer, 1000 ) setPlayerNametagColor ( thePlayer, 190, 200, 190 ) setElementModel ( thePlayer, 165 ) setPedArmor ( thePlayer, 1000 ) triggerClientEvent(thePlayer,"god_mode",thePlayer) else outputChatBox ( "*" .. getPlayerName ( source ) .. "* this command is only for Staff .", thePlayer , 255,0,0 ) end end addCommandHandler("staff", staff)
  9. Why targetPlayer ? Is nil in event onPlayerDamage server side function main() medicblip = createBlip ( 2036, -1408, 17, 22, 0, 0, 0, 255 ) medicpickup = createPickup (2036, -1408, 17, 3, 1277, 100) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), main) addEventHandler ("onPickupUse", getRootElement(), function (playerWhoUses) if source == medicpickup then giveWeapon (playerWhoUses, 14, 1, true) setElementData (playerWhoUses, "job", "medic") end end) client side addEventHandler ("onClientPlayerDamage", getRootElement(), function(attacker, weapon, bodypart, loss) if (weapon == 15) and getElementData ( attacker, "job" == "medic" )then setElementHealth ( source, getElementHealth(source) + 10 ) givePlayerMoney ( attacker, 450 ) cancelEvent() end end)
  10. Try this a1 = createVehicle( 416, 10, 0, 0 ) a2 = createVehicle( 416, 20, 0, 0 ) a3 = createVehicle( 416, 30, 0, 0 ) addEventHandler("onVehicleStartEnter", getRootElement(), function( player, seat, jacked, door ) if door == 2 or 3 and source == a1 or a2 or a3 then cancelEvent() if source == a1 then setElementPosition(player, 2003.3, 2284.2, 1011.1) setElementDimension( player, 103 ) setElementData( player, "ambulance", 1 ) bindKey(player,"num_5", "down", bajar) outputChatBox("Pulsa num_5 para bajar", player) -- "Use num_5 to get off the car" elseif source == a2 then setElementPosition(player, 2003.3, 2284.2, 1011.1) setElementDimension( player, 104 ) setElementData( player, "ambulance", 2 ) bindKey(player,"num_5", "down", bajar) outputChatBox("Pulsa num_5 para bajar", player) -- "Use num_5 to get off the car" elseif source == a3 then setElementPosition(player, 2003.3, 2284.2, 1011.1) setElementDimension( player, 105 ) setElementData( player, "ambulance", 3 ) bindKey(player,"num_5", "down", bajar) outputChatBox("Pulsa num_5 para bajar", player) -- "Use num_5 to get off the car" end end end ) function bajar( player ) ambulance = getElementData( player, "ambulance" ) if ambulance == 1 then ax, ay, az = getElementPosition( a1 ) setElementDimension( player, 0 ) setElementPosition( player, ax, ay, az ) elseif ambulance == 2 then ax, ay, az = getElementPosition( a2 ) setElementDimension( player, 0 ) setElementPosition( player, ax, ay, az ) elseif ambulance == 3 then ax, ay, az = getElementPosition( a3 ) setElementDimension( player, 0 ) setElementPosition( player, ax, ay, az ) end end
  11. Http://wiki.multitheftauto.com/wiki/SetPedLookAt ?
  12. Nice maps good job . P.s i like drum and bass
  13. Kenix

    Vehicle Sloths

    https://wiki.multitheftauto.com/wiki/Int ... ng_the_GUI
  14. В баг трекер это напиши , недоработка скорее всего.
  15. Try this addEvent("god_mode",true) addEventHandler("god_mode",getRootElement(), function () addEventHandler ( "onClientPlayerDamage", getLocalPlayer(),function() cancelEvent() end) end)
  16. Thx for help everyone.
  17. Kenix

    Wanted

    getPlayerWantedLevel is server side function use this for call function : https://wiki.multitheftauto.com/wiki/CallServerFunction
  18. Kenix

    kill timer

    Maybe you mean this ? local player = getlocalPlayer() function kill() if (player) then killTime = setTimer(function() setElementHealth(player,0) end,30000, 0) elseif isTimer(kill) then killTimer(killTime) end end
  19. If somebody knows the answer , please answer.
  20. I want to teach bots (zombies) obstacles instead of to go forward. Example:player has run over a wall but a bot - zombie can't find player to its volume-that is behind a wall how to make that a bot-zombie bypassed this obstacle? Help please, thanks in advance.
  21. I use mobile phone dude full code function ResourceStart() marker = createMarker ( 1449.3040771484, -2937.9020996094, 2.9447371959686, "cylinder", 1, 255, 255, 0) for i, v in ipairs(getElementsByType('player')) do setElementData(v,"all","0") setElementData(v,"tea","0") setElementData(v,"water","0") end end addEventHandler ( "onResourceStart", resourceRoot, ResourceStart ) function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then outputChatBox( "You are now in my cafe.", hitElement, 255, 255, 0 ) outputChatBox( "If you want drink water use /water .", hitElement, 255, 255, 0 ) outputChatBox( "If you want drink tea use /tea .", hitElement, 255, 255, 0 ) addCommandHandler ( "water", water ) addCommandHandler ( "tea", tea ) end end addEventHandler( "onMarkerHit", marker, MarkerHit ) function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then outputChatBox ( getPlayerName( thePlayer).."has left the cafe.", getRootElement(), 255, 255, 0 ) removeCommandHandler ("water", water) removeCommandHandler ("tea", tea) end end addEventHandler( "onMarkerLeave", marker, markerLeave ) function water ( thePlayer, command ) outputChatBox( getPlayerName( thePlayer).."drunk water.", 255, 255, 0 ) setElementData ( thePlayer ,"water",tostring(tonumber(getElementData(thePlayer,"water"))+1)) end function tea ( thePlayer, command ) outputChatBox( getPlayerName( thePlayer).."drunk tea.", 255, 255, 0 ) setElementData ( thePlayer ,"tea",tostring(tonumber(getElementData(thePlayer,"tea"))+1)) end function all ( thePlayer, command ) local bira = tostring(tonumber(getElementData(thePlayer,"tea"))) local raki = tostring(tonumber(getElementData(thePlayer,"water"))) local toplam = tostring(tonumber(getElementData(thePlayer,"tea"))) + tostring(tonumber(getElementData(thePlayer,"water"))) outputChatBox( getPlayerName( thePlayer).."drunks"..toplam..".["..water.."water"..tea.."tea]", 255, 255, 0 ) end addCommandHandler ( "all", all )
×
×
  • Create New...