Jump to content

Ajuda com script


Recommended Posts

Posted

criei um grupo no acl chamado "Policial" e queria um script que o comando só ira valer para este grupo do acl, que nesse comando seria /Batercartao o personagem pegaria uma skin e um kit de armas só que isso dentro de um checkpoint

Posted (edited)

um exemplo de como você pode fazer isso

marker = createMarker(2326.4553222656,838.19079589844,6.3528056144714,"cylinder",2,255,0,0,255) 
  
function command(player) 
    if player then 
        if not isElementWithinMarker(player,marker) then 
            return 
        end 
        local account = getPlayerAccount(player) 
        if account and isObjectInACLGroup("user."..getAccountName(account),aclGetGroup("Policial")) then 
            setElementModel(player,0) 
            giveWeapon(player,31,500) 
        end 
    end 
end 
addCommandHandler("batercartao", command) 

Edited by Guest
jIcd9sc.png

Not worry about the future. Very soon it will come.

Posted

Banex, eu vi esse script, mais não está funcinando apareceu alguns erros, tentei resoslver e conseguir fazer apenas o marker aparecer mais quando digito comando "/batercartao" ele não funciona, será que fis algo de errado??

Script

marker = createMarker(2326.4553222656,838.19079589844,6.3528056144714,"cylinder",2,255,0,0,255) 
  
function command(player) 
    if player then 
        if not isElementWithinMarker(player,marker) 
       then 
        local account = getPlayerAccount(player) 
       if account and isObjectInACLGroup("user."..getAccountName(account),aclGetGroup("Soldado")) then 
            setElementModel(player,0) 
            giveWeapon(player,31,500) 
            end 
            end 
end 
end 
addCommandHandler("batercartao", command) 

Posted

Aqui está img: http://i.imgur.com/ckU9cSU.png?1

Codigo:

marker = createMarker(2319.7861328125,836.51287841797,6.7419986724854,"cylinder",2,255,0,0,255) 
  
function command(player) 
    if player then 
        if not isElementWithinMarker(player,marker) 
            return 
        end 
        local account = getPlayerAccount(player) 
        if account and isObjectInACLGroup("user."..getAccountName(account),aclGetGroup("Soldado")) then 
            setElementModel(player,0) 
            giveWeapon(player,31,500) 
        end 
    end 
end 
addCommandHandler("batercartao", command) 

Posted

Recomendo nunca criar elementos fora de funções/eventos quando o recurso for iniciado.

Pedro, Certifique-se de definir o script como server no meta.xml.

Please do not PM me with scripting related question nor support, use the forums instead.

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