06.12.2011, 08:51
(
Последний раз редактировалось Killa[DGZ]; 06.12.2011 в 08:59.
Причина: typo
)
Hi all, im trying to set up a function which i can use to handle a string & X, Y, Z, Distance values for (PlayAudioStreamForPlayer) which is called from a cmd...
Anywayz here is the code i have no idea whats up with it, all i get is four tag mismatches, on this line below
StreamAudioAtPositionForAll(string, pX, pY, pZ, 10.0);//which is in the cmd
i have been muckin around with it for hours an im just hoping someone can point it out for me or say if this kinda thing is even possible, Thanks
Anywayz here is the code i have no idea whats up with it, all i get is four tag mismatches, on this line below
StreamAudioAtPositionForAll(string, pX, pY, pZ, 10.0);//which is in the cmd
pawn Код:
//------------[Command>StreamAudio<]------------
if(strcmp(cmd, "/startposstream", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if (PlayerStats[playerid][Adminz] < 6)
{
SendClientMessage(playerid, COLOR_GREY, "You must be admin to use this command");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
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: /startposstream [url]");
return 1;
}
format(string, sizeof(string), "%s", result);
new Float:pX, Float:pY, Float:pZ;
GetPlayerPos(playerid, pX, pY, pZ);
StreamAudioAtPositionForAll(string, pX, pY, pZ, 10.0);
}
return 1;
}
//------------[Function>StreamAudio<]------------
forward StreamAudioAtPositionForAll(string[], X, Y, Z, Distance);
public StreamAudioAtPositionForAll(string[], X, Y, Z, Distance)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayAudioStreamForPlayer(i, string, X, Y, Z, Distance, 1);
}
}
}