30.01.2012, 18:33
(
Последний раз редактировалось Hardware; 30.01.2012 в 19:09.
)
@edit
O cуdigo de antes nгo estava funcionando. Agora eu testei e funciona:
Caso dк erro ali no strrest, coloque isso:
O cуdigo de antes nгo estava funcionando. Agora eu testei e funciona:
pawn Код:
if(strcmp(cmd, "/tocar", true) == 0)
{
new str[128];
str = strrest(cmdtext,idx);
if(!strlen(str)) return SendClientMessage(playerid, -1, "Use: /tocar [url]");
PlayAudioStreamForPlayer(playerid, str, 0, 0, 0, 20, 0);
return 1;
}
pawn Код:
stock strrest(const string[], &index)
{
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[128];
while ((index < length) && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
return result;
}