Fixing accidental commit
This commit is contained in:
parent
37d144abe5
commit
4b3d2d3133
|
@ -33,9 +33,51 @@
|
|||
#include <time.h>
|
||||
#include "amxmodx.h"
|
||||
|
||||
int emit_sound(int iEdict, int channel, const char *szSample, REAL vol, REAL att, int flags, int pitch)
|
||||
static cell AMX_NATIVE_CALL get_xvar_id(AMX *amx, cell *params)
|
||||
{
|
||||
if (iEdict == 0) {
|
||||
int len;
|
||||
char* sName = get_amxstring(amx,params[1],0,len);
|
||||
cell ptr;
|
||||
|
||||
for ( CPluginMngr::iterator a = g_plugins.begin(); a ; ++a )
|
||||
{
|
||||
if ( (*a).isValid() && amx_FindPubVar( (*a).getAMX() , sName , &ptr ) == AMX_ERR_NONE )
|
||||
return g_xvars.put( (*a).getAMX() , get_amxaddr( (*a).getAMX() , ptr ) );
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_xvar_num(AMX *amx, cell *params)
|
||||
{
|
||||
return g_xvars.getValue(params[1]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_xvar_num(AMX *amx, cell *params)
|
||||
{
|
||||
if ( g_xvars.setValue( params[1] , params[2] ) ){
|
||||
amx_RaiseError(amx,AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL xvar_exists(AMX *amx, cell *params)
|
||||
{
|
||||
return (get_xvar_id( amx , params ) != -1) ? 1 : 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL emit_sound(AMX *amx, cell *params) /* 7 param */
|
||||
{
|
||||
|
||||
int len;
|
||||
char* szSample = get_amxstring(amx,params[3],0,len);
|
||||
float vol = *(REAL *)((void *)¶ms[4]);
|
||||
float att = *(REAL *)((void *)¶ms[5]);
|
||||
int channel = params[2];
|
||||
int pitch = params[7];
|
||||
int flags = params[6];
|
||||
|
||||
if (params[1] == 0) {
|
||||
for(int i = 1; i <= gpGlobals->maxClients ; ++i){
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(i);
|
||||
if (pPlayer->ingame)
|
||||
|
@ -44,7 +86,7 @@ int emit_sound(int iEdict, int channel, const char *szSample, REAL vol, REAL att
|
|||
}
|
||||
else
|
||||
{
|
||||
edict_t* pEdict = INDEXENT(iEdict);
|
||||
edict_t* pEdict = INDEXENT(params[1]);
|
||||
if (!FNullEnt(pEdict))
|
||||
EMIT_SOUND_DYN2(pEdict,channel , szSample, vol, att, flags, pitch);
|
||||
}
|
||||
|
@ -52,22 +94,24 @@ int emit_sound(int iEdict, int channel, const char *szSample, REAL vol, REAL att
|
|||
return 1;
|
||||
}
|
||||
|
||||
int server_print(char *message) /* 1 param */
|
||||
static cell AMX_NATIVE_CALL server_print(AMX *amx, cell *params) /* 1 param */
|
||||
{
|
||||
int len = strlen(message);
|
||||
int len;
|
||||
char* message = format_amxstring(amx,params,1,len);
|
||||
if ( len > 254 ) len = 254;
|
||||
message[len++]='\n';
|
||||
message[len]=0;
|
||||
SERVER_PRINT(message);
|
||||
SERVER_PRINT( message );
|
||||
return len;
|
||||
}
|
||||
|
||||
int engclient_print(int iPlayer, int iPrintType, const char *message) /* 3 param */
|
||||
static cell AMX_NATIVE_CALL engclient_print(AMX *amx, cell *params) /* 3 param */
|
||||
{
|
||||
int len = strlen(message);
|
||||
int len;
|
||||
char* message = format_amxstring(amx,params,3,len);
|
||||
message[len++]='\n';
|
||||
message[len]=0;
|
||||
if (iPlayer == 0) {
|
||||
if (params[1] == 0) {
|
||||
for(int i = 1; i <= gpGlobals->maxClients ; ++i){
|
||||
CPlayer* pPlayer = GET_PLAYER_POINTER_I(i);
|
||||
if (pPlayer->ingame)
|
||||
|
@ -2137,20 +2181,10 @@ static cell AMX_NATIVE_CALL get_module(AMX *amx, cell *params)
|
|||
return -1; // not found
|
||||
|
||||
// set name, author, version
|
||||
if ((*moduleIter).isAmxx())
|
||||
{
|
||||
const amxx_module_info_s *info = (*moduleIter).getInfoNew();
|
||||
set_amxstring(amx, params[2], info->name, params[3]);
|
||||
set_amxstring(amx, params[4], info->author, params[5]);
|
||||
set_amxstring(amx, params[6], info->version, params[7]);
|
||||
}
|
||||
else
|
||||
{
|
||||
module_info_s *info = (*moduleIter).getInfo();
|
||||
set_amxstring(amx, params[2], info->name, params[3]);
|
||||
set_amxstring(amx, params[4], info->author, params[5]);
|
||||
set_amxstring(amx, params[6], info->version, params[7]);
|
||||
}
|
||||
|
||||
// compatibility problem possible
|
||||
int numParams = params[0] / sizeof(cell);
|
||||
|
|
Loading…
Reference in New Issue
Block a user