Jump to content

SuperNick Help..#2


justn

Recommended Posts

Hey guys,

I made a supernick script it was working fine at first, but then i updated the server and it doesnt work..

This is the function the error is in:

function setPlayerSuperNick( player,command,choice,supernick ) 
    if ( command == "sp" ) then 
        if ( not isGuestAccount( getPlayerAccount ( player ) ) ) then 
            if ( choice ) then 
                if ( choice == "set" ) then 
                    if ( supernick ) then 
                        if (tonumber(string.sub(getElementData(player,"Cash"), 2)) >= tonumber(price)) then 
                            setAccountData(getPlayerAccount(player),"supernick",supernick) 
                            outputChatBox(supercolor.."[superNick]: #FFFFFF"..getPlayerName(player).." #FFFFFFhas bought a "..supercolor.."supernick#FFFFFF for #00FF00$#FFFFFF"..price.." #FFFFFF ( "..supercolor..getAccountData(getPlayerAccount(player),"supernick").."#FFFFFF )",root,255,255,255,true) 
                            outputChatBox(supercolor.."[superNick]: #FFFFFFYou have bought a  "..supercolor.."supernick #FFFFFFfor #00FF00$#FFFFFF"..price,player,255,255,255,true) 
                            setElementData(player,"Cash",tonumber(string.sub(getElementData(player,"Cash"), 2))-tonumber(price)) 
                        else 
                            outputChatBox(supercolor.."[superNick]: #FFFFFFYou must have atleast #00FF00$#FFFFFF"..price.."#FFFFFF to buy a "..supercolor.."supernick",player,255,255,255,true) 
                        end 
                    else 
                        outputChatBox(supercolor.."[superNick]: #FFFFFFYou haven't put a "..supercolor.."supernick #FFFFFF",player,255,255,255,true) 
                    end 
                elseif ( choice == "remove" ) then 
                    if ( getAccountData(getPlayerAccount(player),"supernick" ) ~= "nil" ) then 
                        outputChatBox(supercolor.."[superNick]: #FFFFFF"..getAccountData(getPlayerAccount(player),"supernick" ).."#FFFFFF has removed his "..supercolor.."supernick #FFFFFF( "..supercolor..getPlayerName(player).. " #FFFFFF)",player,255,255,255,true) 
                        setAccountData(getPlayerAccount(player),"supernick",nil) 
                        outputChatBox(supercolor.."[superNick]: #FFFFFFYour "..supercolor.."supernick #FFFFFFhas been removed",player,255,255,255,true) 
                    else 
                        outputChatBox(supercolor.."[superNick]: #FFFFFFYou do not have a "..supercolor.."supernick #FFFFFFto remove",player,255,255,255,true) 
                    end 
                else 
                    outputChatBox(supercolor.."[superNick]: #FFFFFFFormat is: /sp set/remove "..supercolor.."supernick",player,255,255,255,true) 
                end 
            else 
                outputChatBox(supercolor.."[superNick]: #FFFFFFFormat is: /sp set/remove "..supercolor.."supernick",player,255,255,255,true) 
            end 
        else 
            outputChatBox(supercolor.."[superNick]: #FFFFFFYou must login to set/remove your "..supercolor.."supernick",player,255,255,255,true) 
        end 
    end 
end 
addCommandHandler("sp",setPlayerSuperNick) 
addEventHandler("onPlayerCommand",getRootElement(),setPlayerSuperNick) 

ERROR: sp_server.lua:22: bad argument #1 of 'sub'(string expected,got boolean)

Link to comment
I won't help someone who takes community resources then edit it by adding his name and his server name on it.

Huh ? you're acting as if I asked for your help, well guess what ? I didn't ask for your help.

and Secondly I made this script 100% myself.

Please don't post if you don't have anything helpful to say :|

Link to comment

@nabil1478; You're saying it as if i asked you personally for help .. and as I said, I made this script 100% myself, please give me the link to where i 'stole' this please ? since you wanna be such a smartass.. you don't have the full code, you don't even know what the script does.. so please, show the link.

@IIYAMA I'll test it later, currently on my phone. thanks !

@Anubhav Thanks for your help :)

Link to comment
  • Moderators

I won't waste my time, I've just added my point here.

If you want to say something very negative, don't you think you need a bit of proof for that?

Richt now you are destroying somebody his reputation, when hè is only asking for help.

Next time keep it for yourself, unless you know where it is from.

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