Tell me what's wrong

Ằʑyɱổĸ☏ ✈ 2

New Member
Member
Jul 24, 2016
13
1
3
28
Parts Unknown
Tell me what's wrong

Code:
text.NewText = text.OriginalMessage;
            Server.GetServer().BroadcastFrom("[" + PlayerPrefix + "] " + player.Name, text.NewText);
But the message is written in "" - how to remove them?
 
Last edited:

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Tell me what's wrong

Code:
text.NewText = text.OriginalMessage;
            Server.GetServer().BroadcastFrom("[" + PlayerPrefix + "] " + player.Name, text.NewText);
But the message is written in "" - how to remove them?
C#:
text = text.OriginalMessage.Trim('"');
Server.GetServer().BroadcastFrom("[" + PlayerPrefix + "] " + player.Name, text);
 

Ằʑyɱổĸ☏ ✈ 2

New Member
Member
Jul 24, 2016
13
1
3
28
Parts Unknown
C#:
text = text.OriginalMessage.Trim('"');
Server.GetServer().BroadcastFrom("[" + PlayerPrefix + "] " + player.Name, text);
Thank you - collect your build server and I am very hated these "" :(

Безымянный.png

Can tell me how the message text with variables to put in the ini?To give the ability to edit the message text , without touching the dll file so to speak
 
Last edited:

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Thank you - collect your build server and I am very hated these "" :(

View attachment 1567

Can tell me how the message text with variables to put in the ini?To give the ability to edit the message text , without touching the dll file so to speak
C#:
string prefix = "[Text Blah]"
string color = "[color red]"
text = text.ToString().Trim('"');
Server.GetServer().BroadcastFrom(prefix + " " + player.Name,  color + text);
text.NewText = "*%"; // Stops the users message
//text.NewText = "         "; Does the same
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
C#:
string prefix = "[Text Blah]"
string color = "[color red]"
text = text.ToString().Trim('"');
Server.GetServer().BroadcastFrom(prefix + " " + player.Name,  color + text);
text.NewText = "*%"; // Stops the users message
//text.NewText = "         "; Does the same
Use OriginalMessage.

text.NewText = "";
 

Ằʑyɱổĸ☏ ✈ 2

New Member
Member
Jul 24, 2016
13
1
3
28
Parts Unknown
C#:
string prefix = "[Text Blah]"
string color = "[color red]"
text = text.ToString().Trim('"');
Server.GetServer().BroadcastFrom(prefix + " " + player.Name,  color + text);
text.NewText = "*%"; // Stops the users message
//text.NewText = "         "; Does the same
Thanks - helped.By the way about prefixes - I have taken the player profile, it is possible to each player to set own prefix
 

Jakkee

Retired Staff
Retired Staff
Plugin Developer
Jul 28, 2014
1,465
932
113
Australia
Thanks - helped.By the way about prefixes - I have taken the player profile, it is possible to each player to set own prefix
Have a command that players (or admins) can set prefix.
Save data into datastore (Datastore.Add("Prefix", player.SteamID, String.Join(" ", args))
Then check the datastore if a prefix exists
If (Datastore.Contains("Prefix", player.SteamID))
String Prefix = Datastore.Get("Prefix", player.SteamID).ToString();
Else
String Prefix = "[default]"
// continue
 

Ằʑyɱổĸ☏ ✈ 2

New Member
Member
Jul 24, 2016
13
1
3
28
Parts Unknown
Have a command that players (or admins) can set prefix.
Save data into datastore (Datastore.Add("Prefix", player.SteamID, String.Join(" ", args))
Then check the datastore if a prefix exists
If (Datastore.Contains("Prefix", player.SteamID))
String Prefix = Datastore.Get("Prefix", player.SteamID).ToString();
Else
String Prefix = "[default]"
// continue
No no - you misunderstood me :) I already made 1 when entering the server the player can set the prefix
 
  • Like
Reactions: Jakkee

Ằʑyɱổĸ☏ ✈ 2

New Member
Member
Jul 24, 2016
13
1
3
28
Parts Unknown
Have a command that players (or admins) can set prefix.
Save data into datastore (Datastore.Add("Prefix", player.SteamID, String.Join(" ", args))
Then check the datastore if a prefix exists
If (Datastore.Contains("Prefix", player.SteamID))
String Prefix = Datastore.Get("Prefix", player.SteamID).ToString();
Else
String Prefix = "[default]"
// continue
I recently thought to connect all the right things from the forum in 1 project - anti cheat , ranks , kits and so on , but I think no one will give nod to it