PDA

View Full Version : Help... Newbie in Scripting of Lua! :P


Ghost Dog 13
03-28-2009, 07:29 PM
Hey Guys....

I need your help....

I want to create 2 simple commands...

1 must be "/l text" and will apear as ("User" says: text)
(Commands "l" and "local")

And the other must be

Command= "/p text" and apear as (User: )
Commands "p" and "public")

I tried creating them by jacking the "me" command but no success lol...

Here's what I currently Use:

function Chat(PlayerID,Text)
outputChatBox( .. getPlayerName(PlayerID) .. " says: " .. Text,255,0,255,255)
end
addCommand("l","L",1)

But it wont apear in game :/

tuntis
03-28-2009, 07:40 PM
Try

outputChatBox(getPlayerName(PlayerID) .. " says: " .. Text,255,0,255,255)

Also, change addCommand to this:

addCommand("l", "Chat")

[LCK]G0LdzEr0
03-28-2009, 07:40 PM
Overwrite L in addCommand to: Chat

Ghost Dog 13
03-28-2009, 07:42 PM
Ok thanks for the help... let me see if it works :P

Edit: Works!!! Wooot thanks :P


Is it possible to add ID Listing before the : ? so when someone says something... it will be in chatbox like "Admin (0): text" ???

Here's what I use atm.
function Chat(PlayerID,Text)
outputChatBox(getPlayerName(PlayerID) .. ": " .. Text,36,100,219,255)
end
addCommand("p", "Chat")

Mantis
03-28-2009, 08:33 PM
function Chat(PlayerID,Text)
outputChatBox(getPlayerName(PlayerID) .. "[ID:" .. PlayerID .. "] : " .. Text,36,100,219,255)
end
addCommand("p", "Chat")

Hmm, give that a try, not had chance to try it, but I think thats it.

Ghost Dog 13
03-29-2009, 03:11 AM
wow

Thank You so much mate :D

Yeh Worked :)

"Name[ID:X] : Text..."

I'll change it A litle so it will apear as "Name (ID): Text..."


Can't Wat till the text draw funcrion in wiki be filled :P I need them!! :P

http://i43.tinypic.com/14c439l.jpg

Sorry But I don't want others learn who I really am.. and what my project is :P