Jump to content

Pedido Script


Recommended Posts

to meio enferrujado mais ve se da certo:

function SetSkin(player,cmd,skinNumber) 
if(skinNumber and tonumber(skinNumber))then 
setElementModel(player,tonumber(skinNumber)) 
outputChatBox("Voce mudou de skin",player) 
else 
outputChatBox("Use /ss e o numero do skin",player) 
end 
end 
addCommandHandler("ss",SetSkin) 

Link to comment
to meio enferrujado mais ve se da certo:
function SetSkin(player,cmd,skinNumber) 
if(skinNumber and tonumber(skinNumber))then 
setElementModel(player,tonumber(skinNumber)) 
outputChatBox("Voce mudou de skin",player) 
else 
outputChatBox("Use /ss e o numero do skin",player) 
end 
end 
addCommandHandler("ss",SetSkin) 

só faltou verificar se a skin é valida.

function SetSkin ( thePlayer, cmd, id ) 
    if ( id and tonumber ( id ) ) then 
        id = tonumber(id); 
        idValido = false; 
        for _, v in ipairs ( getValidPedModels () ) do 
            if ( v == id ) then  
                idValido = true; 
                break; 
            end 
        end 
        return idValido and setElementModel ( thePlayer, id ) or outputChatBox ( "ID Invalido.", thePlayer, 255, 0, 0 ); 
    else 
        outputChatBox ( "Use: /"..cmd.." [sKINID]", thePlayer, 255, 0, 0 ); 
    end 
end 
addCommandHandler ( "ss", SetSkin, false, false ); 

(script parecido com o exemplo da função getValidPedModels() )

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