STRMID WIKI ARTICLE!
#1

This article: https://sampwiki.blast.hk/wiki/Strmid
IS MISTAKENLY DONE!

Last parameter says:
maxlength=sizeof dest The length of the destination. (Will be the size of dest by default)

So I prosumed that it will be defaultly size of it. And I didn't add anymore parameters. So I spent like f*****g 3 hours on some motherf***ing little thing. Debugging everysingle way that was possible and ONCE again the damn article was broken. This PARAMETER IS REQUIRED TO SET or else you get empty string.

So FIX IT! Make it say that it is required to set or update libraries!
Reply
#2

I wrote this test filterscript and ran it, and it worked fine:

pawn Код:
#include a_samp

public OnFilterScriptInit()
{
    new dest[128];
    new source[] = "Hello World!";
   
    strmid(dest, source, 0, 5);
    print(dest);
}
Outputs "Hello".

Perhaps you're using it wrong.
Reply
#3

Classic humilaition!
Reply
#4

The only time this would make a difference is if you are using a multidimensional array.
Reply
#5

Just tested that also, same result:

pawn Код:
#include a_samp

public OnFilterScriptInit()
{
    new dest[2][128];
    new source[1][13];
    source[0] = "Hello World!";

    strmid(dest[0], source[0], 0, 5);
    print(dest[0]);
}
Reply
#6

Yes I was dealing with enums and after I set the last parameter it all was working. But someone should put there some "NOTE" or smth so others will know further on, not just have to blindly touch things in a no-light room.
Reply
#7

The issue isn't with "strmid" that is correct. The issue is that, that article is insufficiently writed. It lacks some important notes. If you write a documentation (for example here in SAMP Wiki article) then there is no need to write it poorly. If you write it poorly, then just don't write it at all. People will take their knowledge from somewhere else, where is more trustworthy intel.
If you don't have the time or just your lazy and need to write/create the content then you better just copy the content from some other original source which it's related to and is 1-1 with your content. I use especcialy SAMP Wiki because I prosume it's more oriented to SAMP not to some other mod, for example AMX Mod or Half Life mod..
And as I know that PAWN has also some quirks then I trust the SAMP official Wiki page because of the orientation, because there are usually in most places some "notes" too what you have to keep in mind. So I would more likely don't have to search for other sources.
In my country we have that saying that "Kus viga nдed, seal tule ja aita.", which most likely mean that where you see mistake, then go make sound and help to fix it. So my help here is that I point out the lack of information spot.
And one more thing if you have software, in that case SAMP and if you just refuse to fix something like this, even when someone points out that one place by saying that.
Quote:

So we should go through every single page on the wiki and add something like this...

Then I think you aren't enough competent to administrate your community/software/documentations, etc.
And Im not saying you must go through all these posts. Just start like this here. And everyone's else threads which point out things like this in the future and make the place more better than it currently is.

If you don't fix your info and administrate this kind of situations and just left misfilled then at the end you will confront the fatal sh*tstorm on yourself.
Reply
#8

Hysterical!

1) You are lucky to even have documentation on all the SA:MP functions. Better yet, even have SA:MP at all.

2) The documentation is not "lacking some important notes". As pointed out, the failure here is your lack of understanding of the language itself, not the functions. Perhaps if you would read the official documentation of Pawn, you wouldn't have the difficulties you did. You are trying to put blame on everything else besides your own lacking knowledge.

3) Many parts of the wiki were written by members of the community and not just the developers/beta testers. Putting blame for the "trustworthiness" of what was written specifically on them is ridiculous.

4) The moderators shouldn't be responsible for keeping track of everything regarding the wiki. They have enough to deal with from these forums, SA:MP development, their own projects, and their own lives. Most of them, if not all, are no longer 13 years old and have the luxury of sitting on their computer all day to appease to your needs.

All of what you said in your post was practically invalid. It boils down to the simple fact that you misunderstood a language feature which lead to the misuse of that feature. If YOU had taken the time to read the documentation ("fix" your personal issue) non of this would have happened.
Reply
#9

Incorrigible community. Vale.
Reply
#10

There is nothing to be corrected. It was your mistake.

Goodbye.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)