Jump to content

nikitafloy

Members
  • Posts

    419
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by nikitafloy

  1. Lua functions are very fast you don't have to worry about a few loops. And if you are still not sure about that you can use getTickCount() to check your code speed. One algorithm can run fast, but if more than one, it could lead to delays in the work. Now my problem in compiling the search algorithm identical figures of two tables. Can you help me?
  2. Export another file from another resource. (Too costly to disassemble foreign code.) meta.xml (admin): --Exported Functions--> function="getPlayerCountry" /> I redid everything is different, I would like to get an answer: How to make reasonable to make it work well? viewtopic.php?f=91&t=75817&p=697320#p697310
  3. F1 -> Upgrade -> GUI opens with elements of tuning. The question is how this list is exported? I exported it differently. But it's probably too long process. How can I make it easier? And how can I compare the allowed ID tuning to filter them? (The code is not completed yet (func cs ())) Sorry for the translation. local vehicleUpgrades = { id = { }, name = { } } function loadItems( ) for k, i in ipairs( xmlNodeGetChildren( xmlLoadFile( "ups.xml" ) ) ) do vehicleUpgrades.id[k] = xmlNodeGetAttribute( i, "id" ) vehicleUpgrades.name[k] = xmlNodeGetAttribute( i, "name" ) end end addEventHandler( 'onResourceStart', resourceRoot, loadItems ) function cs(thePlayer) local theVehicle = getPedOccupiedVehicle( thePlayer ) local tabVEH = getVehicleCompatibleUpgrades ( theVehicle ) for _, k in pairs (tabVEH) do for j=1, #tabVEH do outputDebugString( vehicleUpgrades.id[j] .. ' ' .. tostring(k) ) if vehicleUpgrades.id[j] == tostring(k) then outputChatBox( vehicleUpgrades.name[j] ) end end end end addCommandHandler('c', cs)
  4. In freeroam exported this list, but I have not found how. upgrades.xml (admin\conf): "1000" name="Pro" /> "1001" name="Win" /> "1002" name="Drag" /> "1003" name="Alpha" /> "1004" name="Champ scoop" /> "1005" name="Fury scoop" /> "1006" name="Roof scoop" /> "1007" name="Side skirt Left" /> "1008" name="Nitro 5x" /> "1009" name="Nitro 2x" /> "1010" name="Nitro 10x" /> "1011" name="Race scoop" /> "1012" name="Worx scoop" /> "1013" name="Round fog lamps" /> "1014" name="Champ" /> "1015" name="Race" /> "1016" name="Worx" /> "1017" name="Side skirt Right" /> "1018" name="Upswept" /> "1019" name="Twin" /> "1020" name="Large" /> "1021" name="Medium" /> "1022" name="Small" /> "1023" name="Fury" /> "1024" name="Square fog lamps" /> "1025" name="Offroad" /> "1026" name="Side skirt Left (Alien)" /> "1027" name="Side skirt Right (Alien)" /> "1028" name="Exhaust (Alien)" /> "1029" name="Exhaust (X-flow)" /> "1030" name="Side skirt Right (X-flow)" /> "1031" name="Side skirt Left (X-flow)" /> "1032" name="Roof vent (Alien)" /> "1033" name="Roof vent (X-flow)" /> "1034" name="Side skirt Right (Alien)" /> "1035" name="Side skirt Left (Alien)" /> "1036" name="Exhaust (Alien)" /> "1037" name="Exhaust (X-flow)" /> "1038" name="Side skirt Right (X-flow)" /> "1039" name="Side skirt Left (X-flow)" /> "1040" name="Roof vent (Alien)" /> "1041" name="Roof vent (X-flow)" /> "1042" name="Side skirt Left (Chrome strip)" /> "1043" name="Exhaust (Slamin)" /> "1044" name="Exhaust (Chromer)" /> "1045" name="Side skirt Right (Alien)" /> "1046" name="Side skirt Left (Alien)" /> "1047" name="Exhaust (Alien)" /> "1048" name="Exhaust (X-flow)" /> "1049" name="Side skirt Right (X-flow)" /> "1050" name="Side skirt Left (X-flow)" /> "1051" name="Roof vent (Alien)" /> "1052" name="Roof vent (X-flow)" /> "1053" name="Spoiler (Alien)" /> "1054" name="Spoiler (X-flow)" /> "1055" name="Side skirt Right (Alien)" /> "1056" name="Side skirt Left (Alien)" /> "1057" name="Exhaust (Alien)" /> "1058" name="Exhaust (X-flow)" /> "1059" name="Side skirt Right (X-flow)" /> "1060" name="Side skirt Left (X-flow)" /> "1061" name="Roof vent (Alien)" /> "1062" name="Roof vent (X-flow)" /> "1063" name="Spoiler (Alien)" /> "1064" name="Spoiler (X-flow)" /> "1065" name="Side skirt Right (Alien)" /> "1066" name="Side skirt Left (Alien)" /> "1067" name="Exhaust (Alien)" /> "1068" name="Exhaust (X-flow)" /> "1069" name="Side skirt Right (X-flow)" /> "1070" name="Side skirt Left (X-flow)" /> "1071" name="Roof vent (Alien)" /> "1072" name="Roof vent (X-flow)" /> "1073" name="Shadow" /> "1074" name="Mega" /> "1075" name="Rimshine" /> "1076" name="Wires" /> "1077" name="Classic" /> "1078" name="Twist" /> "1079" name="Cutter" /> "1080" name="Switch" /> "1081" name="Grove" /> "1082" name="Import" /> "1083" name="Dollar" /> "1084" name="Trance" /> "1085" name="Atomic" /> "1086" name="Stereo bass boost" /> "1087" name="Hydralics" /> "1088" name="Side skirt Right (Alien)" /> "1089" name="Side skirt Left (Alien)" /> "1090" name="Exhaust (Alien)" /> "1091" name="Exhaust (X-flow)" /> "1092" name="Side skirt Right (X-flow)" /> "1093" name="Side skirt Left (X-flow)" /> "1094" name="Roof vent (Alien)" /> "1095" name="Roof vent (X-flow)" /> "1096" name="Ahab" /> "1097" name="Virtual" /> "1098" name="Access" /> "1100" name="Bullbar (Chrome grill)" /> "1101" name="Side skirt Right (Chrome flames)" /> "1102" name="Side skirt Left (Chrome strip)" /> "1103" name="Roof (Convertible roof)" /> "1104" name="Exhaust (Chromer)" /> "1105" name="Exhaust (Slamin)" /> "1106" name="Side skirt Left (Chrome arches)" /> "1107" name="Side skirt Right (Chrome strip)" /> "1108" name="Side skirt Left (Chrome strip)" /> "1109" name="Rear bullbars (Chromer)" /> "1110" name="Rear bullbars (Slamin)" /> "1111" name="Unknown" /> "1112" name="Unknown" /> "1113" name="Exhaust (Chromer)" /> "1114" name="Exhaust (Slamin)" /> "1115" name="Front bullbars (Chromer)" /> "1116" name="Front bullbars (Slamin)" /> "1117" name="Front bumper (Chromer)" /> "1118" name="Side skirt Left (Chrome trim)" /> "1119" name="Side skirt Left (Wheelcovers)" /> "1120" name="Side skirt Right (Chrome trim)" /> "1121" name="Side skirt Right (Wheelcovers)" /> "1122" name="Side skirt Left (Chrome flames)" /> "1123" name="Bullbar (Chrome bars)" /> "1124" name="Side skirt Right (Chrome arches)" /> "1125" name=
  5. How i can export 'upgrades.xml' from admin/conf ? And how can I export auto parts specifically for this transport in the list?
  6. outputChatBox(tostring(x)) -- try this
  7. why this is normal ? any explanation why the debugscript gave that warning ? Because in my script the same error. Condition that you have, works in a particular case, everything else - error.
  8. I have already solved the problem, thanks.
  9. The problem is that one event creates an element, it attaches more. For one person, it works well, but when several of them, the object is attached to the last, but not attached to the first. factoryDo = createObject( 3016, x,y-1,z+1 ) after any time: attachElements( factoryDo, source, -0.05, 0.36, 0.52 ) and later: destroyElement( factoryDo )
  10. thx, I already did that. In table 2 values.
  11. I want to know what returns this table? nil - does not work. This is my main question. thx if attachedElements == nil then
  12. addEventHandler( 'onPlayerVehicleExit', getRootElement(), funcHide ) -- You can use your part of code without this.
  13. Sorry, I don't really understand you. What should i do? I know that the table is created with the elements, but there are no elements. Then would it be written debug 'bad argument', but here it is not.
  14. You add the ID to retrieve it later use without the player. setElementID ( OwnerVehicle, 'any_there' .. tostring(getowner) ) -- Element with ID 'any_there lashiko721'. You hide the car. function funcHide () destroyElement ( getElementByID ( 'any_there' .. tostring(getownerAcc) ) ) addEventHandler( 'onPlayerVehicleExit', getRootElement(), funcHide ) -- You can use your part of code without this. With setElementVisibleTo will not work - 'This does not work with all entities - vehicles, players and objects are exempt.'.
  15. nikitafloy

    help ..

    From command is executed?
  16. In this function terminates before for, why? function facJob( hitElement, matchingDimension ) if isElementWithinMarker ( hitElement, source ) then local attachedElements = getAttachedElements ( hitElement ) if attachedElements then outputChatBox('0') -- output 0 and all. for _, ElementValue in ipairs ( attachedElements ) do outputDebugString ( '1' ) if getElementModel ( ElementValue ) == 3016 then break else vbjob ( source, hitElement ) break end end else outputChatBox('2') vbjob ( source, hitElement ) end end end
  17. addCommandHandler("hud", function() showPlayerHudComponent("all", false) -- false, чтобы убрать. end )
×
×
  • Create New...