ItsMods

Full Version: Message after First kill.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I want to print a massage in Chat, after the first kill of this round.
The massage should be like this "*PLAYERNAME* HAS MADE THE FIRST KILL!!!"

My idea for a Solution was:
First i have add a Variable:
Code:
init()
{
...
level.firstkill = 0;
...
}
Then i have add some lines in incCodPoints( amount )
Code:
incCodPoints( amount )
{
     if( level.firstkill = 0 )
     {
         allclientsprint(self.name+ " HAS MADE THE FIRST KILL!!!");
         level.firstkill = 1;
     }
}
This should, if the player is the first player who make a Kill [level.firstkill = 0], print an message " *PLAYERNAME* HAS MADE THE FIRST KILL!!!".
After, it should set level.firstkill to 1. So nobody can make the firstkill again in this round.

The problem is:
if i start a Game with this mod, there comes a Error-Message:
"Server script compile error.
Bad syntax.
"

What is false in this script?
_______________________________________________________________
ORIGINAL THREAD (nobody has answered me...)
I'd like an massage right now....
no but forreal,
I'll help you once im home 1/2 hours
(10-27-2011, 11:12)gumpo03 Wrote: [ -> ]
Code:
incCodPoints( amount )
{
     if( level.firstkill = 0 )
     {
         allclientsprint(self.name+ " HAS MADE THE FIRST KILL!!!");
         level.firstkill = 1;
     }
}

If it's a "if" operator, then "=" has to be "==".

Like this:

Code:
incCodPoints( amount )
{
     if( level.firstkill == 0 )
     {
         allclientsprint(self.name+ " HAS MADE THE FIRST KILL!!!");
         level.firstkill = 1;
     }
}

But there should be easier ways of doing this :p
And I don't think this will work, but I just fixed your code for now.
massage != message
(10-27-2011, 11:17)jariz Wrote: [ -> ]I'd like an massage right now....
no but forreal,
I'll help you once im home 1/2 hours

Ok thx Big Grin
(10-27-2011, 11:19)Rendflex Wrote: [ -> ]
(10-27-2011, 11:12)gumpo03 Wrote: [ -> ]
Code:
incCodPoints( amount )
{
     if( level.firstkill = 0 )
     {
         allclientsprint(self.name+ " HAS MADE THE FIRST KILL!!!");
         level.firstkill = 1;
     }
}

If it's a "if" operator, then "=" has to be "==".

Like this:

Code:
incCodPoints( amount )
{
     if( level.firstkill == 0 )
     {
         allclientsprint(self.name+ " HAS MADE THE FIRST KILL!!!");
         level.firstkill = 1;
     }
}

But there should be easier ways of doing this :p
And I don't think this will work, but I just fixed your code for now.

Oh like php Big Grin
thank you, i would test it.
Thank you Rendflex Big Grin
It works now Big Grin
You guys are all wrong.
This guy wants to reward a player by giving him a nice relaxing massage after a stressful kill. None of you guys know how it is to be in a war. All a soldier wants, is a nice relaxing massage.
cough changed thread title