AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_speak in fakemeta... (https://forums.alliedmods.net/showthread.php?t=46477)

organizedKaoS 10-27-2006 15:01

set_speak in fakemeta...
 
Possible?

I'm in the process of finishing up my last batch of plugins that I'm converting over to fakemeta and can't seem to find how to change set_speak.

Any tips?

teame06 10-27-2006 15:44

Re: set_speak in fakemeta...
 
I havn't tested the plugin yet but pretty much this is what you have to do in your plugin or make a include to use in your plugin or add that code in your plugin.

Code:
#if !defined _engine_included #define SPEAK_NORMAL 0 #define SPEAK_MUTED 1 #define SPEAK_ALL 2 #define SPEAK_LISTENALL 4 /* set/get a user's speak flags */ native set_speak(iIndex, iSpeakFlags); native get_speak(iIndex); #endif

Code:
#include <amxmodx> #include <fakemeta> #define SPEAK_NORMAL 0 #define SPEAK_MUTED 1 #define SPEAK_ALL 2 #define SPEAK_LISTENALL 4 new SpeakFlags[33]; public plugin_init() {     register_plugin("FM SPEAK", "1.0", "Gaben");     if(!LibraryExists("engine", LibType_Library))         register_forward(FM_Voice_SetClientListening, "_FM_Voice_SetClientListening"); } public plugin_natives() {     register_library("SPEAK");     register_native("set_speak", "_set_speak");     register_native("get_speak", "_get_speak"); } public client_disconnect(id) {     SpeakFlags[id] = SPEAK_NORMAL; } public _set_speak(index, nums) {     new id = get_param(1);     if(!is_user_connected(id))     {         log_error(AMX_ERR_NATIVE, "[SetSpeak] Invalid player %d", id)         return;     }     SpeakFlags[id] = get_param(2); } public _get_speak(index, nums) {     new id = get_param(1);     if(!is_user_connected(id))     {         log_error(AMX_ERR_NATIVE, "[SetSpeak] Invalid player %d", id)         return 0;     }     return SpeakFlags[id]; } public _FM_Voice_SetClientListening(iReceiver, iSender, bool:bListen) {     if((SpeakFlags[iSender] & SPEAK_MUTED) != 0)     {         engfunc(EngFunc_SetClientListening, iReceiver, iSender, false);         forward_return(FMV_CELL, false);         return FMRES_SUPERCEDE;     }     if((SpeakFlags[iSender] & SPEAK_ALL) != 0)     {         engfunc(EngFunc_SetClientListening, iReceiver, iSender, true);         forward_return(FMV_CELL, true);         return FMRES_SUPERCEDE;     }     if((SpeakFlags[iReceiver] & SPEAK_LISTENALL) != 0)     {         engfunc(EngFunc_SetClientListening, iReceiver, iSender, true);         forward_return(FMV_CELL, true);         return FMRES_SUPERCEDE;     }     forward_return(FMV_CELL, bListen);     return FMRES_IGNORED; }

organizedKaoS 10-27-2006 15:57

Re: set_speak in fakemeta...
 
Thanks....will try that.

teame06 10-27-2006 19:33

Re: set_speak in fakemeta...
 
No problem, Just tell me if works properly.

organizedKaoS 10-28-2006 03:25

Re: set_speak in fakemeta...
 
Works for the most part.

Now I'm really stuck.

Been using fakemeta_util along with all other fakemeta stocks/funcs.

40+ plugins successfully converted over to fakemeta except for one.

How do I change radius_damage to work with fakemeta.

I'm tired right now and I've been through fakemeta and fakemeta_util includes for the past couple of hours but haven't found anything yet.

If you have any ideas please share. I'm gonna crash for now so hopefully someone knows how to do this.

Thanks.

VEN 10-28-2006 08:55

Re: set_speak in fakemeta...
 
Quote:

How do I change radius_damage to work with fakemeta
Try this: http://forums.alliedmods.net/showthr...245#post389245

organizedKaoS 10-28-2006 14:05

Re: set_speak in fakemeta...
 
VEN....YOU ROCK.....+ KARMA :up:

I don't know why my searches didn't turn that up.

Thanks again.

P34nut 10-28-2006 14:51

Re: set_speak in fakemeta...
 
lol that code doesnt work... shall i post it here or are u going to fix it yourself?

organizedKaoS 10-28-2006 16:25

Re: set_speak in fakemeta...
 
Quote:

Originally Posted by P34nut (Post 396365)
lol that code doesnt work... shall i post it here or are u going to fix it yourself?

Actually it does.

Works perfect, like a charm. No errors in compiling and no run time errors from server.

Though I did have to edit it just a bit but yeah.....works fine.

:up:

Maybe VEN can add it to his fakemeta_util, with your permission of course.
Code:
stock fm_radius_damage(Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier)     {     new ent = 0     while ((ent = fm_find_ent_in_sphere(ent, fExplodeAt, float(5 * iRadiusMultiplier))) > 0)         {                 if (is_user_alive(ent) && !fm_get_user_godmode(ent))             {             new Float:plHealth             pev(ent, pev_health, plHealth)                         plHealth - 10.0 + iDamageMultiplier                         if (plHealth < 1)                 {                 user_kill(ent)             }             else                 {                 set_pev(ent, pev_health, plHealth)             }         }     }       ent = 0         while ((ent = fm_find_ent_in_sphere(ent, fExplodeAt, float(4 * iRadiusMultiplier))) > 0)         {                 if (is_user_alive(ent) && !fm_get_user_godmode(ent))             {             new Float:plHealth             pev(ent, pev_health, plHealth)                         plHealth - 25.0 + random_num(0, 2 * iDamageMultiplier)                         if (plHealth < 1)                 {                 user_kill(ent)             }             else                 {                 set_pev(ent, pev_health, plHealth)             }         }     }       ent = 0         while ((ent = fm_find_ent_in_sphere(ent, fExplodeAt, float(3 * iRadiusMultiplier))) > 0)         {                 if (is_user_alive(ent) && !fm_get_user_godmode(ent))             {             new Float:plHealth             pev(ent, pev_health, plHealth)                         plHealth - 50.0 + random_num(0, 3 * iDamageMultiplier)                         if (plHealth < 1)                 {                 user_kill(ent)             }             else                 {                 set_pev(ent, pev_health, plHealth)             }         }     }       ent = 0         while ((ent = fm_find_ent_in_sphere(ent, fExplodeAt, float(2 * iRadiusMultiplier))) > 0)         {         if (is_user_alive(ent) && !fm_get_user_godmode(ent))             {             user_kill(ent)         }     }     }

P34nut 10-28-2006 16:41

Re: set_speak in fakemeta...
 
huh!?:S it gave me errors..

but VEN can add this if he want


All times are GMT -4. The time now is 04:46.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.