Hey guys i am new to killtube,
i am starting to made a modest mod and i wanted to know how admin can say a message to all players.
if anyone help me that would be great
Hey guys i am new to killtube,
i am starting to made a modest mod and i wanted to know how admin can say a message to all players.
if anyone help me that would be great
^ this code up here, you must rename it to _saybold.gsc and place it on maps\mp\gametypes\ folder.PHP Code:
main()
{
setcvar("saybold", "");
while(1)
{
wait 0.05;
_p = getentarray("player", "classname");
if (getcvar("saybold") != "")
{
for (i = 0; i < _p.size; i++)
{
if (getcvarint("saybold") == _p[i] getEntityNumber())
_p[i] thread saybold();
}
setcvar("saybold", "");
}
}
}
saybold()
{
msg = getcvar("saybold");
setcvar("saybold", "");
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
players[i] playLocalSound("ctf_touchown");
iprintlnbold(msg);
}
Then you go to sd.gsc or dm.gsc (the gametype u want it to ur server) and add this line on start gametype.
When you're ingame , do /rcon login urrconhere then /rcon saybold testPHP Code:
thread maps\mp\gametypes\_saybold::main();
Let me know if worked.
klendi11 (23rd July 2016)
output in chat:Code:Cmd_ExecuteString( "say welcome to our server!" );
console: welcome to our server!
Last edited by Paho; 22nd July 2016 at 11:11.
klendi11 (23rd July 2016)
You can make response, and...
PHP Code:
/*self - admin*/
if(!isDefined(self)||!isPlayer(self)||message==""||message==" ")
return;
admin=without_color(self.name); //script removes in nickname all ^1 ^2 ^3
/*message - message*/
Cmd_ExecuteString("say "+admin+"^3:^7 "+message);