02.12.2011, 13:56
Well.. As you see - I am still learning Pawno language.. Anyway - I Was checking some basic Scripts and i found this :
i Really got no idea what : EOS - Offset - idx - idx++ - new length = strlen(cmdtext); means and do ? I Tried reading wiki.samp but.. it's really complicated , Anyway - Any help would be Appreicated
PHP код:
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /report [text]");
return 1;
}