MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / PlaySound

Function PlaySound

src/bzfs/lua/CallOuts.cpp:822–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

820
821
822static int PlaySound(lua_State* L) {
823 const int playerID = luaL_checkint(L, 1);
824 const char* sound = luaL_checkstring(L, 2);
825 fvec3 pos;
826 const float* posPtr = NULL;
827 if (lua_gettop(L) >= 5) {
828 posPtr = pos;
829 pos.x = luaL_checkfloat(L, 3);
830 pos.y = luaL_checkfloat(L, 4);
831 pos.z = luaL_checkfloat(L, 5);
832 }
833 lua_pushboolean(L, bz_sendPlayCustomLocalSound(playerID, sound, posPtr));
834 return 1;
835}
836
837
838static int SendPlayerVariables(lua_State* L) {

Callers

nothing calls this directly

Calls 4

luaL_checkfloatFunction · 0.85
lua_gettopFunction · 0.50
lua_pushbooleanFunction · 0.50

Tested by

no test coverage detected