Jump to content

Why not work?


Tomek123

Recommended Posts

  • Replies 104
  • Created
  • Last Reply

Top Posters In This Topic

Posted
function onPlayerJoinLoadClothes ( ) 
local acc = getPlayerAccount ( source ) 
if acc then 
    for i=0,17 do 
        local texture, model = getPedClothes ( source ) 
        if texture and model then 
            setAccountData(acc, "clothes." .. tostring(i) .. ".texture", texture) 
            setAccountData(acc, "clothes." .. tostring(i) .. ".model", model) 
        end 
    end 
end 
addEventHandler("onPlayerJoin", root, onPlayerJoinLoadClothes) 
  
function onPlayerQuitSaveClothes ( ) 
    local playeracc = getPlayerAccount ( source ) 
    if playeracc then 
        for i=0,17 do 
            local texture, model = getPedClothes ( source ) 
            if texture and model then 
                setAccountData(playeracc, "clothes." .. tostring(i) .. ".texture", texture) 
                setAccountData(playeracc, "clothes." .. tostring(i) .. ".model", model) 
            end 
        end 
    end 
end 
addEventHandler("onPlayerQuit", root, onPlayerQuitSaveClothes) 

Posted

is that a joke proracer? you got different functions for the same thing :roll:

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Thanks, but again errors

SCRIPT ERROR: save_clothes\clothes.lua:26: 'end' expected (to close 'function' at line 1) near ''

WARNING: Loading script failed: save_clothes\clothes.lua:26: 'end' expected (to close 'function' at line 1) near ''

Posted

WHAT YOU ARE DOING IS A MESS, you got the function to save them but now you need to make the one that LOADS THE CLOTHES.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

This is not for load?

function onPlayerJoinLoadClothes ( ) 
local acc = getPlayerAccount ( source ) 
if acc then 
    for i=0,17 do 
        local texture, model = getPedClothes ( source ) 
        if texture and model then 
            setAccountData(acc, "clothes." .. tostring(i) .. ".texture", texture) 
            setAccountData(acc, "clothes." .. tostring(i) .. ".model", model) 
        end 
    end 
end 
addEventHandler("onPlayerJoin", root, onPlayerJoinLoadClothes) 

Posted

You got the 2 functions for SAVE not LOAD.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Try this...

function onPlayerJoinLoadClothes ( ) 
local acc = getPlayerAccount ( source ) 
    if acc then 
        for i=0,17 do 
            getAccountData(acc, "clothes." .. tostring(i) .. ".texture") 
            getAccountData(acc, "clothes." .. tostring(i) .. ".model") 
            addPedClothes ( source, "clothes." .. tostring(i) .. ".texture", "clothes." .. tostring(i) .. ".texture", i) 
        end 
    end 
end 
addEventHandler("onPlayerJoin", root, onPlayerJoinLoadClothes) 
  
function onPlayerQuitSaveClothes ( ) 
    local playeracc = getPlayerAccount ( source ) 
    if playeracc then 
        for i=0,17 do 
            local texture, model = getPedClothes ( source ) 
            if texture and model then 
                setAccountData(playeracc, "clothes." .. tostring(i) .. ".texture", texture) 
                setAccountData(playeracc, "clothes." .. tostring(i) .. ".model", model) 
            end 
        end 
    end 
end 
addEventHandler("onPlayerQuit", root, onPlayerQuitSaveClothes) 

Posted

no work

[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 
[2011-02-13 11:54:53] WARNING: save_clothes\clothes.lua:17: Bad argument @ 'getPedClothes' 

Posted

Why this peds don't won't dance?

function pedLoad () 
APed = createPed ( 178, 327.61187744141, 2478.4943847656, 17.784637451172 ) 
BPed = createPed ( 246, 321.29089355469, 2481.6147460938, 17.79061784668 ) 
CPed = createPed ( 87, 321.67388916016, 2476.1999511719, 17.784637451172 ) 
setTimer(setPedRotation,5000,1,APed,270 ) 
setTimer(setPedRotation,5000,1,BPed,225 ) 
setTimer(setPedRotation,5000,1,CPed,315 ) 
setTimer(setPedAnimation,5000,1,APed,"DANCING","DAN_Down_A",-1,true,true,true ) 
setTimer(setPedAnimation,5000,1,BPed,"DANCING","DAN_Left_A",-1,true,true,true ) 
setTimer(setPedAnimation,5000,1,CPed,"DANCING","DAN_Right_A",-1,true,true,true ) 
end 
addEventHandler ( "onResourceStart", getRootElement(), pedLoad ) 

  • MTA Team
Posted (edited)

I don't know, make it yourself? Search for it on the forums? Look on the community? If you cant type "www.forum.multitheftauto.com" or "www.wiki.multitheftauto.com" then TYPE forum.multitheftauto.com AND wiki.multitheftauto.com! IF YOU WANT TO make A GOOD server, LEARN Lua!

Edited by qaisjp
User has recalled this post
Posted

That script must be "interiors" resource default with MTA, you just start the resource "Interiors" and should get it.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Muscle stats, skills, etc? if so then use:

setPedStat 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

What? btw don't double post -_-

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

How i can change stats kill?

I try change and not work:

function changekills(thePlayer, commandName) 
    -- Output whether the setPlayerStat was successful in changing the BODY_MUSCLE STAT      
    if setPedStat(thePlayer, 121, 999) then 
        outputChatBox("") 
    else 
        outputChatBox("") 
    end 
end 
addCommandHandler("kills", changekills) 

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...