10.02.2012, 12:14
Hello SA:MP scripters, I'm creating this thread as 'Discussion' for the following reason:
I'm scripting a new GameMode, And i bumped into this problem:
Zero(0) divide (/) Zero(0)
break;s or return 0;s the current brackets content and returns 0.
Example:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/test", true) == 0) // << The '0' doesn't seems to be connected to the bug.
{
new str[128];
new ZeroA = 0;
new ZeroB = 0;
format(str, sizeof(str), "Test: %i", ZeroA/ZeroB);
SendClientMessage(playerid, 0xFFFFFFFF, str);
return 1;
}
return 0;
}
Now, i want to ask you to try a code like that, and to see if it does returns Unknown Command.
Overall problem is that it doesn't returns 0;
It makes the command crashes / return the command as 0 (Undefined).
Please post your results here.
If you don't know don't post.
thanks, InferNus`