Unknown Command
#2

show us both commands and we may tell you what's wrong with it

for reference,
there are some things which can cause a "unknown command" even when the command is present in the script:
Quote:
Originally Posted by CutX
Посмотреть сообщение
for example, i got a array which is 5 long, called "string".
the string is filled with "hello"

it'll look like this:
[H] -> 0
[e] -> 1
[l] -> 2
[l] -> 3
[o] -> 4
[\0] -> 5 (NULL char)

but now a loop is trying to do something like this:
PHP код:
//lets say i is 6
printf("%c",string[i]); 
this could cause a "SERVER : Unknown Command" maybe
not sure...
//Edit it will cause the error, not maybe

Code-example:
PHP код:
new strxs[5];
YCMD:lol(playeridparams[], help)
{
    
format(strxs,sizeof strxs,"%s","Hello");
    for(new 
i=0i<10i++)
    {
    
printf("%c",strxs[i]);
    }
    return 
1;

this compiles without errors, but causes an "SERVER : Unknown Command" when you use it.
the chars are printed to the console until '\0' when 'i' moving on to being '6', the error comes in
looping trough something which doesen't exist can cause such things.


it even didn't print the "o" xD just fucked up

you could also run that
Код:
#include <a_samp>

new strxs[5];

main()
{
    format(strxs,sizeof strxs,"%s","Hello");
    for(new i=0; i<10; i++)
    {
    printf("%c",strxs[i]);
    } 
    return 1;
}
here: http://slice-vps.nl:7070/
and you'll get: "Accessing element at index 5 past array upper bound 4"
Reply


Messages In This Thread
Unknown Command - by TonyNames - 31.12.2013, 21:09
Re: Unknown Command - by CutX - 31.12.2013, 21:11
Re: Unknown Command - by TonyNames - 01.01.2014, 14:07
Re: Unknown Command - by Konstantinos - 01.01.2014, 14:11
Re: Unknown Command - by TonyNames - 01.01.2014, 14:26
Re: Unknown Command - by Konstantinos - 01.01.2014, 14:37
Re: Unknown Command - by TonyNames - 01.01.2014, 15:19
Re: Unknown Command - by TonyNames - 01.01.2014, 15:45
Re: Unknown Command - by Konstantinos - 01.01.2014, 15:50
Re: Unknown Command - by TonyNames - 01.01.2014, 15:57

Forum Jump:


Users browsing this thread: 1 Guest(s)