Jump to content

Hello.


MiniGoveya

Recommended Posts

Hey dudes, as we are today? I hope well.

I was trying to create something like this:

* JOIN: MiniGoveya joined from: Caracas, Venezuela (VE).

But as a rare thing ^ ^ did not work.

Script:

function onPlayerConnect( source ) 
    if getPlayerCountry( source ) then 
    outputChatBox("#FFF000* JOIN:"..getPlayerName( source ).."#FFF000 joined from: "..getPlayerCountry( source ).." !", getRootElement(), 255, 255, 255, true ) 
    end 
end 
  
addEventHandler("onPlayerJoin", getRootElement (), onPlayerConnect) 
  

meta.xml:



  

What did I wrong?

see you later.

Link to comment

@ DMC: This can't be stolen client sided. Just take a look at the arguments of 'outputChatBox'! There is an argument called 'getRootElement()' that is only available in server side scripts.

BTW: The function 'getPlayerCountry' is a internal function of the 'admin' resource, so the script above must be INSIDE of the admin resource. To solve this problem just put the script into your 'admin' resource and add it to the meta.xml! But you should use a CallRemote function instead of the admin function. But this is more complicated!

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