Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. My bad.Not read all posts Client local skinID = 155 local ped = createPed ( skinID, 20,30,2, 15 ) setElementFrozen ( ped, true ) addEventHandler ( "onClientPedDamage", ped, function ( ) cancelEvent ( ) end ) onClientPlayerDamage/onPlayerDamage used only for players ( not for peds ). Also better attach element ped to event handler.( not if ped == source then ).It's faster And instead of this addEventHandler ( "onClientPedDamage", ped, function ( ) cancelEvent ( ) end ) Can create this addEventHandler ( "onClientPedDamage", ped, cancelEvent )
  2. Yes, ColShape is element, you can delete it. https://wiki.multitheftauto.com/wiki/Colshape
  3. Kenix

    Need Help

    viewtopic.php?f=148&t=40809 lockVehicles = { [470] = true; [471] = true; } --sets the lock vehicles lockSkins = { [287] = true; [288] = true; } -- sets the lock skins Ex
  4. It's wrong code. Only onClientPlayerDamage can be canceled.
  5. getElementModel getPlayerTeam
  6. Kenix

    JoinQuit

    local countryNames = { ["AD"] = "Andorra", ["AG"] = "Antigua - Barbuda", ["AI"] = "Anguilla Arabia", ["AL"] = "Albania", ["AM"] = "Armenia", ["AR"] = "Argentina", ["AT"] = "Austria", ["AU"] = "Australia", ["AW"] = "Aruba", ["BA"] = "Bosnia", ["BE"] = "Belgium", ["BG"] = "Bulgaria", ["BH"] = "Bahrain", ["BM"] = "Bermuda", ["BN"] = "Bronei ", ["BO"] = "Bolivia", ["BR"] = "Brazil", ["BS"] = "Bahamas", ["BW"] = "Botswana", ["BY"] = "Belarus", ["BZ"] = "Belize", ["CA"] = "Canada", ["CC"] = "Cocos", ["CH"] = "Switzerland", ["CI"] = "Ivory Coast", ["CL"] = "Chile", ["CN"] = "China", ["CO"] = "Colombia", ["CU"] = "Cuba", ["CY"] = "Cyprus", ["CZ"] = "Czech", ["DE"] = "Germany", ["DK"] = "Denmark", ["DM"] = "Dominica", ["DO"] = "Dominican", ["EC"] = "Ecuador", ["EE"] = "Estonia", ["EG"] = "Egypt", ["ES"] = "Spain", ["ET"] = "Ethiopia", ["FI"] = "Finland", ["FR"] = "France", ["GB"] = "Great-Britain", ["GL"] = "Greenland", ["GY"] = "Guyana", ["HR"] = "Croatia", ["HU"] = "Hungary", ["ID"] = "Indonesia", ["IE"] = "Ireland", ["IR"] = "Iran", ["IS"] = "Iceland", ["IT"] = "Italy", ["IN"] = "India", ["JO"] = "Jordan", ["JM"] = "Jamaica", ["jp"] = "Mexico", ["KW"] = "Kuwait", ["IT"] = "Italy", ["LU"] = "Luxembourg", ["LV"] = "Latvia", ["MA"] = "Morocco", ["MC"] = "Monaco", ["MT"] = "Malta", ["MX"] = "Mexico", ["NG"] = "Nigeria", ["NL"] = "Netherlands", ["NO"] = "Norway", ["PA"] = "Panama", ["PE"] = "Peru", ["PH"] = "Philipines", ["PK"] = "Pakistan", ["PL"] = "Poland", ["PT"] = "Portugal", ["QA"] = "Qatar", ["RO"] = "Romania", ["RU"] = "Russia", ["SA"] = "Saudi Arbia", ["SE"] = "Sweden", ["SI"] = "Slovania", ["TO"] = "Tonga", ["TR"] = "Turkey", ["UA"] = "Ukraine", ["UK"] = "United Kingdom", ["US"] = "United States", ["UY"] = "Uruguay", ["VN"] = "Vietnam", ["YE"] = "Yemen", ["YU"] = "Yugoslavia", ["ZA"] = "South Africa" } function onJoin( ) local country = exports['admin']:getPlayerCountry( source ) if not country then country = 'N/A' end setElementData( source,'Country', country ) outputChatBox( getPlayerName ( source ) .. " has joined the game from " .. country ~= 'N/A' and countryNames[ tostring( country ) ] or 'N/A', root, 255, 100, 100 ) end addEventHandler ( "onPlayerJoin", root, onJoin )
  7. Kenix

    JoinQuit

    You not need add resource to admin group in acl. Idk why it not working for you. Can you upload resource?
  8. Kenix

    JoinQuit

    Your code is wrong. oO Ok i create test my code now. Edit: I tested code. All working. [JOIN] Kenix joined game!RU
  9. anJaRuleZ,Your code wrong. I already posted corrected code
  10. He just copied an wiki example, don't bother. Yes it should work but why create this check?If you download all requested files you can use what you need without event ( onClientResourceStart ) and etc. Full code in client side. fadeCamera( true ) Done
  11. Kenix

    DxGui Creator

    You can create same in guieditor https://community.multitheftauto.com/index.php?p= ... ils&id=141 It's not hard to write in edit alpha and color.
  12. Event: onPlayerJoin Functions: setCameraMatrix fadeCamera setCameraTarget and text functions https://wiki.multitheftauto.com/wiki/Ser ... _functions And in client side create trigger to server side for destroy text. X-SHADOW, It's wrong example. Client side script only work if downloaded. You can test it.
  13. I said it in last code Server addEventHandler( 'onPlayerLogin', root, function( _, uAccountCurrent ) setElementData( source, 'Group', isObjectInACLGroup( 'user.' .. getAccountName( uAccountCurrent ), aclGetGroup ( 'Admin' ) ) and 'Admin' or isObjectInACLGroup( 'user.' .. getAccountName( uAccountCurrent ), aclGetGroup ( 'Moderator' ) ) and 'Moderator' or -- TODO 'Everyone' ) end ) Client addCommandHandler ( 'matrix', function ( ) if getElementData( localPlayer, 'Group' ) == 'Admin' then -- If palyer admin. outputChatBox ( 'passed if. Is HeadAdmin' ) outputChatBox( string.format( 'Matrix: %s,%s,%s,%s,%s,%s,%s,%s', getCameraMatrix ( ) ), 255, 255, 255, true ) else outputChatBox ( 'youre not headadmin!' ) end end ) Example Updated again
  14. Kenix

    Scripting

    viewtopic.php?f=148&t=40809
  15. It's function bugged in server side. I test it. it's function return only 1 value only false. And not output debug errors. Test it if interesting. Aibo, Stop yell at me. So use it ( Tested ) Client addCommandHandler ( 'matrix', function ( ) if exports.global:isPlayerHeadAdmin ( uPlayer ) then -- Change this condition. Ex ( Check element data ( if player logged set him data 'Admin','Moderator' or something ) ) Something like: if getElementData( localPlayer, 'Staff' ) == 'Admin' then outputChatBox ( 'passed if. Is HeadAdmin' ) outputChatBox( string.format( 'Matrix: %s,%s,%s,%s,%s,%s,%s,%s', getCameraMatrix ( ) ), 255, 255, 255, true ) else outputChatBox ( 'youre not headadmin!' ) end end ) Read comment in code.
  16. Server addCommandHandler ( 'matrix', function ( uPlayer ) if exports.global:isPlayerHeadAdmin ( uPlayer ) then outputChatBox ( 'passed if. Is HeadAdmin' ) outputChatBox( string.format( 'Matrix: %s,%s,%s,%s,%s,%s,%s,%s', getCameraMatrix ( uPlayer ) ), uPlayer, 255, 255, 255, true ) else outputChatBox ( 'youre not headadmin!' ) end end ) It's hard?
  17. Kenix

    JoinQuit

    It's some code. getPlayerCountry can return false if player country not found.
  18. Kenix

    table find

    You need use metatables for create something like oop. http://lua-users.org/wiki/ObjectOrientationTutorial
  19. Kenix

    don t work!!

    I tested. It working . You can in freeroam change weapon stats.
  20. Kenix

    Win sound!

    You need use event onClientPlayerWasted because you need play sound but playSound function is client side.
  21. Только что проверил. Всё создаётся. Зачем?
×
×
  • Create New...