Jump to content

Kenix

Retired Staff
  • Posts

    4,121
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Kenix

  1. I don't know how you test. It working.. local policeSkins = { [280] = true, [281] = true, [282] = true, [283] = true, [284] = true, [285] = true, [286] = true } local theMarker = createMarker ( 1545.400, -1627.600, 13.400, "cylinder", 6, 255, 255, 255, 255 ) local gate = createObject ( 968, 1544.6999511719, -1631, 13.199999809265, 0, 270, 270 ) local state = { } local function gateState( hitElement,dim ) local el if getElementType( hitElement ) == 'player' then el = hitElement elseif getElementType( hitElement ) == 'vehicle' then el = getVehicleController( hitElement ) end if policeSkins[ getElementModel ( el ) ] then state[ el ] = not state[ el ] if state[ el ] then moveObject ( gate, 1500, 1544.700, -1630.800, 13.300 ) else moveObject ( gate, 1500, 1544.6999511719, -1631, 23.199999809265 ) end end end addEventHandler( "onMarkerHit", theMarker, gateState ) addEventHandler( 'onPlayerQuit',root, function( ) state[ source ] = nil end ) Marker visible. Just try. Updated.
  2. Very small move. Change position for example z-axis.
  3. Oh my bad i forgot call index table. local policeSkins = { [280] = true, [281] = true, [282] = true, [283] = true, [284] = true, [285] = true, [286] = true } local theMarker = createMarker ( 1545.400, -1627.600, 13.400, "cylinder", 6, 255, 255, 255, 0 ) local gate = createObject ( 968, 1544.6999511719, -1631, 13.199999809265, 0, 270, 270 ) local state = { } local function gateState( hitElement,dim ) local el if getElementType( hitElement ) == 'player' then el = hitElement elseif getElementType( hitElement ) == 'vehicle' then el = getVehicleController( hitElement ) end if policeSkins[ getElementModel ( el ) ] then state[ el ] = not state[ el ] if state[ el ] then moveObject ( gate, 1500, 1544.700, -1630.800, 13.300 ) else moveObject ( gate, 1500, 1544.6999511719, -1631, 13.199999809265 ) end end end addEventHandler( "onMarkerHit", theMarker, gateState ) addEventHandler( 'onPlayerQuit',root, function( ) state[ source ] = nil end ) Tested.
  4. fbi1 = createVehicle ( 596, -2429.7998046875, 515.2998046875, 29.700000762939, 0, 0, 215.99670410156 ) fbi2 = createVehicle ( 596, -2425.69921875, 518.5, 29.700000762939, 0, 0, 221.99523925781 ) fbi3 = createVehicle ( 596, -2422.3994140625, 521.599609375, 29.700000762939, 0, 0, 225 ) function lockfbi( player, seat, jacked ) if source == fbi1 or source == fbi2 or source == fbi3 then if seat == 0 then local skin = getElementModel ( player ) if not skin == 100 or not skin == 255 then --FBI skins cancelEvent( ) outputChatBox ( "Only FBI can enter this vehicle", player, 0, 0, 150, true ) end end end end addEventHandler ( "onVehicleStartEnter", root, lockfbi )
  5. Kenix

    help

    Remove color codes?
  6. 1.Install PMA( php my admin ) Better install package: Download 2.Add resource sql to acl.xml ( admin group ). 3.You not load module mysql.
  7. local policeSkins = { [280] = true, [281] = true, [282] = true, [283] = true, [284] = true, [285] = true, [286] = true } local theMarker = createMarker ( 1545.400, -1627.600, 13.400, "cylinder", 6, 255, 255, 255, 0 ) local gate = createObject ( 968, 1544.6999511719, -1631, 13.199999809265, 0, 270, 270 ) local state = { } local function gateState( hitElement,dim ) local el if getElementType( hitElement ) == 'player' then el = hitElement elseif getElementType( hitElement ) == 'vehicle' then el = getVehicleController( hitElement ) end if policeSkins[ getElementModel ( el ) ] then state[ el ] = not state[ el ] if state then moveObject ( gate, 1500, 1544.700, -1630.800, 13.300 ) else moveObject ( gate, 1500, 1544.6999511719, -1631, 13.199999809265 ) end end end addEventHandler( "onMarkerHit", theMarker, gateState ) addEventHandler( 'onPlayerQuit',root, function( ) state[ source ] = nil end ) Updated.
  8. local marker_areabase_gate_in = createMarker( 2492.8999023438,2773.3000488281,9.6000003814697,"cylinder",7, 91, 0, 0, 26 ) local marker_areabase_gate_out = createMarker( 2502.1999511719,2773.3000488281,9.6000003814697,"cylinder",7, 91, 0, 0, 26 ) local function teleport( hitElement, dim ) local el if getElementType( hitElement ) == 'player' then el = hitElement elseif getElementType( hitElement ) == 'vehicle' then el = getVehicleController( hitElement ) end local skin = getElementModel( el ) if skin == 130 or skin == 160 then if source == marker_areabase_gate_in then setElementPosition ( hitElement, 2509.3999023438, 2773.5, 11,false ) elseif source == marker_areabase_gate_out then setElementPosition ( hitElement, 2485.6999511719, 2773.5, 11,false ) end end end addEventHandler ( "onMarkerHit",root,teleport ) Updated.
  9. Клиент addEventHandler( 'onClientPlayerDamage',localPlayer, function( attacker, weapon, bodypart, loss ) local health = getElementHealth( source ) local team = getPlayerTeam( attacker ) if team then if attacker and attacker ~= source and weapon == 41 and getTeamName( team ) == 'Medic' and health < 100 then if getPlayerMoney( ) >= 10 then cancelEvent( ) end end end end ) Сервер createTeam ( "Medic", 200, 0, 100 ) addEventHandler( 'onPlayerDamage',root, function( attacker, weapon, bodypart, loss ) local health = getElementHealth( source ) local team = getPlayerTeam( attacker ) if team then if attacker and attacker ~= source and weapon == 41 and getTeamName( team ) == 'Medic' and health < 100 then local money = getPlayerMoney( source ) if money >= 10 then givePlayerMoney( attacker,10 ) takePlayerMoney( source,10 ) setElementHealth( source,getElementHealth( source ) + 10 ) end end end end ) Обновил.
  10. onPlayerLogin --> setElementData
  11. Use element data for sync.
  12. Server addCommandHandler ( "jetpack", function ( player ) local playerTeam = getPlayerTeam ( player ) if not playerTeam then return end local name = getTeamName ( playerTeam ) if name == "Owner" or name == "Admin" then local px, py, pz = getElementPosition ( player ) createPickup ( px, py, pz, 3, 370, 30000 ) end end )
  13. Вся проблема в модельке. Тутор от Devix'a Учитесь , это довольно просто. Возможно: Вы используете текстуру , которой не существует в txd. Т.е в dff есть путь к текстуре , но этой текстуры нет в txd. Желательно при создании модели все текстуры и т.д назвать по одинаковому.
  14. No problem Remember ipairs work only with number indexes and number indexes should be order. ( 1,2,3,.. ) not (1,3,5,.. ) pairs work with all indexes.
  15. Server addEvent( "onPlayerShowWindow", true ) addEventHandler( "onPlayerShowWindow", root, function ( ) local country = call( getResourceFromName( "admin" ), "getPlayerCountry", source ) local account = getPlayerAccount( source ) local ip = getPlayerIP ( source ) local serial = getPlayerSerial ( source ) if isGuestAccount( account ) then outputChatBox( "#FFA824*You aren't logged in!", source, 255, 12, 15, true ) setElementData ( source, "Ratio" , 0 ) setElementData ( source, "Race Wins" , 0 ) setElementData ( source, "Race Loses" , 0 ) setElementData ( source, "Country" , country ) setElementData ( source, "Points" , 0 ) setElementData ( source, "Money" , 0 ) setElementData ( source, "IP" , ip ) setElementData ( source, "Serial" , serial ) triggerClientEvent( source,"setText", source ) else local wins = getAccountData( account, "Race Wins" ) or 0 local money = getAccountData( account, "Money" ) or 0 local points = getAccountData( account, "Points" ) or 0 local loses = getAccountData( account, "Race Loses" ) or 0 local ratio = math.max( 0, math.min( 100, math.floor( wins / ( loses + wins ) * 100 ) ) ) or 0 setElementData ( source, "Ratio" , ratio ) setElementData ( source, "Race Wins" , wins ) setElementData ( source, "Race Loses" , loses ) setElementData ( source, "Country" , country ) setElementData ( source, "Points" , points ) setElementData ( source, "Money" , money ) triggerClientEvent( source,"setText",source ) end end ) Client local state function showUserPanel ( ) state = not state showCursor ( not isCursorShowing( ) ) guiSetVisible( userPanel,not guiGetVisible( userPanel ) ) if state then triggerServerEvent( "onPlayerShowWindow", localPlayer ) end end bindKey( "F1", "down", showUserPanel )
  16. pairs: t = { [1] = 1; ['two'] = 2; } for i,v in pairs( t ) do print( i,v ) --[[ 1 1 two 2 ]] end ipairs: t = { [1] = 1; ['two'] = 2; } for i,v in ipairs( t ) do print( i,v ) --[[ 1 1 ]] end
  17. local uTimers = { } addEventHandler( 'onPlayerChat',root, function( messageclean, messageType ) local message = string.lower( messageclean ) local x, y, z = getElementPosition ( source ) if string.find( message, "a " ) and string.find( message, "infernus" ) then outputChatBox( "Your car has spawned, enjoy!", source, 0, 255, 0 ) local vehicle = createVehicle ( 411, x, y+5, z + 10 ) if isTimer( uTimers[ source ] ) then killTimer( uTimers[ source ] ) end uTimers[ source ] = setTimer( warpPedIntoVehicle,100,1, source, vehicle ) end end ) addEventHandler( 'onPlayerQuit',root, function( ) uTimers[ source ] = nil end ) Because need timer for warp player/ped.
  18. Kenix

    GUI Table

    Updated. No problem
  19. Kenix

    GUI Table

    local gui_Table = { __main = function( ) local panel = guiCreateStaticImage( (0/800)*sx,(194/600)*sy,(197/800)*sx,(378/600)*sy,'_utils/_data/_image/main.png',true,false ); return panel, { profile_label = guiCreateLabel( (20/800)*sx,(312/600)*sy,(158/800)*sx,(29/600)*sy,'Profile',true,panel ); stats_label = guiCreateLabel( (20/800)*sx,(358/600)*sy,(158/800)*sx,(29/600)*sy,'Stats',true,panel ); shop_label = guiCreateLabel( (21/800)*sx,(405/600)*sy,(158/800)*sx,(29/600)*sy,'Shop',true,panel ); top_label = guiCreateLabel( (21/800)*sx,(452/600)*sy,(158/800)*sx,(29/600)*sy,'Top',true,panel ); sms_label = guiCreateLabel( (44/800)*sx,(495/600)*sy,(110/800)*sx,(22/600)*sy,'SMS',true,panel ); time_label = guiCreateLabel( (14/800)*sx,(241/600)*sy,(169/800)*sx,(34/600)*sy,'23:00',true,panel ); time = guiCreateStaticImage( (13/800)*sx,(210/600)*sy,(172/800)*sx,(77/600)*sy,'_utils/_data/_image/memo_hover.png',true,panel ); button1 = guiCreateStaticImage( (19/800)*sx,(298/600)*sy,(160/800)*sx,(41/600)*sy,'_utils/_data/_image/button1.png',true,panel ); button2 = guiCreateStaticImage( (19/800)*sx,(344/600)*sy,(160/800)*sx,(41/600)*sy,'_utils/_data/_image/button1.png',true,panel ); button3 = guiCreateStaticImage( (20/800)*sx,(389/600)*sy,(160/800)*sx,(42/600)*sy,'_utils/_data/_image/button1.png',true,panel ); button4 = guiCreateStaticImage( (20/800)*sx,(436/600)*sy,(160/800)*sx,(42/600)*sy,'_utils/_data/_image/button1.png',true,panel ); button5 = guiCreateStaticImage( (45/800)*sx,(488/600)*sy,(111/800)*sx,(30/600)*sy,'_utils/_data/_image/button1.png',true,panel ); more = guiCreateStaticImage( (76/800)*sx,(527/600)*sy,(44/800)*sx,(37/600)*sy,'_utils/_data/_image/options.png',true,panel ); } end; __font = function( el,font ) return guiSetFont( el,font ) end; __visible = function( el,state ) return guiSetVisible( el, state ) end; __destroy = function( el ) if isElement( el ) then return destroyElement( el ) end return false end; } local _,t = gui_Table.__main( ) guiSetFont( t.stats_label,'sa-header' ) Updated.
×
×
  • Create New...