Jump to content

help


golanu21

Recommended Posts

addEventHandler("onPlayerCommand", root, 
function (source, cmd, gunid, ammo) 
    if cmd = = "addevent" then 
        local x, y, z = getLocalPlayer (source) 
        local accName = getAccountName( getPlayerAccount(source) ) 
            if gunid and ammo then 
                if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admins" ) ) then 
                    eventmarker = createMarker (x, y, z, "cylinder", 5, 0, 0, 0, 0 ) 
                    outputChatBox ("Adminul"..accName.."a pornit un event. [/joinevent]", source, 255, 0, 0 ) 
                     else 
                        outputChatBox ("[invalid Syntax]: /addevent [gunid] [ammo]", source, 255, 0, 0 ) 
                            else 
                                outputChatBox ("Tre sa fi un admin boule", source, 255, 0, 0 ) 
                                    else if cmd = = "joinevent" then 
                                        giveWeapon (source, gunid, ammo) 
                                        outputChatBox("Ai intrat in event", source, 0, 255, 0 ) 
                                        setElementPosition ( source, eventmarker ) 
                                    end 
                                end 
                            end 
                        end 
                    end 
)        

[14:49:31] SCRIPT ERROR: 3: 'then' expected near '=' 
[14:49:31] WARNING: 'then' expected near '= 

Link to comment
addEventHandler("onPlayerCommand", root, 
function (source, cmd, gunid, ammo) 
    if cmd == "addevent" then 
        local x, y, z = getLocalPlayer (source) 
        local accName = getAccountName( getPlayerAccount(source) ) 
            if gunid and ammo then 
                if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admins" ) ) then 
                    eventmarker = createMarker (x, y, z, "cylinder", 5, 0, 0, 0, 0 ) 
                    outputChatBox ("Adminul"..accName.."a pornit un event. [/joinevent]", source, 255, 0, 0 ) 
                     else 
                        outputChatBox ("[invalid Syntax]: /addevent [gunid] [ammo]", source, 255, 0, 0 ) 
                            else 
                                outputChatBox ("Tre sa fi un admin boule", source, 255, 0, 0 ) 
                                    else if cmd = = "joinevent" then 
                                        giveWeapon (source, gunid, ammo) 
                                        outputChatBox("Ai intrat in event", source, 0, 255, 0 ) 
                                        setElementPosition ( source, eventmarker ) 
                                    end 
                                end 
                            end 
                        end 
                    end 
)        

Link to comment

this is the script man

addEventHandler("onPlayerCommand", root, 
function ( cmd, gunid, ammo) 
    if cmd == "addevent" then 
    local x, y, z = getElementPosition (source) 
        local accName = getAccountName( getPlayerAccount(source) ) 
            if gunid and ammo then 
                if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admins" ) ) then 
                    eventmarker = createMarker (x, y, z, "cylinder", 5, 0, 0, 0, 0 ) 
                    outputChatBox ("Adminul"..accName.."a pornit un event. [/joinevent]", source, 255, 0, 0 ) 
                     else 
                        outputChatBox ("Tre sa fi un admin boule", source, 255, 0, 0 ) 
                    end 
                            else 
                                outputChatBox ("[invalid Syntax]: /addevent [gunid] [ammo]", source, 255, 0, 0 ) 
                            end 
                                    else if cmd == "joinevent" then 
              
                                        giveWeapon ( tonumber(gunid), tonumber(ammo)) 
                                        outputChatBox("Ai intrat in event", source, 0, 255, 0 ) 
                                        setElementPosition ( source, eventmarker ) 
                                    end 
                                end 
                            end) 

Link to comment

try this:

local eventmarker 
addEventHandler("onPlayerCommand", root,function (source, cmd, gunid, ammo) 
    if cmd == "addevent" then 
        local x, y, z = getElementPosition(source)--getLocalPlayer is clientside and use getElementPosition to get the x,y,z 
        local accName = getAccountName( getPlayerAccount(source) ) 
        if gunid and ammo then 
            if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admins" ) ) then 
                eventmarker = createMarker (x, y, z, "cylinder", 5, 0, 0, 0, 0 ) 
                outputChatBox ("Adminul"..accName.."a pornit un event. [/joinevent]", source, 255, 0, 0 ) 
            else 
                outputChatBox ("[invalid Syntax]: /addevent [gunid] [ammo]", source, 255, 0, 0 ) 
            end --forgot this 
        else 
            outputChatBox ("Tre sa fi un admin boule", source, 255, 0, 0 ) 
        end --forgot this too 
    else if cmd = = "joinevent" then 
        giveWeapon (source, gunid, ammo) 
        outputChatBox("Ai intrat in event", source, 0, 255, 0 ) 
        setElementPosition ( source, getElementPosition(eventmarker))--more arguments are required!!! 
    end 
end) 

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