Jump to content

Problem with a command (no reaction)


Dudalus

Recommended Posts

Hello

Sorry for my english, I`m from Switzerland. Ok, my problem ist, that this command doesnt react. I can fill in /makeleader but I dont see anything (I cant see the else Code). The script is loaded serverside, is this my mistake ?

Heres the code:

function makeleader(thePlayer, command, tempPlayer, frakid) 
    local invPlayer = getPlayerFromName(tempPlayer) 
    local adminPlayer = getElementData(thePlayer, "AdminLevel") 
    if (tempPlayer) and (frakid) then 
        if tonumber(adminPlayer) == 3 then 
            if (tonumber(frakid) > 0) and (tonumber(frakid) <= 12) then 
                outputChatBox("Du hast den Spieler erfolgreich zum Leader gemacht", thePlayer, 0,255,0) 
                outputChatBox("Du wurdest erfolgreich zum Leader gemacht", tempPlayer, 0,255,0) 
                setElementData(tempPlayer, "Fraktion", tonumber(frakid() 
                setElementData(tempPlayer, "Rank", 5)                
            else 
                outputChatBox("Die Fraktion muss zwischen 0 und 12 liegen", thePlayer,255,0,0)               
            end 
        else 
            outputChatBox("Du bist kein Admin Level 3", thePlayer,255,0,0)       
        end 
    else 
        outputChatBox("Ungültige Eingaben", thePlayer, 255,0,0)     
    end 
end 
addCommandHandler("makeleader", makeleader) 

Edited by Guest
Link to comment
function makeleader(thePlayer, command, tempPlayer, frakid) 
    local invPlayer = getPlayerFromName(tempPlayer) 
    local adminPlayer = getElementData(thePlayer, "AdminLevel") 
    if (tempPlayer) and (frakid) then 
        if tonumber(adminPlayer) == 3 then 
            if (tonumber(frakid) > 0) and (tonumber(frakid) <= 12) then 
                outputChatBox("Du hast den Spieler erfolgreich zum Leader gemacht", thePlayer, 0,255,0) 
                outputChatBox("Du wurdest erfolgreich zum Leader gemacht", tempPlayer, 0,255,0) 
                setElementData(tempPlayer, "Fraktion", tonumber(frakid)) 
                setElementData(tempPlayer, "Rank", 5) 
            else 
                outputChatBox("Die Fraktion muss zwischen 0 und 12 liegen", thePlayer,255,0,0) 
            end 
        else 
            outputChatBox("Du bist kein Admin Level 3", thePlayer,255,0,0) 
        end 
    else 
        outputChatBox("Ungultige Eingaben", thePlayer, 255,0,0) 
    end 
end 
addCommandHandler("makeleader", makeleader)  

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