Post: [CODE] Make Player Talk!
01-29-2011, 01:50 AM #1
firefox7
XBOX 360 SUCKS
(adsbygoogle = window.adsbygoogle || []).push({}); Hey NGU,
I found this wonderful code in a gsc that i didnt find when i search for it so here it is Happy
I saw this is mossys private patch btw Winky Winky
haha great way to communicate to friends! yes sir... no sir



    init()
{
game["menu_quickcommands"] = "quickcommands";
game["menu_quickstatements"] = "quickstatements";
game["menu_quickresponses"] = "quickresponses";

precacheMenu(game["menu_quickcommands"]);
precacheMenu(game["menu_quickstatements"]);
precacheMenu(game["menu_quickresponses"]);
precacheHeadIcon("talkingicon");

precacheString( &"QUICKMESSAGE_FOLLOW_ME" );
precacheString( &"QUICKMESSAGE_MOVE_IN" );
precacheString( &"QUICKMESSAGE_FALL_BACK" );
precacheString( &"QUICKMESSAGE_SUPPRESSING_FIRE" );
precacheString( &"QUICKMESSAGE_ATTACK_LEFT_FLANK" );
precacheString( &"QUICKMESSAGE_ATTACK_RIGHT_FLANK" );
precacheString( &"QUICKMESSAGE_HOLD_THIS_POSITION" );
precacheString( &"QUICKMESSAGE_REGROUP" );
precacheString( &"QUICKMESSAGE_ENEMY_SPOTTED" );
precacheString( &"QUICKMESSAGE_ENEMIES_SPOTTED" );
precacheString( &"QUICKMESSAGE_IM_IN_POSITION" );
precacheString( &"QUICKMESSAGE_AREA_SECURE" );
precacheString( &"QUICKMESSAGE_GRENADE" );
precacheString( &"QUICKMESSAGE_SNIPER" );
precacheString( &"QUICKMESSAGE_NEED_REINFORCEMENTS" );
precacheString( &"QUICKMESSAGE_HOLD_YOUR_FIRE" );
precacheString( &"QUICKMESSAGE_YES_SIR" );
precacheString( &"QUICKMESSAGE_NO_SIR" );
precacheString( &"QUICKMESSAGE_IM_ON_MY_WAY" );
precacheString( &"QUICKMESSAGE_SORRY" );
precacheString( &"QUICKMESSAGE_GREAT_SHOT" );
precacheString( &"QUICKMESSAGE_TOOK_LONG_ENOUGH" );
precacheString( &"QUICKMESSAGE_ARE_YOU_CRAZY" );
precacheString( &"QUICKMESSAGE_WATCH_SIX" );
precacheString( &"QUICKMESSAGE_COME_ON" );
}

quickcommands(response)
{
self endon ( "disconnect" );

if(!isdefined(self.pers["team"]) || self.pers["team"] == "spectator" || isdefined(self.spamdelay))
return;

self.spamdelay = true;

switch(response)
{
case "1":
soundalias = "mp_cmd_followme";
saytext = &"QUICKMESSAGE_FOLLOW_ME";
//saytext = "Follow Me!";
break;

case "2":
soundalias = "mp_cmd_movein";
saytext = &"QUICKMESSAGE_MOVE_IN";
//saytext = "Move in!";
break;

case "3":
soundalias = "mp_cmd_fallback";
saytext = &"QUICKMESSAGE_FALL_BACK";
//saytext = "Fall back!";
break;

case "4":
soundalias = "mp_cmd_suppressfire";
saytext = &"QUICKMESSAGE_SUPPRESSING_FIRE";
//saytext = "Suppressing fire!";
break;

case "5":
soundalias = "mp_cmd_attackleftflank";
saytext = &"QUICKMESSAGE_ATTACK_LEFT_FLANK";
//saytext = "Attack left flank!";
break;

case "6":
soundalias = "mp_cmd_attackrightflank";
saytext = &"QUICKMESSAGE_ATTACK_RIGHT_FLANK";
//saytext = "Attack right flank!";
break;

case "7":
soundalias = "mp_cmd_holdposition";
saytext = &"QUICKMESSAGE_HOLD_THIS_POSITION";
//saytext = "Hold this position!";
break;

default:
assert(response == "8");
soundalias = "mp_cmd_regroup";
saytext = &"QUICKMESSAGE_REGROUP";
//saytext = "Regroup!";
break;
}

self saveHeadIcon();
self doQuickMessage(soundalias, saytext);

wait 2;
self.spamdelay = undefined;
self restoreHeadIcon();
}

quickstatements(response)
{
if(!isdefined(self.pers["team"]) || self.pers["team"] == "spectator" || isdefined(self.spamdelay))
return;

self.spamdelay = true;

switch(response)
{
case "1":
soundalias = "mp_stm_enemyspotted";
saytext = &"QUICKMESSAGE_ENEMY_SPOTTED";
//saytext = "Enemy spotted!";
break;

case "2":
soundalias = "mp_stm_enemiesspotted";
saytext = &"QUICKMESSAGE_ENEMIES_SPOTTED";
//saytext = "Enemy down!";
break;

case "3":
soundalias = "mp_stm_iminposition";
saytext = &"QUICKMESSAGE_IM_IN_POSITION";
//saytext = "I'm in position.";
break;

case "4":
soundalias = "mp_stm_areasecure";
saytext = &"QUICKMESSAGE_AREA_SECURE";
//saytext = "Area secure!";
break;

case "5":
soundalias = "mp_stm_watchsix";
saytext = &"QUICKMESSAGE_WATCH_SIX";
//saytext = "Grenade!";
break;

case "6":
soundalias = "mp_stm_sniper";
saytext = &"QUICKMESSAGE_SNIPER";
//saytext = "Sniper!";
break;

default:
assert(response == "7");
soundalias = "mp_stm_needreinforcements";
saytext = &"QUICKMESSAGE_NEED_REINFORCEMENTS";
//saytext = "Need reinforcements!";
break;
}

self saveHeadIcon();
self doQuickMessage(soundalias, saytext);

wait 2;
self.spamdelay = undefined;
self restoreHeadIcon();
}

quickresponses(response)
{
if(!isdefined(self.pers["team"]) || self.pers["team"] == "spectator" || isdefined(self.spamdelay))
return;

self.spamdelay = true;

switch(response)
{
case "1":
soundalias = "mp_rsp_yessir";
saytext = &"QUICKMESSAGE_YES_SIR";
//saytext = "Yes Sir!";
break;

case "2":
soundalias = "mp_rsp_nosir";
saytext = &"QUICKMESSAGE_NO_SIR";
//saytext = "No Sir!";
break;

case "3":
soundalias = "mp_rsp_onmyway";
saytext = &"QUICKMESSAGE_IM_ON_MY_WAY";
//saytext = "On my way.";
break;

case "4":
soundalias = "mp_rsp_sorry";
saytext = &"QUICKMESSAGE_SORRY";
//saytext = "Sorry.";
break;

case "5":
soundalias = "mp_rsp_greatshot";
saytext = &"QUICKMESSAGE_GREAT_SHOT";
//saytext = "Great shot!";
break;

default:
assert(response == "6");
soundalias = "mp_rsp_comeon";
saytext = &"QUICKMESSAGE_COME_ON";
//saytext = "Took long enough!";
break;
}

self saveHeadIcon();
self doQuickMessage(soundalias, saytext);

wait 2;
self.spamdelay = undefined;
self restoreHeadIcon();
}

doQuickMessage( soundalias, saytext )
{
if(self.sessionstate != "playing")
return;

prefix = maps\mp\gametypes\_teams::getTeamVoicePrefix( self.team );

if(isdefined(level.QuickMessageToAll) && level.QuickMessageToAll)
{
self.headiconteam = "none";
self.headicon = "talkingicon";

self playSound( prefix+soundalias );
self sayAll(saytext);
}
else
{
if(self.sessionteam == "allies")
self.headiconteam = "allies";
else if(self.sessionteam == "axis")
self.headiconteam = "axis";

self.headicon = "talkingicon";

self playSound( prefix+soundalias );
self sayTeam( saytext );
self pingPlayer();
}
}

saveHeadIcon()
{
if(isdefined(self.headicon))
self.oldheadicon = self.headicon;

if(isdefined(self.headiconteam))
self.oldheadiconteam = self.headiconteam;
}

restoreHeadIcon()
{
if(isdefined(self.oldheadicon))
self.headicon = self.oldheadicon;

if(isdefined(self.oldheadiconteam))
self.headiconteam = self.oldheadiconteam;
}
(adsbygoogle = window.adsbygoogle || []).push({});

The following 2 users say thank you to firefox7 for this useful post:

AgentSexyPig,
01-29-2011, 03:51 PM #20
Default Avatar
Gizmo
Guest
Originally posted by DEREKTROTTER View Post
these are the ones that "should" work in MP

    
spawn_music
defeat_music
victory_music
winning_music
losing_music
mission_succes
mission_fail
draw
encourage_win
encourage_lost
timesup
winning
losing
winning_fight
losing_fight
lead_lost
tied
lead_taken
lastalive
boost
hardcore
highspeed
tactical
challengecomplete
promotion
acheive_bomb
bomb_taken
bomb_defused
bomb_planted
securedobj
lostobj
obj_defend
obj_destroy
capture_obj
capture_objs
hq_located
hq_captured
hq_destroyed
hq_offline
hq_online
new_positions
pushforward
attack
defend
offense
defense
halftime
overtime
switching
ourflag
ourflag_drop
ourflag_return
ourflag_capt
getback_ourflag
enemyflag_tobase
enemyflag
enemyflag_drop
enemyflag_return
enemyflag_capt
capturing_a
capturing_b
capturing_c
capture_a
capture_b
capture_c
securing_a
securing_b
securing_c
secure_a
secure_b
secure_c
losing_a
losing_b
losing_c
lost_a
lost_b
lost_c
enemy_take_a
enemy_take_b
enemy_take_c
enemy_has_a
enemy_has_b
enemy_has_c
take_positions
positions_lock
dest_sentrygun
nuke_music
sentry_gone
ti_cancelled
ti_blocked
cobra_helicopter_hit
cobra_helicopter_secondary_exp
cobra_helicopter_damaged
cobra_helicopter_dying_loop
cobra_helicopter_dying_layer
cobra_helicopter_crash
weap_cobra_missile_fire
spinloop
spinstart
weap_cobra_20mm_fire_npc
weap_c4detpack_trigger_plr
littlebird_move
ammo_crate_use
self playsound( "Soundhere" );


dest_sentrygun
nuke_music
nuke_explosion
nuke_wave
sentry_gone
ti_cancelled
ti_blocked
cobra_helicopter_hit
cobra_helicopter_secondary_exp
cobra_helicopter_damaged
cobra_helicopter_dying_loop
cobra_helicopter_dying_layer
cobra_helicopter_crash
weap_cobra_missile_fire
spinloop
spinstart
weap_cobra_20mm_fire_npc
weap_c4detpack_trigger_plr
littlebird_move
ammo_crate_use
ac130_fco_moreenemy "More enemy personnel."
ac130_fco_getthatguy "Get that guy."
ac130_fco_guymovin "Roger, guy movin'."
ac130_fco_getperson "Get that person."
ac130_fco_guyrunnin "Guy runnin'."
ac130_fco_gotarunner "Uh, we got a runner here."
ac130_fco_backonthose "Get back on those guys."
ac130_fco_gonnagethim "You gonna get him?"
ac130_fco_personnelthere "Personnel right there."
ac130_fco_nailthoseguys "Nail those guys."
ac130_fco_lightemup "Light 'em up."
ac130_fco_takehimout "Yeah take him out."
ac130_plt_yeahcleared "Yeah, cleared to engage."
ac130_plt_copysmoke "Copy, smoke 'em."
ac130_fco_rightthere "Right there...tracking."
ac130_fco_tracking "Tracking."
ac130_fco_movingagain "Ok he's moving again."
ac130_fco_doveonground "Yeah, he just dove on the ground."
ac130_fco_knockedwind "Probably just knocked the wind out of him."
ac130_fco_downstillmoving "That guy's down but still moving."
ac130_fco_gettinbackup "He's gettin' back up."
ac130_fco_yepstillmoving "Yep, that guy's still moving."
ac130_fco_stillmoving "He's still moving."
ac130_plt_gottahurt "Ooo that's gotta hurt."
ac130_fco_iseepieces "Yeah, good kill. I see lots of little pieces down there."
ac130_fco_oopsiedaisy "(chuckling) Oopsie-daisy."
ac130_fco_goodkill "Good kill good kill."
ac130_fco_yougothim "You got him."
ac130_fco_yougothim2 "You got him!"
ac130_fco_thatsahit "That's a hit."
ac130_fco_directhit "Direct hit."
ac130_fco_rightontarget "Yep, that was right on target."
ac130_fco_okyougothim "Ok, you got him. Get back on the other guys."
ac130_fco_within2feet "All right you got the guy.That might have been within two feet of him."
ac130_fco_nice "(chuckling) Niiiice."
ac130_fco_directhits "Yeah, direct hits right there."
ac130_plt_scanrange "Set scan range."
ac130_plt_cleanup "Clean up that signal."
ac130_plt_targetreset "Target reset."
ac130_plt_azimuthsweep "Recalibrate azimuth sweep angle. Adjust elevation scan."


That chuckle one is when you shoot down your own harrier with an AC130 =D
01-29-2011, 04:08 PM #21
d7w7z
Bounty hunter
Originally posted by TheEliteMossy View Post
I wrote my own function for the talking, and its only 2 lines of code Winky Winky

    Chat( N )
{
prefix = maps\mp\gametypes\_teams::getTeamVoicePrefix( self.team );
self playSound( prefix+N );
}

Something like that? :p

Also would the "No Ammo" and "Reload" messages be helpful for working out flashing mod menu text? :rolleyes:
01-29-2011, 04:32 PM #22
Originally posted by d7w7z View Post
    Chat( N )
{
prefix = maps\mp\gametypes\_teams::getTeamVoicePrefix( self.team );
self playSound( prefix+N );
}

Something like that? :p

Also would the "No Ammo" and "Reload" messages be helpful for working out flashing mod menu text? :rolleyes:


Mossy's one use the sayall as well, like the one I posted a few posts ago ..

---------- Post added at 04:32 PM ---------- Previous post was at 04:30 PM ----------

Originally posted by xX View Post
no... its a fuction built into the game...
plus all he can do is copy and paste Not Happy or Sad


Ha ha, look at you getting all tough on the internet.

I eagerly await your new mods/ideas ..
01-29-2011, 04:36 PM #23
d7w7z
Bounty hunter
Originally posted by x View Post
Mossy's one use the sayall as well, like the one I posted a few posts ago

Yeah I took it out because I only wanted sound Winky Winky

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo