Jump to content

Freeroam


Recommended Posts

Hey guys iam adding Walking Styles in F1 but i have problem i click on the walking style but nothing does , should i add any thing in fr_server ?

my Fr_client

--------------------------- 
-- Walking Style Window 
--------------------------- 
  
function applyStyle(leaf) 
    if type(leaf) ~= 'table' then 
        leaf = getSelectedGridListLeaf(wndWalking, 'style') 
        if not leaf then 
            return 
        end 
    end 
    server.setPedWalkingStyle(g_Me, true) 
end 
  
function stopStyle() 
    server.setPedWalkingStyle(g_Me, false) 
end 
  
wndWalking = { 
    'wnd', 
    text = 'Walking', 
    width = 240, 
    x = -25, 
    y = 0.3, 
    controls = { 
        { 
            'lst', 
            id='style', 
            width=230, 
            height=290, 
            columns={ 
                {text='Walking', attr='name'} 
            }, 
            rows={xml='walking.xml', attrs={'name'}}, 
            expandlastlevel=false, 
            onitemdoubleclick=applyStyle 
        }, 
        {'btn', id='set', onclick=applyStyle}, 
        {'btn', id='stop', onclick=stopStyle}, 
        {'btn', id='close', closeswindow=true} 
    } 
} 
  
addCommandHandler('style', 
    function(command, lib, name) 
        server.setPedWalkingStyle(g_Me, true) 
    end 
) 

i added Walking.Xml in meta

"walking.xml" type="client" /> 

my walking styles

type="walkingstyle"> 
"MOVE_DEFAULT" id="0" /> 
"MOVE_PLAYER" id="54" /> 
"MOVE_PLAYER_F" id="55" /> 
"MOVE_PLAYER_M" id="56" /> 
"MOVE_ROCKET" id="57" /> 
"MOVE_ROCKET_F" id="58" /> 
"MOVE_ROCKET_M" id="59" /> 
"MOVE_ARMED" id="60" /> 
"MOVE_ARMED_F" id="61" /> 
"MOVE_ARMED_M" id="62" /> 
"MOVE_BBBAT" id="63" /> 
"MOVE_BBBAT_F" id="64" /> 
"MOVE_BBBAT_M" id="65" /> 
"MOVE_CSAW" id="66" /> 
"MOVE_CSAW_F" id="67" /> 
"MOVE_CSAW_M" id="68" /> 
"MOVE_SNEAK" id="69" /> 
"MOVE_JETPACK" id="70" /> 
"MOVE_MAN" id="118" /> 
"MOVE_SHUFFLE" id="119" /> 
"MOVE_OLDMAN" id="120" /> 
"MOVE_GANG1" id="121" /> 
"MOVE_GANG2" id="122" /> 
"MOVE_OLDFATMAN" id="123" /> 
"MOVE_FATMAN" id="124" /> 
"MOVE_JOGGER" id="125" /> 
"MOVE_DRUNKMAN" id="126" /> 
"MOVE_BLINDMAN" id="127" /> 
"MOVE_SWAT" id="128" /> 
"MOVE_WOMAN" id="129" /> 
"MOVE_SHOPPING" id="130" /> 
"MOVE_BUSYWOMAN" id="131" /> 
"MOVE_SEXYWOMAN" id="132" /> 
"MOVE_PRO" id="133" /> 
"MOVE_OLDWOMAN" id="134" />4 
"MOVE_FATWOMAN" id="135" /> 
"MOVE_JOGWOMAN" id="136" /> 
"MOVE_OLDFATWOMAN" id="137" /> 
"MOVE_SKATE" id="138 " /> 

  

Link to comment

Well, let me try to help you.

First of all, replace the whole code with the old one in client side part :

--------------------------- 
-- Walking Style Window 
--------------------------- 
  
function applyWalkStyle( leaf ) 
    if type( leaf ) ~= 'table' then 
        leaf = getSelectedGridListLeaf( wndWalking, 'walkStyle' ) 
        if not leaf then 
            return  
        end 
    end 
    server.setPedWalkingStyle( g_Me, leaf.id ) 
end 
  
function stopWalkStyle() 
    server.setPedWalkingStyle( g_Me, 0 ) 
end 
  
wndWalking = { 
    'wnd', 
    text = 'Walking style', 
    width = 250, 
    controls = { 
        { 
            'lst', 
            id = 'walkStyle', 
            width = 230, 
            height = 290, 
            columns = { 
                { text = 'Walking', attr = 'name' } 
            }, 
            rows = { xml = 'walkstyle.xml', attrs = { 'id', 'name' } }, 
            onitemdoubleclick = applyWalkStyle 
        }, 
        { 'btn', id = 'set', onclick = applyWalkStyle }, 
        { 'btn', id = 'stop', onclick = stopWalkStyle }, 
        { 'btn', id = 'close', closeswindow = true } 
    } 
} 
  
function setWalkStyleCommand( cmd, id ) 
    id = id and tonumber( id ) 
    if id then 
        server.setPedWalkingStyle( id ) 
    end 
end 
addCommandHandler( 'setwalkstyle', setWalkStyleCommand ) 
addCommandHandler( 'walkstyle', setWalkStyleCommand ) 

Secondly, replace the .xml file with this one :

type="walkingstyle"> 
    "0" name="MOVE_DEFAULT" /> 
    "54" name="MOVE_PLAYER" /> 
    "55" name="MOVE_PLAYER_F" /> 
    "56" name="MOVE_PLAYER_M" /> 
    "57" name="MOVE_ROCKET" /> 
    "58" name="MOVE_ROCKET_F" /> 
    "59" name="MOVE_ROCKET_M" /> 
    "60" name="MOVE_ARMED" /> 
    "61" name="MOVE_ARMED_F" /> 
    "62" name="MOVE_ARMED_M" /> 
    "63" name="MOVE_BBBAT" /> 
    "64" name="MOVE_BBBAT_F" /> 
    "65" name="MOVE_BBBAT_M" /> 
    "66" name="MOVE_CSAW" /> 
    "67" name="MOVE_CSAW_F" /> 
    "68" name="MOVE_CSAW_M" /> 
    "69" name="MOVE_SNEAK" /> 
    "70" name="MOVE_JETPACK" /> 
    "118" name="MOVE_MAN" /> 
    "119" name="MOVE_SHUFFLE" /> 
    "120" name="MOVE_OLDMAN" /> 
    "121" name="MOVE_GANG1" /> 
    "122" name="MOVE_GANG2" /> 
    "123" name="MOVE_OLDFATMAN" /> 
    "124" name="MOVE_FATMAN" /> 
    "125" name="MOVE_JOGGER" /> 
    "126" name="MOVE_DRUNKMAN" /> 
    "127" name="MOVE_BLINDMAN" /> 
    "128" name="MOVE_SWAT" /> 
    "129" name="MOVE_WOMAN" /> 
    "130" name="MOVE_SHOPPING" /> 
    "131" name="MOVE_BUSYWOMAN" /> 
    "132" name="MOVE_SEXYWOMAN" /> 
    "133" name="MOVE_PRO" /> 
    "134" name="MOVE_OLDWOMAN" /> 
    "135" name="MOVE_FATWOMAN" /> 
    "136" name="MOVE_JOGWOMAN" /> 
    "137" name="MOVE_OLDFATWOMAN" /> 
    "138" name="MOVE_SKATE" /> 

** And DONT FORGET To rename the .xml file to " walkstyle.xml "

Thirdly, open the server side and replace this codes with the old one :

g_RPCFunctions = { 
    addPedClothes = { option = 'clothes', descr = 'Modifying clothes' }, 
    addVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, 
    fadeVehiclePassengersCamera = true, 
    fixVehicle = { option = 'repair', descr = 'Repairing vehicles' }, 
    giveMeVehicles = { option = 'createvehicle', descr = 'Creating vehicles' }, 
    giveMeWeapon = { option = 'weapons.enabled', descr = 'Getting weapons' }, 
    givePedJetPack = { option = 'jetpack', descr = 'Getting a jetpack' }, 
    killPed = { option = 'kill', descr = 'Killing yourself' }, 
    removePedClothes = { option = 'clothes', descr = 'Modifying clothes' }, 
    removePedFromVehicle = true, 
    removePedJetPack = { option = 'jetpack', descr = 'Removing a jetpack' }, 
    removeVehicleUpgrade = { option = 'upgrades', descr = 'Adding/removing upgrades' }, 
    setElementAlpha = { option = 'alpha', descr = 'Changing your alpha' }, 
    setElementPosition = true, 
    setElementInterior = true, 
    setMyGameSpeed = { option = 'gamespeed.enabled', descr = 'Setting game speed' }, 
    setMySkin = { option = 'setskin', descr = 'Setting skin' }, 
    setPedAnimation = { option = 'anim', descr = 'Setting an animation' }, 
    setPedFightingStyle = { option = 'setstyle', descr = 'Setting fighting style' }, 
    setPedGravity = { option = 'gravity.enabled', descr = 'Setting gravity' }, 
    setPedStat = { option = 'stats', descr = 'Changing stats' }, 
    setTime = { option = 'time.set', descr = 'Changing time' }, 
    setTimeFrozen = { option = 'time.freeze', descr = 'Freezing time' }, 
    setVehicleColor = true, 
    setVehicleHeadLightColor = true, 
    setVehicleOverrideLights = { option = 'lights', descr = 'Forcing lights' }, 
    setVehiclePaintjob = { option = 'paintjob', descr = 'Applying paintjobs' }, 
    setVehicleRotation = true, 
    setWeather = { option = 'weather', descr = 'Setting weather' }, 
    spawnMe = true, 
    warpMe = { option = 'warp', descr = 'Warping' }, 
    -- 
    setPedWalkingStyle = { option = 'walkstyle', descr = 'Setting walk style' }, 
    -- 
} 
  
g_OptionDefaults = { 
    walkstyle = true, 
    alpha = true, 
    anim = true, 
    clothes = true, 
    createvehicle = true, 
    gamespeed = { 
        enabled = true, 
        min = 0.0, 
        max = 3 
    }, 
    gravity = { 
        enabled = true, 
        min = 0, 
        max = 0.1 
    }, 
    jetpack = true, 
    kill = true, 
    lights = true, 
    paintjob = true, 
    repair = true, 
    setskin = true, 
    setstyle = true, 
    spawnmaponstart = true, 
    spawnmapondeath = true, 
    stats = true, 
    time = { 
        set = true, 
        freeze = true 
    }, 
    upgrades = true, 
    warp = true, 
    weapons = { 
        enabled = true, 
        vehiclesenabled = true, 
        disallowed = {} 
    }, 
    weather = true, 
    welcometextonstart = true, 
    vehicles = { 
        maxidletime = 60000, 
        idleexplode = true, 
        maxperplayer = 2, 
        disallowed = {} 
    } 
} 

Add to the meta file :

"walkstyle.xml" type="client" /> 

Note, I have not try this But i'm sure it will work :D.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...