i have almost done my first plugin but that don't work like expected.
the multikill message are displayed twice like on this sceenshot :
How i can fixe that ?
the code come from MH2Gold for the function that i show to you.
Code: Select all
function CheckBroadCast(Pawn Killer,int num)
{
if(Killer.bIsPlayer && !Killer.PlayerReplicationInfo.bIsABot)
BroadCastMessage(Killer.PlayerReplicationInfo.PlayerName@GetText(num));
}
2nd prioblem with Holyshit message displayed only 1 time is now solved:
i have put a if functon in the code for that.
Code: Select all
/***************************************************************************************************
*
* $DESCRIPTION Creates the string for this localized message.
* $PARAM switch Optional message switch.
* $PARAM pri1 Replication info of the first player involved with the message.
* $PARAM pri1 Replication info of the second player involved with the message.
* $PARAM optionalObject Extra object related to the message.
* $RETURN The message string.
*
**************************************************************************************************/
static function string getString(optional int switch, optional PlayerReplicationInfo pri1,
optional PlayerReplicationInfo pri2, optional Object optionalObject) {
local string msg;
if (pri1 != none) {
if (1 <= switch) {
if (switch == 50) {
msg = class'NexgenUtil'.static.format(default.cheaterMessage, pri1.playerName);;
} else if (switch >= 40) {
msg = class'NexgenUtil'.static.format(default.StillgoingMessage, pri1.playerName);;
} else if (switch > arrayCount(default.multiKillMessage)) {
msg = class'NexgenUtil'.static.format(default.multiKillMessage[arrayCount(default.multiKillMessage) - 1], pri1.playerName);
} else {
msg = class'NexgenUtil'.static.format(default.multiKillMessage[switch - 1], pri1.playerName);
}
}
}
return msg;
}
/***************************************************************************************************
*
* $DESCRIPTION Default properties block.
*
**************************************************************************************************/
defaultproperties
{
multiKillMessage(0)="<C03>%1 has Double Kill!"
multiKillMessage(1)="<C09>%1 has Multi Kill!"
multiKillMessage(2)="<C12>%1 has Mega Kill!"
multiKillMessage(3)="<C00>%1 has ULTRA KILL!!"
multiKillMessage(4)="<C10>%1 has M O N S T E R K I L L !!!"
multiKillMessage(5)="<C13>%1 has L U D I C R O U S K I L L !!!!"
multiKillMessage(6)="<C06>%1 has H O L Y S H I T !!!!!!!"
StillgoingMessage="<C14>%1 is still going.... !!!!!!!!!!!"
cheaterMessage="<C15> Someone better be checking %1 for cheats!"
}