Raised This Month: $ Target: $400
 0% 

Plugin Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Blinx
Senior Member
Join Date: Oct 2013
Old 04-14-2016 , 19:45   Plugin Help
Reply With Quote #1

Hey, hoping someone can help resolve this error:

"Native "ReadPackCell" reported: DataPack operation is out of bounds."

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <tf2items>
#include <tf2_stocks>
#include <freak_fortress_2>
#include <freak_fortress_2_subplugin>

public Plugin:myinfo = {
   
name "Freak Fortress 2: Temp Melee Weapon",
   
author "Blinx",
};

new 
String:weaponAttribs[64];
new 
String:weaponClass[64];
new 
thisWeaponIndex;

new 
String:reWeaponAttribs[64];
new 
String:reWeaponClass[64];
new 
reWeaponIndex;

public 
OnPluginStart2()
{
}

public 
Action:FF2_OnAbility2(index,const String:plugin_name[],const String:ability_name[],action)
{
   if (!
strcmp(ability_name,"rage_tempMelee"))
      
rage_tempMelee(ability_nameindex);
}

stock SpawnWeapon(client,String:name[],index,level,qual,String:att[])
{
   new 
Handle:hWeapon TF2Items_CreateItem(OVERRIDE_ALL|FORCE_GENERATION);
   
TF2Items_SetClassname(hWeaponname);
   
TF2Items_SetItemIndex(hWeaponindex);
   
TF2Items_SetLevel(hWeaponlevel);
   
TF2Items_SetQuality(hWeaponqual);
   new 
String:atts[32][32];
   new 
count ExplodeString(att" ; "atts3232);
   if (
count 0)
   {
      
TF2Items_SetNumAttributes(hWeaponcount/2);
      new 
i2 0;
      for (new 
0counti+=2)
      {
         
TF2Items_SetAttribute(hWeaponi2StringToInt(atts[i]), StringToFloat(atts[i+1]));
         
i2++;
      }
   }
   else
      
TF2Items_SetNumAttributes(hWeapon0);
   if (
hWeapon==INVALID_HANDLE)
      return -
1;
   new 
entity TF2Items_GiveNamedItem(clienthWeapon);
   
CloseHandle(hWeapon);
   
EquipPlayerWeapon(cliententity);
   return 
entity;
}

rage_tempMelee(const String:ability_name[], index)
{
   new 
Handle:pack CreateDataPack();
   new 
Boss=GetClientOfUserId(FF2_GetBossUserId(index));
   
FF2_GetAbilityArgumentString(indexthis_plugin_nameability_name1weaponAttribssizeof(weaponAttribs));
   
FF2_GetAbilityArgumentString(indexthis_plugin_nameability_name2weaponClasssizeof(weaponClass));
   
thisWeaponIndex FF2_GetAbilityArgument(indexthis_plugin_nameability_name3);
   new 
Float:duration=FF2_GetAbilityArgumentFloat(indexthis_plugin_nameability_name4);
   
   
WritePackCell(packindex);
   
WritePackCell(packBoss);
   
   
TF2_RemoveWeaponSlot(BossTFWeaponSlot_Melee);
   
SetEntPropEnt(BossProp_Send"m_hActiveWeapon"SpawnWeapon(BossweaponClassthisWeaponIndex1008weaponAttribs));
   
CreateDataTimer(durationnormalMeleepackTIMER_DATA_HNDL_CLOSE);
}

public 
Action:normalMelee(Handle:timerHandle:pack)
{
    
ResetPack(pack);
    new 
index=ReadPackCell(pack); //This is where the error happens
    
new Boss=ReadPackCell(pack);

    
FF2_GetAbilityArgumentString(indexthis_plugin_name"rage_tempMelee"5reWeaponAttribssizeof(reWeaponAttribs));
    
FF2_GetAbilityArgumentString(indexthis_plugin_name"rage_tempMelee"6reWeaponClasssizeof(reWeaponClass));
    
reWeaponIndex FF2_GetAbilityArgument(indexthis_plugin_name"rage_tempMelee"7);
    
    
TF2_RemoveWeaponSlot(BossTFWeaponSlot_Melee);
    
SetEntPropEnt(BossProp_Send"m_hActiveWeapon"SpawnWeapon(BossreWeaponClassreWeaponIndex15reWeaponAttribs));

Thanks in advance.

Last edited by Blinx; 04-14-2016 at 19:47.
Blinx is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:09.


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