PDA

View Full Version : MVP again


Mainfield
01-17-2012, 17:18
Hi.

Is there a way to rewrite those messages on CT or T (winpanels), the displays from valve for example what the MVP this round is and why?

Or is there no chance?



This code i found here in the forums doesnt work for me:

CHECK = 0;
public CSS_MVP(Handle:Event, const String:Name[], bool:Broadcast)
{
// Sometimes console gets MVP, exclude it
if(GetEventInt(Event, "userid") == 0)
return Plugin_Continue;

// Get MVP's client index
new UID = GetEventInt(Event, "userid");

// Check if this is our created event
if(CHECK > 0)
{
// This is our assigned MVP
LogToGame("UserIdOfMVP=\"%i\"", UID);

// Reset CHECK var to 0
CHECK = 0;
return Plugin_Continue;
}

// Get UserId of GunGame leader
new GGLDR = GetClientUserId(CurrentLeader);
LogToGame("UserIdOf: MVP=\"%i\", GGLeader=\"%i\"", UID, GGLDR);

// This is the game's event, Set CHECK var to allow passing of our created event
CHECK = 1;

// Create new event and assign gungame leader to round MVP
new Handle:newEvent = CreateEvent("round_mvp", true);
SetEventInt(newEvent, "userid", GGLDR);
FireEvent(newEvent, false);

// This is to prevent the game's event from broadcasting
return Plugin_Handled;
}

Just edited the id to something else fpr test purpose, just shows up the normal winpanel without any changes...

maybe, if userid works on round_mvp, is there a way that we can set the reason to display in the panel, too?

Powerlord
01-18-2012, 17:28
Hi.

Is there a way to rewrite those messages on CT or T (winpanels), the displays from valve for example what the MVP this round is and why?

Or is there no chance?



This code i found here in the forums doesnt work for me:



Just edited the id to something else fpr test purpose, just shows up the normal winpanel without any changes...

maybe, if userid works on round_mvp, is there a way that we can set the reason to display in the panel, too?

It'd probably be better to make a pre-event and update the event's parameters, returning PluginChanged to let SourceMod know you changed the event.

Mainfield
01-18-2012, 18:50
You think of creating an own event, and fire it maybe at round_end?I Started with sourcepawn 7 months ago, coming from eventscripts. I know the wiki but may you please give me an example of what you mean?That would really help me out.(Dont want a whole script, only a base i can carry on and learn)

Peace-Maker
01-18-2012, 21:36
Have a look at this.
https://forums.alliedmods.net/showpost.php?p=1627823&postcount=3105

tobi187
01-20-2012, 17:35
Have a look at this.
https://forums.alliedmods.net/showpost.php?p=1627823&postcount=3105

Nice script!

Can we edit the reason or is it just a numeric that interacts with an "ValVe-side" translation or something else?

Peace-Maker
01-20-2012, 19:31
It's just a number which gets replaced with a string clientside. You can't put custom messages there.