Jump to content

Again me T_T


MiniGoveya

Recommended Posts

Hey Ppl, sorry the inconvenience but I would like you to help me with something!

I have created a command script, everything was fine until I started to put the commands that would be directed towards other people, such as

/Noob

/f-uck

/gogo

/Wb

/Hi

etc ...

when I put in the script:

outputChatBox ("# 808080 <# 00FFFF" .. getPlayerName (playerSource ).."# 808080> Welcome Back, ".. targetPlayerName (playerSource) .."! "getRootElement (), 255, 255, 255, true)

the console gives me an error! , The console tells me this:

ERROR: com / com.lua: 122: Attempt to call global 'targetPlayerName' (a nil value)

So what should I do here?

P.S:

Sorry if my English is bad and forgive me the inconvenience. :|( outputchatbox is line 122 )

Link to comment

errorcq.jpg

I'm stupid :)

script:

function wb ( playerSource, command )

outputChatBox ("# 808080 <# 00FFFF" .. getPlayerName (playerSource ).."# 808080> Welcome Back, ".. getPlayerName (playerSource) .." ! "getRootElement (), 255, 255, 255, true)

end

addCommandHandler ( "wb", wb )

NOTE: can u show me, how can do /wb mini and not /wb #FF0000MiniGoveya ?? :D

Link to comment

uhm you forgot a comma after "!"

  
function wb ( playerSource, command, who ) 
outputChatBox ("# 808080 <# 00FFFF" .. getPlayerName (playerSource).."# 808080> Welcome Back, ".. getPlayerName (playerSource) .." ! ",getRootElement (), 255, 255, 255, true) 
end 
addCommandHandler ( "wb", wb ) 

Edited by Guest
Link to comment
we dont have your code? HOW COULD WE KNOW WHATS WRONG?

yes we do...

viewtopic.php?p=321948#p321948

@MiniGoveya

if you want to dyspley "target player name" you should use "who" instead of "getPlayerName (playerSource)"

function wb ( playerSource, command, who ) 
outputChatBox ("# 808080 <# 00FFFF" .. getPlayerName (playerSource).."# 808080> Welcome Back, "..who.." ! ",getRootElement (), 255, 255, 255, true) 
end 
addCommandHandler ( "wb", wb ) 

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