Need help -> BroadcastLocalizedMessage

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/
  • Weve updated the Tripwire Privacy Notice under our Policies to be clearer about our use of customer information to come in line with the EU General Data Protection Regulation (GDPR) rules that come into force today (25th May 2018). The following are highlights of our changes:


    We've incorporated the relevant concepts from the GDPR including joining the EU and Swiss Privacy Shield framework. We've added explanations for why and how Tripwire processes customer data and the types of data that we process, as well as information about your data protection rights.



    For more information about our privacy practices, please review the new Privacy Policy found here: https://tripwireinteractive.com/#/privacy-notice

O'Shannon

FNG / Fresh Meat
Oct 18, 2006
388
90
0
Germany
OK, first off... i am a total scripting-noob....

first i made myself some new rifles( rifles with only 2 clips, for my funmap) after i watched some scripting tuts on 3dbuzz.... and they work!!!

then i thought, you shouldn't be allowed to use ironsights ....haxxed some stuff together ... and it worked(still dont know if my way off removing the ironsights is the right one).

then i thought; man.. would be cool if there would be a message if someone tries to use Ironsights...watch though some classes to figure out how the "PLAYER left the battlefield" message works.... hacked stuff together again and : as soon as i tried to use ironsight a "O'Shannon tried to use Ironsights" messages poped up...

so far so good...

then i tried this on a dedicated server... and nothing is happening....
no massage is poping up but the logMessage still is...

please enlightened me with your scripting skills...why is it not working online but offline.. WHY?????? WHY?????

Kar981Clip.uc
Code:
//=============================================================================
// Kar98k with 2 Clips
//=============================================================================
// Weapon class for the German Karbiner 98k bolt action rifle with only two clip at spawn
//=============================================================================
class Kar981Clip extends Kar98Weapon;

simulated function ROIronSights()
{
   BroadcastLocalizedMessage(Class'NoIronsightsMessage', 1337, Instigator.Controller.PlayerReplicationInfo, none, Class'Kar981Clip');
   log('Disabled ironsights');
}

defaultproperties
{
    InitialNumPrimaryMags=2
	MaxNumPrimaryMags=2
    PickupClass=class'Kar981ClipPickup'
    AttachmentClass=class'Kar981ClipAttachment'
}



NoIronsightsMessage.uc
Code:
//=============================================================================
// NoIronsightsMessage
//=============================================================================
// works offline(kind of) but won't work online
//=============================================================================

class NoIronsightsMessage extends ROGameMessage;

//=============================================================================
// Variables
//=============================================================================

var(Message) localized string NoIronsightsHere;
var(Message) localized string TriedToUseIronsights;

//=============================================================================
// Functions
//=============================================================================

static function string GetString(
    optional int Switch,
    optional PlayerReplicationInfo RelatedPRI_1,
    optional PlayerReplicationInfo RelatedPRI_2,
    optional Object OptionalObject
    )
{
    switch (Switch)
    {
        case 1337:
            if (RelatedPRI_1 == none)
                return Default.NoIronsightsHere;

            return (RelatedPRI_1.PlayerName$Default.TriedToUseIronsights);
            break;
    }
    return "";
}

defaultproperties
{
	NoIronsightsHere="no ironsights here, n00b!!!"
	TriedToUseIronsights=" tried to use Ironsights. what a noob."
	bIsSpecial=false
}
 
Last edited: