[New Projet] NexgenSmartScoreBoardMultikillBrodcast112SDL

Discussions about Coding and Scripting
Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

[New Projet] NexgenSmartScoreBoardMultikillBrodcast112SDL

Post by Letylove49 » Thu Oct 27, 2022 10:22 pm

i Would like to make a multikilll message for Nexgen and i wish to have both the message in center and the message on the hud on left colorized. if possible i want to if my custom Mulitill is diseable the brocasd of the multikill
of Monsterhuntgold or any smartdm, sarctf r smartssb the message is brocasted on the same colore than the center. ( if this is possible ).

Actuly am unable to compile i got this message ( Error: C:\UT coding\UnrealTournament\Nexgenplus100SDLx\Classes\NXPMultikillMessage.uc(141) : Error, Bad or missing expression in 'If'.

i have try ti fund the soltution myself but i didn't fund it yet. Somone could pehaps help me please??'



Code: Select all

 function color getMKColor ( int DrawMKColor, int value){

if( case1) { return DrawMKColor=0 }
else
if( case2) {return DrawMKColor=1  }
else
if (case3) { return DrawMKColor=2  }
else
if (case4) { return DrawMKColor=3  }
else
if (case5) { return DrawMKColor=4  }
else
if (case6) { return DrawMKColor=5  }
else
if (case7) { return DrawMKColor=6  }
else
if (case8) { return DrawMKColor=7  }
else
if (case9) { return DrawMKColor=8  }
else
if (case10) { return DrawMKColor=9  }
else {
Return None}
}

 

Code: Select all

 

class NXPMultiKillMessage  extends MultiKillMessage;

#exec AUDIO IMPORT FILE="Sound\bdominating.wav" NAME=bdominating
#exec AUDIO IMPORT FILE="Sound\killingspree.wav" NAME=killingspree
#exec AUDIO IMPORT FILE="Sound\bholyshit.wav" NAME=bholyshit
#exec AUDIO IMPORT FILE="Sound\bludicrousKill.WAV" NAME=bludicrouskill
#exec AUDIO IMPORT FILE="Sound\bmegakill.wav" NAME=bmegakill
#exec AUDIO IMPORT FILE="Sound\femdoublekill.wav" NAME=femdoublekill
#exec AUDIO IMPORT FILE="Sound\femmultikill.wav" NAME=femmultikill
#exec AUDIO IMPORT FILE="Sound\femultra.wav" NAME=femultra
#exec AUDIO IMPORT FILE="Sound\femmonsterkill.wav" NAME=femmonsterkill
#exec AUDIO IMPORT FILE="Sound\femwicked.wav" NAME=femwicked


var localized string  Doublekillstring;       
var localized string  Triplekillstring;             
var localized string  Multikillstring;
var localized string  Megakillstring;
var localized string  Ultrakillstring;
var localized string  MonsterKillstring;
var localized string  Ludikrouskillstring;
var localized string  HolyShitString;
var localized string  IsStillGoingstring;
var localized string  cheaterstring;

var int DrawColor;
var byte Scorekill;
var float maxMultiScoreInterval;


// MKColors  for broadacast Multikill Message. (message on the hud )
const C_YELLOW = 0;
const C_YELLOWDARK = 1;
const C_ORANGE	=  2; 		
const C_ORANGEDARK = 3;
const C_RED = 4;
const C_REDDARK = 5;
const C_PINKC = 6;
const C_PINK = 7;
const C_PURPLE = 8;
const C_GREEN = 9;	




static function string GetString(
        optional int Switch,
	optional PlayerReplicationInfo RelatedPRI_1,
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject)
{
local byte Scorkill;
local float maxMultiScoreInterval;
	switch (Switch)
	{

if(bUseNexgenMultikillMessage==True)

Case 1 if ScoreKill = 2 && maxMultiScoreInterval <=3 ; client.showMsg(<C00> DOUBLE KILL);
break;
case 2 if Scorekill = 3 && maxMultiScoreInterval <=3  client.showMsg(<C01> TRIPLE KILL);
break;
case 3 if Scorekill = 4 && maxMultiScoreInterval <=3 ;  client.showMsg(<C02> MULTI KILL);
break;
case 4 if Scorekill = 5 && maxMultiScoreInterval <=3 ;  client.showMsg(<C03> MEGA KILL );
break;
case 5 if Scorekill = 6 && maxMultiScoreInterval <=3 ;  client.showMsg(<C04> ULTRA KILL );
break;
case 6 if Scorekill = 7 && maxMultiScoreInterval <=3 ;  client.showMsg(<C05> MONSTER KILL );
break;
case 7 if Scorekill = 8 && MultiScoreInterval <=3 ;  client.showMsg(<C06> LUDICROUS KILL );
break;
case 8 if Scorekill =>9 & >=39 && maxMultiScoreInterval <=3 ;client.showMsg(<C07>  H  O  L  Y   S  H  I  T !!!!!!! );
break;
case 9 if Scorekill =>40 & >=49 && maxMultiScoreInterval <=3 ;  client.showMsg(<C08> Is Still GOING );
break;
case 10 if Scorekill =50 && maxMultiScoreInterval <=3 ;  client.showMsg(<C09> Should get a Ban!:D );
break;
}

}

static simulated function ClientReceive( 
	PlayerPawn P,
	optional int Switch,
	optional PlayerReplicationInfo RelatedPRI_1, 
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject)

{

local byte Scorkill;
local float maxMultiScoreInterval;
	Super.ClientReceive(P, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject);

	switch (Switch)
	{



Case 1 if ScoreKill = 2 && maxMultiScoreInterval <=3 ; client.player.clientPlaySound(sound'femdoublekill', , true);
break;
case 2 if Scorekill = 3 && maxMultiScoreInterval <=3  client.player.clientPlaySound(sound'killingspree', , true);
break;
case 3 if Scorekill = 4 && maxMultiScoreInterval <=3 ;client.player.clientPlaySound(sound'femmultikill', , true);
break;
case 4 if Scorekill = 5 && maxMultiScoreInterval <=3 ;client.player.clientPlaySound(sound'bmegakill', , true);
break;
case 5 if Scorekill = 6 && maxMultiScoreInterval <=3 ;client.player.clientPlaySound(sound'femultra', , true);
break;
case 6 if Scorekill = 7 && maxMultiScoreInterval <=3 ;client.player.clientPlaySound(sound'femmonsterkill', , true);
break;
case 7 if Scorekill = 8 && maxMultiScoreInterval <=3 ;client.player.clientPlaySound(sound'bludicrouskill', , true);
break;
case 8 if Scorekill =>9 & >=39 && maxMultiScoreInterval <=3 ;client.player.clientPlaySound(sound'bholyshit', , true);
break;
case 9 if Scorekill =>40 & >=49 && maxMultiScoreInterval <=3 ; client.player.clientPlaySound(sound'bdominating', , true);
break;
case 10 if Scorekill =50 && maxMultiScoreInterval <=3 ;  client.player.clientPlaySound(sound'femwicked', , true);
break;

}

}

Function color getMKColor ( byte DrawColor, int value){

if( case1) { return DrawColor=0 }
else
if( case2) {return DrawColor=1  }
else
if (case3) { return DrawColor=2  }
else
if (case4) { return DrawColor=3  }
else
if (case5) { return DrawColor=4  }
else
if (case6) { return DrawColor=5  }
else
if (case7) { return DrawColor=6  }
else
if (case8) { return DrawColor=7  }
else
if (case9) { return DrawColor=8  }
else
if (case10) { return DrawColor=9  }
else {
Return None}
}


defaultproperties
{
    YPos=196.00
    bCenter=True
    DoubleKillString="Double Kill!"
    TripleKillString="Triple Kill!"
    MultiKillString="Multi Kill!"
    Megakillstring=" Mega  Kill !"
    UltraKillString="ULTRA KILL!!"
    MonsterKillString="M O N S T E R  K I L L !!!"
    Ludicrouskillstring" L U D I C R O U S  K I L L !!!!"
    HolyShitString"H  O  L  Y   S  H  I  T !!!!!!!"
    IsStillGoingstring" Is Still GOING.."
    cheaterstring"Should get a Ban!:D"
    DrawColor=(0)=(R=255,G=255,B=0, A=0),
    DrawColor=(1)=(R=255,G=215,B=0, A=0),
    DrawColor=(2)=(R=255,G=165,B=0,A=0),
    DrawColor=(3)=(R=255,G=140,B=0,A=0),
    DrawColor=(4)=(R=255,G=69,B=0,A=0),
    DrawColor=(5)=(R=220,G=20,B=60,,A=0),
    DrawColor=(6)=(R=255,G=105,B=180,A=0,
    DrawColor=(7)=(R=255,G=0,B=255,A=0),
    DrawColor=(8)=(R=128,G=0,B=128,A=0),
    DrawColor=(9)=(R=32,G=178 B=170,A=0),
   

}
ok i have try to do somme modifications or change operator : but the error stay! :facepalm:

i'm lost there.

Code: Select all

 

var int DrawMKColor[10];
var byte Scorekill;
var float maxMultiScoreInterval;

Function  color getMKColor ( byte scorekill,  float maxMultiScoreInterval, int DrawMKColor){

if (scorkill ==2) & (maxMultiScoreInterval <=3); (return DrawMKColor(0));
else
if (scorkill ==3) & (maxMultiScoreInterval <=3); (return DrawMKColor(1));
else
if (scorkill ==4) & (maxMultiScoreInterval <=3); (return DrawMKColor(2));
else
if (scorkill ==5) & (maxMultiScoreInterval <=3); (return DrawMKColor(3));
else
if (scorkill ==6) & (maxMultiScoreInterval <=3); ( return DrawMKColor(4));
else
if (scorkill ==7) & (maxMultiScoreInterval <=3); ( return DrawMKColor(5));
else
if (scorkill ==8) & (maxMultiScoreInterval <=3); ( (return DrawMKColor(6));
else
if (scorkill >=9 &<=39)& (maxMultiScoreInterval <=3);  (return DrawMKColor(7));
else
if (scorkill >=40 & <=49) & (maxMultiScoreInterval <=3);(return DrawMKColor(8));
else
if (scorkill =50) & (maxMultiScoreInterval <=3);  (return DrawMKColor(9));
else 
(Return"none");
}

Last edited by Letylove49 on Thu Nov 24, 2022 11:33 am, edited 6 times in total.
<[MHA]>Letylove49 aka -=]UK[=-Shado

User avatar
Barbie
Godlike
Posts: 2479
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by Barbie » Sat Oct 29, 2022 10:20 am

var byte Scorekill;

if (scorkill ==2
:wth:
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

Re: Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by Letylove49 » Sat Oct 29, 2022 10:39 am

youre right i never thinkingto check this mistake .. thanks
<[MHA]>Letylove49 aka -=]UK[=-Shado

User avatar
sektor2111
Godlike
Posts: 6030
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by sektor2111 » Sat Oct 29, 2022 1:55 pm

It would be really wise to study some syntax about writing UScript first... just saying in friendly format...
Because I have to ask about these...

Code: Select all

if( case1) { return DrawMKColor=0 }
else
if( case2) {return DrawMKColor=1  }
else
I don't get these, perhaps compiler is also clueless what is all about.

Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

Re: Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by Letylove49 » Sat Oct 29, 2022 11:22 pm

ok for each Multikill Message i want to attibut a specific color :


here the message string :

Code: Select all

 DoubleKillString="Double Kill!"
    TripleKillString="Triple Kill!"
    MultiKillString="Multi Kill!"
    Megakillstring=" Mega  Kill !"
    UltraKillString="ULTRA KILL!!"
    MonsterKillString="M O N S T E R  K I L L !!!"
    Ludicrouskillstring" L U D I C R O U S  K I L L !!!!"
    HolyShitString"H  O  L  Y   S  H  I  T !!!!!!!"
    IsStillGoingstring" Is Still GOING.."
    cheaterstring"Should get a Ban!:D" 
here the color Name:

Code: Select all

 const C_YELLOW = 0;
const C_YELLOWDARK = 1;
const C_ORANGE	=  2; 		
const C_ORANGEDARK = 3;
const C_RED = 4;
const C_REDDARK = 5;
const C_PINKC = 6;
const C_PINK = 7;
const C_PURPLE = 8;
const C_GREEN = 9;	


here the color RGB

Code: Select all

 
     DrawMKColor(0)=(R=255,G=255,B=0, A=0),
    DrawMKColor(1)=(R=255,G=215,B=0, A=0),
    DrawMKColor(2)=(R=255,G=165,B=0,A=0),
    DrawMKColor(3)=(R=255,G=140,B=0,A=0),
    DrawMKColor(4)=(R=255,G=69,B=0,A=0),
    DrawMKColor(5)=(R=220,G=20,B=60,,A=0),
    DrawMKColor(6)=(R=255,G=105,B=180,A=0,
    DrawMKColor(7)=(R=255,G=0,B=255,A=0),
    DrawMKColor(8)=(R=128,G=0,B=128,A=0),
    DrawMKColor(9)=(R=32,G=178 B=170,A=0),
    
       
<[MHA]>Letylove49 aka -=]UK[=-Shado

User avatar
Barbie
Godlike
Posts: 2479
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by Barbie » Sun Oct 30, 2022 12:03 am

YouNeedGlasses.jpg
You do not have the required permissions to view the files attached to this post.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett

Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

Re: Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by Letylove49 » Sun Oct 30, 2022 2:48 am

Barbie wrote:
Sun Oct 30, 2022 12:03 am
YouNeedGlasses.jpg
ok this is now corrected

Code: Select all

 rawMKColor(0)=(R=255,G=255,B=0, A=0),
    DrawMKColor(1)=(R=255,G=215,B=0, A=0),
    DrawMKColor(2)=(R=255,G=165,B=0,A=0),
    DrawMKColor(3)=(R=255,G=140,B=0,A=0),
    DrawMKColor(4)=(R=255,G=69,B=0,A=0),
    DrawMKColor(5)=(R=220,G=20,B=60,A=0),
    DrawMKColor(6)=(R=255,G=105,B=180,A=0,
    DrawMKColor(7)=(R=255,G=0,B=255,A=0),
    DrawMKColor(8)=(R=128,G=0,B=128,A=0),
    DrawMKColor(9)=(R=32,G=178, B=170,A=0),

and now i got Error in NXPMultikillMessage.uc (157):Unexpected {.

Code: Select all

  
Static Function int getDrawMKColor( int DrawMKColor);

{

if(Case1) {return DrawMKColor=0}
else
if (Case2) {return DrawMKColor=1}
else
if(Case3) {return DrawMKColor=2}
else
if(Case4) {return DrawMKColor=3}
else
if(Case5) {return DrawMKColor=4}
else
if(Case6) {return DrawMKColor=5}
else
if(case7) {return DrawMKColor=6}
else 
if(Case8) {return DrawMKColor=7}
else
if(Case9) {return DrawMKColor=8}
else
if(case10){ return DrawMKColor=9}

}
if remove { } i ot a unexpeted if
<[MHA]>Letylove49 aka -=]UK[=-Shado

Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

Re: Neep Help to make a Multikillmessage Type mismatch in parameter 1

Post by Letylove49 » Mon Oct 31, 2022 3:12 pm

i got : Log: Compiling NXPClient
Error: C:\UT coding\UnrealTournament\Nexgenplus100SDLx\Classes\NXPClient.uc(834) : Error, Call to 'format': type mismatch in parameter 1

what is mismatch ? cheaterMessage???

Code: Select all

 

/***************************************************************************************************
 *
 *  $DESCRIPTION  Broadcasts a multi kill to all players.
 *
 **************************************************************************************************/
function broadcastMultiKill(int type, string playerName) {
  local string msg;
 

 
if(type < 1) return;

  if (type == 15) {
			msg = class'NexgenUtil'.static.format(default.cheaterMessage, pri1.playerName);
  } else if (type > arrayCount(multiKillMessage)) {
    msg = class'NexgenUtil'.static.format(multiKillMessage[arrayCount(multiKillMessage) - 1], playerName);
  } else {
    msg = class'NexgenUtil'.static.format(multiKillMessage[type - 1], playerName);
  }
  
  if(msg != "") control.broadcastMsg(msg);
}



/***************************************************************************************************
 *
 *  $DESCRIPTION  Default properties block.
 *
 **************************************************************************************************/

defaultproperties
{   
multiKillMessage[0]"<C03>%1 had a Double Kill!."
multiKillMessage[1]"<C11>%1 had a Triple Kill!"
multiKillMessage[2]"<C09>%1 had a Multi Kill!"
multiKillMessage[3]"C12>%1 had a Mega Kill!"
multiKillMessage[4]"<C00>%1 had a ULTRA KILL!!!!!"
multiKillMessage[5]"<C10>%1 had a M O N S T E R  K I L L !!!"
multiKillMessage[6]"<C13>%1 had a L U D I C R O U S  K I L L !!!!"
multiKillMessage[7]"<C06>%1 had a H  O  L  Y   S  H  I  T !!!!!!!"
multiKillMessage[8]"<C14>%1 had a Is Still GOING..."
cheaterMessage="<C15>%1 should get a Ban! :D"


    ctrlID="NexgenPlusClient"
    bCanModifyHUDStatePanel=True
}

Here the revrited NXPMultikillMessage:

Code: Select all

 class NXPMultiKillMessage  extends MultiKillMessage;

// Sound for Multikill Message.
#exec AUDIO IMPORT FILE="Sound\bdominating.wav" NAME="bdominating"
#exec AUDIO IMPORT FILE="Sound\killingspree.wav" NAME="killingspree"
#exec AUDIO IMPORT FILE="Sound\bholyshit.wav" NAME="bholyshit"
#exec AUDIO IMPORT FILE="Sound\bludicrousKill.WAV" NAME="bludicrouskill"
#exec AUDIO IMPORT FILE="Sound\bmegakill.wav" NAME="bmegakill"
#exec AUDIO IMPORT FILE="Sound\femdoublekill.wav" NAME="femdoublekill"
#exec AUDIO IMPORT FILE="Sound\femmultikill.wav" NAME="femmultikill"
#exec AUDIO IMPORT FILE="Sound\femultra.wav" NAME="femultra"
#exec AUDIO IMPORT FILE="Sound\femmonsterkill.wav" NAME="femmonsterkill"
#exec AUDIO IMPORT FILE="Sound\femwicked.wav" NAME="femwicked"

// Multikill Messages
var localized string  Doublekillstring;       
var localized string  Triplekillstring;             
var localized string  Multikillstring;
var localized string  Megakillstring;
var localized string  Ultrakillstring;
var localized string  MonsterKillstring;
var localized string  Ludikrouskillstring;
var localized string  HolyShitString;
var localized string  IsStillGoingstring;
var localized string  cheaterstring;

var localized string MultikillMessage[9];
var localized string CheaterMessage;

var byte Scorekill;
var float maxMultiScoreInterval;



static function float GetOffset(int Switch, float YL, float ClipY )
{
   return (Default.YPos/768.0) * ClipY + YL;
}

static function int GetFontSize( int Switch )
{
   if ( Switch == 1 )
      return Default.FontSize;
   else
      return 2;
}


static function string GetString(
        optional int Switch,
	optional PlayerReplicationInfo RelatedPRI_1,
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject)
{

	switch (Switch)
	{



Case 1:  Return("<C03> DOUBLE KILL");
break;
case 2: Return("<C11> TRIPLE KILL");
break;
case 3: Return("<C09> MULTI KILL");
break;
case 4: Return("<C12> MEGA KILL");
break;
case 5: Return("<C00> ULTRA KILL");
break;
case 6: Return("<C10> MONSTER KILL");
break;
case 7: Return("<C13> LUDICROUS KILL");
break;
case 8 :Return("<C06>  H  O  L  Y   S  H  I  T !!!!!!!");
break;
case 9: Return ("<C14> Is Still GOING");
break;
case 10:Return("<C15> Should get a Ban!:D ");
break;
}
return "";

}

static simulated function ClientReceive( 
	PlayerPawn P,
	optional int Switch,
	optional PlayerReplicationInfo RelatedPRI_1, 
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject)

{

 local byte Scorkill;
local float maxMultiScoreInterval;

	Super.ClientReceive(P, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject);

	switch (Switch)
	{


Case 1: if(FRand() < 0.3)
P.ClientPlaySound(sound'femdoublekill', , true);
break;
case 2: if(FRand() < 0.3)
P.ClientPlaySound(sound'killingspree', , true);
break;
case 3: if(FRand() < 0.3)
P.ClientPlaySound(sound'femmultikill', , true);
break;
case 4: if(FRand() < 0.3)
P.ClientPlaySound(sound'bmegakill', , true);
break;
case 5: if(FRand() < 0.3)
P.ClientPlaySound(sound'femultra', , true);
break;
case 6: if(FRand() < 0.3)
P.ClientPlaySound(sound'femmonsterkill', , true);
break;
case 7: if(FRand() < 0.3)
P.ClientPlaySound(sound'bludicrouskill', , true);
break;
case 8: if(FRand() < 0.3)
P.ClientPlaySound(sound'bholyshit', , true);
break;
case 9: if(FRand() < 0.1)
P.ClientPlaySound(sound'bdominating', , true);
break;
case 10: if(FRand() < 0.1)
P.ClientPlaySound(sound'femwicked', , true);
break;

}

}





defaultproperties
{
   FontSize=1
    bIsSpecial=True
    bIsUnique=True
    bFadeMessage=True
    YPos=196.00
    bCenter=True
    DoubleKillString="Double Kill!"
    TripleKillString="Triple Kill!"
    MultiKillString="Multi Kill!"
    Megakillstring=" Mega  Kill !"
    UltraKillString="ULTRA KILL!!"
    MonsterKillString="M O N S T E R  K I L L !!!"
    Ludicrouskillstring" L U D I C R O U S  K I L L !!!!"
    HolyShitString"H  O  L  Y   S  H  I  T !!!!!!!"
    IsStillGoingstring" Is Still GOING.."
    cheaterstring"Should get a Ban!:D"
    MultiKillMessage[0]"<C03>%1 had a Double Kill!."
    MultiKillMessage[1]"<C11>%1 had a Triple Kill!"
    MultiKillMessage[2]"<C09>%1 had a Multi Kill!"
    MultiKillMessage[3]"C12>%1 had a Mega Kill!"
    MultiKillMessage[4]"<C00>%1 had a ULTRA KILL!!!!!"
    MultiKillMessage[5]"<C10>%1 had a M O N S T E R  K I L L !!!"
    MultiKillMessage[6]"<C13>%1 had a L U D I C R O U S  K I L L !!!!"
    MultiKillMessage[7]"<C06>%1 had a H  O  L  Y   S  H  I  T !!!!!!!"
    MultiKillMessage[8]"<C14>%1 had a Is Still GOING..."
    CheaterMessage "<C15>%1 Should get a Ban!:D"
   

}
Last edited by Letylove49 on Mon Oct 31, 2022 5:52 pm, edited 5 times in total.
<[MHA]>Letylove49 aka -=]UK[=-Shado

User avatar
sektor2111
Godlike
Posts: 6030
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by sektor2111 » Mon Oct 31, 2022 4:00 pm

Can you figure out that after each line executing something behind a condition it's needed ; ?
It's not really about brackets, it's about internal execution which must be followed by a termination and not just ENTER a new script line.
All I have to say is to check some stock codes and compare them with your supposed codes... Let's see some fake snippet.

Code: Select all

if ( A.bIsPawn )
{
	Pawn(A).Enemy = None;
}
Now just look at that condition and execution from brackets. It's not like you have such things.

Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

Re: Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by Letylove49 » Mon Oct 31, 2022 5:45 pm

now i got this : Error: C:\UT coding\UnrealTournament\Nexgenplus100SDLx\Classes\NXPClient.uc(828) : Error, Call to 'format': Bad expression or missing ')'

i don't see any missing ")"
"CheaterMessage" come from NXPClient.uc is "default" whi is wrong ?

Code: Select all

   if (type == 15) {
			msg = class'NexgenUtil'.static.format(default.cheaterMessage, pri1.playerName);
  }
i don't know if that could help but i put it (value on NXPLang:

Code: Select all

 const DoubleKillMsg    = "<C03>%1 had a Double Kill!";
Const TripleKillMsg    = "<C11>%1 had a Triple Kill!"; 
const MultiKillMsg     = "<C09>%1 had a Multi Kill!";
const MegakillMsg      = "<C12>%1 had a Mega Kill!";
const UltraKillMsg     = "<C00>%1 had a ULTRA KILL!!!!!";
const MonsterKillMsg   = "<C10>%1 had a M O N S T E R  K I L L !!!";
const LudicrouskillMsg = "<C13>%1 had a L U D I C R O U S  K I L L !!!!";
const HolyShitsMsg     = "<C06>%1 had a H  O  L  Y   S  H  I  T !!!!!!!";
Const ISStillGoingMsg  = "<C14>%1 had a Is Still GOING...";
Const cheaterMsg       = "<C15>%1 should get a Ban! :D";
<[MHA]>Letylove49 aka -=]UK[=-Shado

User avatar
sektor2111
Godlike
Posts: 6030
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by sektor2111 » Mon Oct 31, 2022 9:55 pm

bad expresion OR missing ')'. This is a dual message due to some compiling errors - technically it's ONE of them.
My question is: Who is "Pril.playerName" ?

Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

Re: Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by Letylove49 » Mon Oct 31, 2022 11:38 pm

sektor2111 wrote:
Mon Oct 31, 2022 9:55 pm
bad expresion OR missing ')'. This is a dual message due to some compiling errors - technically it's ONE of them.
My question is: Who is "Pril.playerName" ?
a plyayer who make 15 killl in 3 sec max = CheaterMessage,

now i have replace Pri.playerName by , playerName) and that work. Thanks
<[MHA]>Letylove49 aka -=]UK[=-Shado

Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

i'm able to compile but the multikill message doesnt' work.

Post by Letylove49 » Fri Nov 04, 2022 4:00 pm

Ok now im'' able to compile but that doesn't work like expected the multikill messages are not displayed ..

What i have forgot to add tha make this working ?? Someone could please give me a idea ??

const maxMultiScoreInterval = 3.0;

The class with the multikillmessages:

Code: Select all

 class NXPMultiKillMessage  extends LocalMessagePlus;

// Sound for Multikill Message.

#exec AUDIO IMPORT FILE="Sound\bdominating.wav" NAME="bdominating"
#exec AUDIO IMPORT FILE="Sound\killingspree.wav" NAME="killingspree"
#exec AUDIO IMPORT FILE="Sound\bholyshit.wav" NAME="bholyshit"
#exec AUDIO IMPORT FILE="Sound\bludicrousKill.WAV" NAME="bludicrouskill"
#exec AUDIO IMPORT FILE="Sound\bmegakill.wav" NAME="bmegakill"
#exec AUDIO IMPORT FILE="Sound\femdoublekill.wav" NAME="femdoublekill"
#exec AUDIO IMPORT FILE="Sound\femmultikill.wav" NAME="femmultikill"
#exec AUDIO IMPORT FILE="Sound\femultra.wav" NAME="femultra"
#exec AUDIO IMPORT FILE="Sound\femmonsterkill.wav" NAME="femmonsterkill"
#exec AUDIO IMPORT FILE="Sound\femwicked.wav" NAME="femwicked"

// Multikill Messages.
var localized string  Doublekillstring;       
var localized string  Triplekillstring;             
var localized string  Multikillstring;
var localized string  Megakillstring;
var localized string  Ultrakillstring;
var localized string  MonsterKillstring;
var localized string  Ludikrouskillstring;
var localized string  HolyShitString;
var localized string  IsStillGoingstring;
var localized string  cheaterstring;

var localized string MultikillMessage[9];
var localized string CheaterMessage;




static function float GetOffset(int Switch, float YL, float ClipY )
{
   return (Default.YPos/768.0) * ClipY + YL;
}

static function int GetFontSize( int Switch )
{
   if ( Switch == 1 )
      return Default.FontSize;
   else
      return 2;
}


// <Cxx> = Color of the message.

static function string GetString(
        optional int Switch,
	optional PlayerReplicationInfo RelatedPRI_1,
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject)
{

	switch (Switch)
	{

case 0:  return "";
break;
Case 1:  Return("<C03> default.DoubleKillString");
break;
case 2: Return("<C11>  default.TripleKillString");
break;
case 3: Return("<C09> default.MultiKillString");
break;
case 4: Return("<C12> default.Megakillstring");
break;
case 5: Return("<C00> default.UltraKillString");
break;
case 6: Return("<C10> default.MonsterKillString");
break;
case 7: Return("<C13> default.Ludicrouskillstring");
break;
case 8 :Return("<C06>  default.HolyShitString");
break;
case 9: Return ("<C14> default.IsStillGoingstring");
 break;
case 10:Return("<C15> default.cheaterstring");
break;


}


}

static function string GetBroadcastString( int MultiLevel )
{
  if( MultiLevel == 10 ) return "had an" @ static.GetString( MultiLevel );
  else return "had a" @  static.GetString( MultiLevel );
}

static simulated function ClientReceive( 
	PlayerPawn P,
	optional int Switch,
	optional PlayerReplicationInfo RelatedPRI_1, 
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject)

{

 local byte Scorkill;
local float maxMultiScoreInterval;

	Super.ClientReceive(P, Switch, RelatedPRI_1, RelatedPRI_2, OptionalObject);

	switch (Switch)
	{


Case 1: if(FRand() < 0.3)
P.ClientPlaySound(sound'femdoublekill', , true);
break;
case 2: if(FRand() < 0.3)
P.ClientPlaySound(sound'killingspree', , true);
break;
case 3: if(FRand() < 0.3)
P.ClientPlaySound(sound'femmultikill', , true);
break;
case 4: if(FRand() < 0.3)
P.ClientPlaySound(sound'bmegakill', , true);
break;
case 5: if(FRand() < 0.3)
P.ClientPlaySound(sound'femultra', , true);
break;
case 6: if(FRand() < 0.3)
P.ClientPlaySound(sound'femmonsterkill', , true);
break;
case 7: if(FRand() < 0.3)
P.ClientPlaySound(sound'bludicrouskill', , true);
break;
case 8: if(FRand() < 0.3)
P.ClientPlaySound(sound'bholyshit', , true);
break;
case 9: if(FRand() < 0.1)
P.ClientPlaySound(sound'bdominating', , true);
break;
case 10: if(FRand() < 0.1)
P.ClientPlaySound(sound'femwicked', , true);
break;

}

}






defaultproperties
{
   FontSize=1
    bIsSpecial=True
    bIsUnique=True
    bFadeMessage=True
    YPos=196.00
    bCenter=True
    DoubleKillString="Double Kill!"
    TripleKillString="Triple Kill!"
    MultiKillString="Multi Kill!"
    Megakillstring="Mega  Kill !"
    UltraKillString="ULTRA KILL!!"
    MonsterKillString="M O N S T E R  K I L L !!!"
    Ludicrouskillstring"L U D I C R O U S  K I L L !!!!"
    HolyShitString"H  O  L  Y   S  H  I  T !!!!!!!"
    IsStillGoingstring"Is Still GOING.."
    cheaterstring"Should get a Ban!:D"
    MultiKillMessage[0]"<C03>%1 had a Double Kill!."
    MultiKillMessage[1]"<C11>%1 had a Triple Kill!"
    MultiKillMessage[2]"<C09>%1 had a Multi Kill!"
    MultiKillMessage[3]"C12>%1 had a Mega Kill!"
    MultiKillMessage[4]"<C00>%1 had a ULTRA KILL!!!!!"
    MultiKillMessage[5]"<C10>%1 had a M O N S T E R  K I L L !!!"
    MultiKillMessage[6]"<C13>%1 had a L U D I C R O U S  K I L L !!!!"
    MultiKillMessage[7]"<C06>%1 had a H  O  L  Y   S  H  I  T !!!!!!!"
    MultiKillMessage[8]"<C14>%1 had a Is Still GOING..."
    CheaterMessage "<C15>%1 Should get a Ban!:D"
    

  


the classe with the function : NXPClient.uc ( i have put only the function for the multikillMessage)

Code: Select all


the variable :
// Dynamic control info.
var bool bUseNexgenMultikillMessages;	            // Enable Nexgen Mutikill Message.

// Client side settings.
const SSTR_UseNexgenMultikillMessages = "UseNexgenMultikillMessages";    // Enable Nexgen Multikill Message.
// Client side settings default values.
const SSTRDV_UseNexgenMultikillMessages = "false";

//Messages
var localized string multiKillMessage[9];         // Multi kill message strings.
var localized string cheaterMessage;              // Message for extreme players.

//Clientside
var float lastKillTime;                           // Last time this player killed another player.
var int multiLevel;                               // Number of kills on a short time.

// Misc settings.
const maxMultiScoreInterval = 3.0;

/***************************************************************************************************
 *
 *  $DESCRIPTION  Called when a player was killed by another player.
 *  $PARAM        killer  The pawn that killed the other pawn. Might be none.
 *  $PARAM        victim  Pawn that was the victim.
 *
 **************************************************************************************************/
function scoreKill(Pawn killer, Pawn victim) {
	local NexgenClient client;
	local NXPClient xClient;
	
  if(bUseNexgenMultikillMessages==True);	
	
	if (killer != none && victim != none && killer != victim) {
		// Get extended client controller.
		client = control.getClient(killer);
		if (client != none) {
			xClient = NXPClient(client.getController(class'NXPClient'.default.ctrlID));
		}
		
		if (xClient != none) {
			// Check for double, triple, multi, ultra, monster, ludicrous kills, HolyShit,is still going!.
			if (level.timeSeconds - xClient.lastKillTime < maxMultiScoreInterval) {
				xClient.multiLevel++;
				level.game.broadcastLocalizedMessage(class'NXPMultiKillMessage', xClient.multiLevel, killer.playerReplicationInfo);
			} else {
				xClient.multiLevel = 0;
			}
			
			// Update last kill time.
			xClient.lastKillTime = level.timeSeconds;
		}
		
	}
}


/***************************************************************************************************
 *
 *  $DESCRIPTION  Broadcasts a multi kill to all players.
 *
 **************************************************************************************************/
function broadcastMultiKill(int type, string playerName) {
  local string msg;


  
  if(type < 1) return;

  if (type == 10) {
		msg = class'NexgenUtil'.static.format(cheaterMessage, playerName);
  } else if (type > arrayCount(multiKillMessage)) {
    msg = class'NexgenUtil'.static.format(multiKillMessage[arrayCount(multiKillMessage) - 1], playerName);
  } else {
    msg = class'NexgenUtil'.static.format(multiKillMessage[type - 1], playerName);
  }
  
  if(msg != "") control.broadcastMsg(msg);
}



<[MHA]>Letylove49 aka -=]UK[=-Shado

Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

Re: [abandonned for a better Project] Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by Letylove49 » Mon Nov 21, 2022 10:30 pm

After to have see that custum multikill was alos included on FNN i think my fisrt idead is unseles i't no necessary to have another custum multikill message on Nexgen.

Now i will make someting like to make colorised multikillmessage on Brocastmessage like player had " colored text¨] . aand this will no inclued on Nexgenplus because that will recquire to use mutator or mod and is not
a good idea to force a server admin to have this mutator if he don't use it. i don't have think about that.
<[MHA]>Letylove49 aka -=]UK[=-Shado

User avatar
asosed
Experienced
Posts: 109
Joined: Fri May 15, 2020 2:36 pm
Location: Russia

Re: [abandonned for a better Project] Neep Help to make a Multikillmessage for NexgenPlus Function GetMKcolor

Post by asosed » Tue Nov 22, 2022 7:21 am

Letylove49 wrote:
Mon Nov 21, 2022 10:30 pm
After to have see that custum multikill was alos included on FNN i think my fisrt idead is unseles i't no necessary to have another custum multikill message on Nexgen.

Now i will make someting like to make colorised multikillmessage on Brocastmessage like player had " colored text¨] . aand this will no inclued on Nexgenplus because that will recquire to use mutator or mod and is not
a good idea to force a server admin to have this mutator if he don't use it. i don't have think about that.
check this mod for broadcast classic multikill message
ServerPackages=MAmut
mutator=MAmut.MAmut
You do not have the required permissions to view the files attached to this post.
Image
Image
Image