[Help] Error
Hey guys, I developed a plugin that consisted in displaying a decal on player feet when they spawn. That works fine, I also added a tracer to check which entity index the player is looking at, that also seems to be working fine, now I tried to add a new config for URL in motd, I'm getting array errors
" L 10/13/2015 - 19:44:36: [SM] Native "ArrayList.GetString" reported: Invalid index 6 (count: 2) L 10/13/2015 - 19:44:36: [SM] Displaying call stack trace for plugin "AdsAdvanced.smx": L 10/13/2015 - 19:44:36: [SM] [0] Line 258, /groups/sourcemod/upload_tmp/textqdfvPR.sp::GetURLData() L 10/13/2015 - 19:44:36: [SM] [1] Line 104, /groups/sourcemod/upload_tmp/textqdfvPR.sp::OnPlayerRunCmd() "... I know what they mean, however I don't know why they happen. Could anyone help me fix them please? Thanks in advance. Source: https://www.dropbox.com/s/zuzye9dcim...201.23.sp?dl=0 |
Re: [Help] Error
Edit: Nvm wrong
|
Re: [Help] Error
:) thanks for trying, even if you didn't found the solution.
|
Re: [Help] Error
Not sure what you were trying to do but your pushing decal into an array(1) everytime it spawns. Then your pushing in kv entries into another array(2). Then your using the size of array(2) to loop through the indexes on array(1). The size will always be different, it's why your getting array errors. I don't know what your trying to accomplish but i think you need to do a different way.
|
Re: [Help] Error
Quote:
|
Re: [Help] Error
You can use Tries/Hashmap instead of arrays to store the "index" and "url" when loading KV. Then you can search the Hashmap using the index as lookup.
Or When you created the spray, create a DataPack that stores index and url. Then you can compare the index and extract the url later. I think 1st method might be easier to work with. |
Re: [Help] Error
Quote:
|
Re: [Help] Error
E.G. don't rely too much on this code, i wrote this quickly.
This is just an example, your gonna have to work with it to get what you want. Code:
StringMap HashMap; |
Re: [Help] Error
thanks :) what about index on the temp entities do they start from 0?
|
Re: [Help] Error
I don't know its from your code.
|
All times are GMT -4. The time now is 22:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.