Jump to content

script


tiesjan

Recommended Posts

Posted

how to make a script, if i type /welcome that all player get this messagge "welcome [theplayersname]

i don't know how to do that getplayername thing

please help me

Posted (edited)
function welcome() 
for i,player in pairs(getElementsByType("player")) do 
local name = getPlayerName(player) 
outputChatBox("Welcome"..name,player) 
end 
end 
addCommandHandler("welcome",welcome) 

next time try to use wiki and make a par of code

Edited by Guest

Ingame Name : |DGT|Puma

DGT Clan Server 24/7 Owner/Scripter

MultiGameMode in progress :

n-560x95_FFFFFF_FFFFFF_0283C4_000000.png

Posted

The wiki has all the functions, that exists.

With it's arguments, mostly examples.

So what is "i don't know how to do that getplayername thing "

Ehm,

getPlayerName(player) 

Is it so hard?

You won't get nowhere, by Copy+Paste.

Can you try doing this yourself?

functions you will need:

addEventHandler ( "welcome" , function ( player , cmd , playerName ) 
local target = getPlayerFromName ( playerName ) 
outputChatBox ( getPlayerName ( target ) ) 

Business System viewtopic.php?f=108&t=35797

Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726

SQLite Tutorial viewtopic.php?f=148&t=38203

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