Add transitional syntax support for Protobuf natives.

This commit is contained in:
David Anderson
2014-11-09 14:19:16 -08:00
parent 801b7ec9e2
commit 6b714dafe3
6 changed files with 344 additions and 70 deletions
+6 -5
View File
@@ -53,13 +53,14 @@ PerformBlind(client, target, amount)
new color[4] = { 0, 0, 0, 0 };
color[3] = amount;
new Handle:message = StartMessageEx(g_FadeUserMsgId, targets, 1);
Handle message = StartMessageEx(g_FadeUserMsgId, targets, 1);
if (GetUserMessageType() == UM_Protobuf)
{
PbSetInt(message, "duration", duration);
PbSetInt(message, "hold_time", holdtime);
PbSetInt(message, "flags", flags);
PbSetColor(message, "clr", color);
Protobuf pb = UserMessageToProtobuf(message);
pb.SetInt("duration", duration);
pb.SetInt("hold_time", holdtime);
pb.SetInt("flags", flags);
pb.SetColor("clr", color);
}
else
{
+12 -12
View File
@@ -58,14 +58,14 @@ KillDrug(client)
new flags = (0x0001 | 0x0010);
new color[4] = { 0, 0, 0, 0 };
new Handle:message = StartMessageEx(g_FadeUserMsgId, clients, 1);
Handle message = StartMessageEx(g_FadeUserMsgId, clients, 1);
if (GetUserMessageType() == UM_Protobuf)
{
PbSetInt(message, "duration", duration);
PbSetInt(message, "hold_time", holdtime);
PbSetInt(message, "flags", flags);
PbSetColor(message, "clr", color);
Protobuf pb = UserMessageToProtobuf(message);
pb.SetInt("duration", duration);
pb.SetInt("hold_time", holdtime);
pb.SetInt("flags", flags);
pb.SetColor("clr", color);
}
else
{
@@ -177,14 +177,14 @@ public Action:Timer_Drug(Handle:timer, any:client)
color[1] = GetRandomInt(0,255);
color[2] = GetRandomInt(0,255);
new Handle:message = StartMessageEx(g_FadeUserMsgId, clients, 1);
Handle message = StartMessageEx(g_FadeUserMsgId, clients, 1);
if (GetUserMessageType() == UM_Protobuf)
{
PbSetInt(message, "duration", duration);
PbSetInt(message, "hold_time", holdtime);
PbSetInt(message, "flags", flags);
PbSetColor(message, "clr", color);
Protobuf pb = UserMessageToProtobuf(message);
pb.SetInt("duration", duration);
pb.SetInt("hold_time", holdtime);
pb.SetInt("flags", flags);
pb.SetColor("clr", color);
}
else
{