AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Change sky during gameplay, MOTD Stats (https://forums.alliedmods.net/showthread.php?t=309481)

edon1337 07-27-2018 18:24

Change sky during gameplay, MOTD Stats
 
Is it possible to change the sky during game play or on new round? I read here that only the players that would connect after the sky has changed would be able to see it, by any chance I could make the other players see it too?

Something else I wanted to ask, is this a correct way of displaying data inside variable to MOTD? I'm unable to test.

PHP Code:

    new szMotdInfo256 ], szName32 ];
    
get_user_nameidszNamecharsmaxszName ) );

    
formatexszMotdInfocharsmaxszMotdInfo ), "Player Name: %s \nKills: %d \nDamage: %.1f \nHeadshots: %d"szNameg_iPlayerStatsid ][ Player_Kills ], g_iPlayerStatsid ][ Player_Damage ], g_iPlayerStatsid ][ Player_HeadShots ] );
    
show_motdidszMotdInfo"Stats" ); 

Thanks!

SkumTomteN 07-28-2018 15:46

Re: Change sky during gameplay, MOTD Stats
 
1. Not possible to change sky without reconnecting, i think people have tried this alot of times, and ive never seen it done.
2. Whats the problem, that code looks fine.

HamletEagle 07-28-2018 16:08

Re: Change sky during gameplay, MOTD Stats
 
Maybe you can do something with SVC_NEWMOVEVARS, give it a try.

edon1337 07-28-2018 17:01

Re: Change sky during gameplay, MOTD Stats
 
Quote:

Originally Posted by HamletEagle (Post 2606678)
Maybe you can do something with SVC_NEWMOVEVARS, give it a try.

PHP Code:

Name:    SVC_NEWMOVEVARS
Structure
:    
float    Gravity
float    StopSpeed
float    MaxSpeed
float    SpectatorMaxSpeed
float    Accelerate
float    AirAccelerate
float    WaterAccelerate
float    Friction
float    EdgeFriction
float    WaterFriction
float    EntGravity
float    Bounce
float    StepSize
float    MaxVelocity
float    ZMax
float    WaveHeigth
byte    Footsteps
float    RollAngle
float    RollSpeed
float    SkyColorRed
float    SkyColorGreen
float    SkyColorBlue
float    SkyVecX
float    SkyVecY
float    SkyVecZ
string    SkyName 

Do I have to fill all of these when sending that message?

Quote:

Originally Posted by SkumTomteN (Post 2606666)
2. Whats the problem, that code looks fine.

Is it? I've never played with data being displayed on MOTD before, that's why I'm asking whether it is correct or not.

HamletEagle 07-29-2018 08:01

Re: Change sky during gameplay, MOTD Stats
 
Yes, but it's more complicated than just sending the message, as soon as a difference between server cvars and client movevars is detected the server will send another message to correct this.

What I managed to do is allow each player to have a different sky and set it without altering sv_skyname, but it still requires players to reconnect.
At this point I don't know if it's even possible to change the sky without reconnecting, I'll keep testing.

edon1337 07-29-2018 08:11

Re: Change sky during gameplay, MOTD Stats
 
Quote:

Originally Posted by HamletEagle (Post 2606779)
Yes, but it's more complicated than just sending the message, as soon as a difference between server cvars and client movevars is detected the server will send another message to correct this.

What I managed to do is allow each player to have a different sky and set it without altering sv_skyname, but it still requires players to reconnect.
At this point I don't know if it's even possible to change the sky without reconnecting, I'll keep testing.

I see there's no easy way in doing this, it isn't really necessary to be honest, I'll just skip it, thanks anyway!

BTW I tested the MOTD stats, and \n didn't work when trying to access a new line, what do I have to use?

HamletEagle 07-29-2018 08:15

Re: Change sky during gameplay, MOTD Stats
 
The ctrlchar by default is ^ for pawn, not \. Can be changed by using #pragma ctrlchar

edon1337 07-29-2018 08:17

Re: Change sky during gameplay, MOTD Stats
 
Quote:

Originally Posted by HamletEagle (Post 2606787)
The ctrlchar by default is ^ for pawn, not \. Can be changed by using #pragma ctrlchar

I thought I had to do it the way JavaScript does it (\n), anyway I used ^n but the entire stats are still in the same line.

OciXCrom 07-29-2018 08:52

Re: Change sky during gameplay, MOTD Stats
 
The MOTD window uses HTML, so use <br>.

edon1337 07-29-2018 08:56

Re: Change sky during gameplay, MOTD Stats
 
Quote:

Originally Posted by OciXCrom (Post 2606796)
The MOTD window uses HTML, so use <br>.

Thought so, I was confused whether I had to apply Pawn code or HTML inside the 2nd parameter, am I able to change font color, size, style and add headers inside that 2nd parameter?

So something like this
PHP Code:

new szBuffer256 ];
formatexszBuffercharsmaxszBuffer ), "<h1><font color="green">Hello!</font></h1>" );

show_motdidszBuffer ); 



All times are GMT -4. The time now is 17:28.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.