Welcome to Open Carnage

A resource for Halo 1 modding and tech, with unique means of rewarding individual content creation and support. Have a wander to see why we're worth the time! EST. 2012

mdc81

Customized message

You can create a script where when entering your server shows you a message specifically to you by your nickname, try it in the event.txt with the following event

 

event_join $name:M chef  'say * "Welcome Friend M chet"'

 

As you see is a welcome message specifically to my friends halo but it does not work for space there is M (space) chef only when it is a nickname without spaces and without 'someone can help me to solve that please, Thank

 

Share this post


Link to post
Share on other sites

Members of Open Carnage never see off-site ads.

34 minutes ago, Weyland said:

Hi @Kavawuvi,

 

That solution for names with spaces above doesn't work, e.g


event_prejoin '$name:Weyland Sucks' 'sv_kick $name'

doesn't kick the name.
 

Don't suppose you have any other suggestions?

 

Cheers

 

$name is not valid during event_prejoin because the player hasn't been assigned their name yet. Use event_join, instead.

Weyland likes this

Share this post


Link to post
Share on other sites

The event_prejoin is working fine on names with no spaces though?

event_join '$name:Weyland Sucks' 'sv_kick $name'
event_alive '$name:Weyland Sucks' 'sv_kick $name'

Share this post


Link to post
Share on other sites
1 hour ago, Weyland said:

The event_prejoin is working fine on names with no spaces though?

To my knowledge, event_prejoin's $name uses the name of the player who last took up that player slot, not the name of the player who is joining. It's possible sehe fixed this, but I can't be certain.
 

 

1 hour ago, Weyland said:

event_join '$name:Weyland Sucks' 'sv_kick $name'
event_alive '$name:Weyland Sucks' 'sv_kick $name'

Use 'sv_kick $n'.

 

Using sv_kick to kick by name is very dangerous if scripting. If you programmed this to look for a name that is just a number, then sv_kick will possibly kick the person with that number as their player index rather than that number as their name. Also, sv_kick only takes one argument, and if $name has a space in it, each word in the name will be treated as its own argument causing the command to fail.

Share this post


Link to post
Share on other sites

I've been using the following for a few months with no problems

event_prejoin '$name:WeylandSucks' 'sv_kick $name'

Using that, SAPP has consistently kicked the player joining with the specified name.

 

From what you're saying and from the testing I've done it appears using the same command for names with spaces just isn't going to work, even when I change the prejoin to a join and the sv_kick to a k - thank you for responding and your input anyway.

Share this post


Link to post
Share on other sites
13 minutes ago, Weyland said:

Hi @Kavawuvi

 

I've been using the following for a few months with no problems


event_prejoin '$name:WeylandSucks' 'sv_kick $name'

Using that, SAPP has consistently kicked the player joining with the specified name.

 

From what you're saying and from the testing I've done it appears using the same command for names with spaces just isn't going to work, even when I change the prejoin to a join and the sv_kick to a k - thank you for responding and your input anyway.

 

 

 

Let's look at the command for a moment:

sv_kick $name

You're using the command sv_kick which takes exactly one argument, and that is either the number of the player or the name of the player.

 

 

The variable, $name will be substituted for the name of the player. So, if we have a player called Weyland, the command will then look like this:

sv_kick Weyland

You're giving it one parameter: Weyland. Therefore, it will be successful and the player will be kicked.

 

 

Let's say our player is called Weyland Sucks for a moment. The command will look like this then:

sv_kick Weyland Sucks

The problem is now you're giving sv_kick TWO parameters: Weyland and Sucks. sv_kick only takes one parameter, so the command will fail. The player will not be removed from the game. Although it worked once when you were just checking for Weyland, it did not work this time.

 

 

Now let's also say our player is called 002 (my old name). The command will look like this then:

sv_kick 002

Note that "002" can be treated as a number, here, and thus Halo may instead kick player number 2 rather than the player named "002". Unless the player's number is also 2, then the command will fail, or worse: the wrong player might be kicked.

 

 

However, if you kicked players like this:

sv_kick $n

Then it will always kick the correct player regardless of the name of that player.

Share this post


Link to post
Share on other sites

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.