Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Red Orchestra: Ostfront 41-45 Forums > Red Orchestra Modifications > Coding

Reply
 
Thread Tools Display Modes
  #1  
Old 10-17-2009, 08:43 AM
O'Shannon's Avatar
O'Shannon O'Shannon is offline
Senior Member
 
Join Date: Oct 2006
Location: Germany
Posts: 388
Default BroadcastLocalizedMessage

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
}
__________________
Soon
VERY soon

Last edited by O'Shannon; 10-17-2009 at 10:14 AM.
Reply With Quote
  #2  
Old 10-17-2009, 07:44 PM
worluk's Avatar
worluk worluk is offline
Senior Member
 
Join Date: Nov 2005
Posts: 2,217
Default

Hard way: If it works offline and not online => http://wiki.beyondunreal.com/Introdu...to_replication

Easier way: You subclassed the wrong message class.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:51 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC