Blockland Forums > Modification Help
Call of Duty Mod NEED HELP!
<< < (4/4)
::Matt:::

--- Quote from: Red_Guy on February 03, 2011, 05:22:15 PM ---try:

--- Code: ---centerPrint(%killer.client, "<color:FFFFFF>+<color:00FF00>50", 2);

--- End code ---


also change:
      if(%client $= %killer)
         return;

to:
      if(%client == %killer)
         return;

$= is to compare strings, but %client is a number

and:
messageAll('',"<color:FFFF00>"@%killer.name@"<color:FFFFFF> got the nuke!");

to:
messageAll('',"<color:FFFF00>"@%killer.getPlayerName()@"<color:FFFFFF> got the nuke!");

in some cases %killer.name will not work.  but getPlayerName()  always works.


--- End quote ---

The resetting of the minigame and the @%killer.getPlayerName()@ works, but the +50 doesn't... It didn't work before I got your advice either...
Any suggestions?
Red_Guy:
one of the arguments to ::onDeath is the client (or player) who did the killing.  you will need some echo statements in your function to findout which one it is.

it could also be none of the above... in which case you will need to use one of the other arguments, and get the client from that.

once you DO have the client doing the killing, sending the message is easy.
::Matt:::

--- Quote from: Red_Guy on February 04, 2011, 05:02:49 PM ---one of the arguments to ::onDeath is the client (or player) who did the killing.  you will need some echo statements in your function to findout which one it is.

it could also be none of the above... in which case you will need to use one of the other arguments, and get the client from that.

once you DO have the client doing the killing, sending the message is easy.
--- End quote ---

I have the package so if I add a server command do I just say to echo the %killer.client?


--- Code: --- function serverCmdNuke();
{
if(!admin, ifsuperadmin);
echo(%killer.client);
if(!admin, ifsuperadmin);
return;
};
--- End code ---
Bauklotz:

--- Quote from: ::Matt:: on February 04, 2011, 05:09:47 PM ---I have the package so if I add a server command do I just say to echo the %killer.client?


--- Code: --- function serverCmdNuke();
{
if(!admin, ifsuperadmin);
echo(%killer.client);
if(!admin, ifsuperadmin);
return;
};
--- End code ---

--- End quote ---

WHAT THE forget. Tell me REASONS for the following:

* Why do you have completely random identation on the function registration?
* Why are you checking for if the name 'admin' is not true?
* Why are you checking for if the name 'ifsuperadmin' is true?
* Why do you have a return; at the end of a function anyway?
* Why do you have a ; at the end of the function name registration?

--- Code: ---function serverCmdNuke(%cl) {
    if(%cl.isSuperAdmin)
        echo(%cl.player);
}

--- End code ---

or what. that doesn't even make sense.
::Matt:::

--- Quote from: Bauklotz on February 05, 2011, 04:08:21 AM ---WHAT THE forget. Tell me REASONS for the following:

* Why do you have completely random identation on the function registration?
* Why are you checking for if the name 'admin' is not true?
* Why are you checking for if the name 'ifsuperadmin' is true?
* Why do you have a return; at the end of a function anyway?
* Why do you have a ; at the end of the function name registration?

--- Code: ---function serverCmdNuke(%cl) {
    if(%cl.isSuperAdmin)
        echo(%cl.player);
}

--- End code ---

or what. that doesn't even make sense.

--- End quote ---

Bro chill.
1. I don't know my bad I must have clicked the tab key.
2. I wanted to make it admin only...
3. I wanted to make it super-admin only.
4. If they aren't any of those, the function returns.
5. I forgot that you don't need one. It's not like I spent time on this it's just an example... Next time I write a little example script I'll be sure to make it more Bauklotz friendly.
Thanks for your help by that way.
Navigation
Message Index
Previous page

Go to full version