Welcome to Open Carnage

A resource for gamers and technology enthusiasts, with unique means of rewarding content creation and support. Have a wander to see why we're worth the time!

Weyland

cprint

Hi,

 

I'm trying to modify H® Shaft's Death Messages V6 for an MD/PC server https://pastebin.com/hj6hiEqq

I have most of the JPT! tags working for the map I'm hosting (although getting the rocket truck, rocket launcher, falcon rockets and mortargoose rockets on Bigass Final to work will be interesting), but the original script announces messages with a 'say' so they get a prefix, which makes them noisier/busier than I'd like.


I have the msg_prefix and admin_prefix varied to something else already and don't want to change those, and disabling the say_prefix is for CE only, so what I want to do is change the script to announce messages with 'cprint' instead.

 

But I'm struggling to figure out the correct (or a correct) way of expressing it. And wondering if maybe cprint won't even work as it only accepts the string message?

I got rprint working ok - as it takes the string message and the PlayerIndex, but player feedback was they wanted them in the console like normal.


For example, currently the script has -

elseif last_damage[PlayerIndex] == tank_shell then
execute_command('say * "$name was killed by $kname\'s Scorpion."', PlayerIndex)

 

 

and this is where I'm at with trying to get cprint working instead -

elseif last_damage[PlayerIndex] == tank_shell then
cprint("$name was killed by $kname\'s Scorpion"), PlayerIndex))	

 

But yeah, no dice and I'm fumbling around in the dark as per - I'm sure someone here can put me straight in a heartbeat.

Thanks.
 

Edited by Weyland

Share this post


Link to post
Share on other sites

"Cprint" only prints the message to the server's console. I guess what you want to do is displaying the messages in the chat but without the server's prefix, if that's the case I think you could change the server's prefix to an empty string every time a death message is about to be displayed and then change it back to its default value. Something like this:

 

elseif last_damage[PlayerIndex] == tank_shell then
    msg_prefix("") -- If not possible, you could try using " " instead, or a small character.
    say_all("$name was killed by $kname\'s Scorpion"), PlayerIndex))
    msg_prefix("[Your default server's prefix]")

 

Anyway, I only mod CE so I may be missing something. Hope this helps!

Weyland likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.