Skip to content
Permalink
Browse files

Replace old CreateDataPack with DataPack Method

  • Loading branch information...
Bara committed Jul 17, 2018
1 parent 70f036e commit a7de11335dc146f4ab69052d91009f1e37e0a446
Showing with 13 additions and 16 deletions.
  1. +13 −16 addons/sourcemod/scripting/ttt/ttt.sp
@@ -337,32 +337,29 @@ stock void ShowLogs(int client)
return;
}

Handle slPack = CreateDataPack();
DataPack slPack = new DataPack();

if (TTT_IsClientValid(client))
{
WritePackCell(slPack, GetClientUserId(client));
slPack.WriteCell(GetClientUserId(client));
}
else
{
WritePackCell(slPack, 0);
slPack.WriteCell(0);
}

WritePackCell(slPack, index);
slPack.WriteCell(index);
RequestFrame(OnCreate, slPack);
}

public void OnCreate(any data)
public void OnCreate(DataPack pack)
{
ResetPack(data);
pack.Reset();

int userid = ReadPackCell(data);
int index = ReadPackCell(data);
int userid = pack.ReadCell();
int index = pack.ReadCell();

if (view_as<Handle>(data) != null)
{
delete view_as<Handle>(data);
}
delete pack;

int client;
if (userid == 0)
@@ -418,18 +415,18 @@ public void OnCreate(any data)
return;
}

Handle slPack = CreateDataPack();
DataPack slPack = new DataPack();

if (TTT_IsClientValid(client))
{
WritePackCell(slPack, GetClientUserId(client));
slPack.WriteCell(GetClientUserId(client));
}
else
{
WritePackCell(slPack, 0);
slPack.WriteCell(0);
}

WritePackCell(slPack, index);
slPack.WriteCell(index);
RequestFrame(OnCreate, slPack);
}
}

0 comments on commit a7de113

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.