mirror of
https://github.com/alicealys/t5-gsc-utils.git
synced 2025-04-19 20:42:54 +00:00
Add say & tell
This commit is contained in:
parent
33eed76e63
commit
90b3a553db
@ -243,6 +243,24 @@ namespace command
|
|||||||
function(player, {array});
|
function(player, {array});
|
||||||
});
|
});
|
||||||
}, "addclientcommand", "command::add_sv");
|
}, "addclientcommand", "command::add_sv");
|
||||||
|
|
||||||
|
gsc::method::add("tell", [](const scripting::entity& player, const std::string& msg)
|
||||||
|
{
|
||||||
|
const auto entref = player.get_entity_reference();
|
||||||
|
if (entref.classnum != 0 || entref.entnum >= 18)
|
||||||
|
{
|
||||||
|
throw std::runtime_error("Not a player entity");
|
||||||
|
}
|
||||||
|
|
||||||
|
game::SV_GameSendServerCommand(entref.entnum, 0, utils::string::va("h \"%s\"", msg.data()));
|
||||||
|
});
|
||||||
|
|
||||||
|
gsc::function::add("say", [](const std::string& msg)
|
||||||
|
{
|
||||||
|
game::SV_GameSendServerCommand(-1, 0, utils::string::va("h \"%s\"", msg.data()));
|
||||||
|
});
|
||||||
|
|
||||||
|
gsc::function::add("sendservercommand", game::SV_GameSendServerCommand.get());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user