Jump to content

help


golanu21

Recommended Posts

Posted
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 '= 

  • MTA Team
Posted
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 
)        

Posted

[14:59:23] SCRIPT ERROR:12: 'end' expected (to close 'if' at line 7) near 'else' 
[14:59:23] WARNING: 12: 'end' expected (to close 'if' at line 7) near 'else' 

idk where i need to put end

  • MTA Team
Posted

golanu. read the error.

SCRIPT ERROR:12: 'end' expected (to close 'if' at line 7) near 'else'

This means that on line 12 there is an error. read it and debug it yourself.

  • MTA Team
Posted

X-SHADOW, don't modify your code. It spoils the nature of the forum. Make a new post.

also golanu check the code

Posted

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) 

  • MTA Team
Posted

For m91?nonsense=.png sake, we aren't here to fix your g76?nonsense=.png scripts at your beck and call. Part of scripting is to fix what mistakes you g76?nonsense=.png make, now learn how to debug or just.. sorry to say but .. or just get out!

Posted

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) 

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