24.02.2012, 19:01
Hello, I have tried converting to the new PlayAudioStreamForPlayer and StopAudioStreamForPlayer but I got this error:
pawn Код:
if(strcmp(cmd, "/play", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 99998)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, WHITE, "[SYNTAX] /play [audioid] (or use -1 to turn it off)");
new audioid = strval(tmp);
if(audioid == -1)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
StopAudioStreamForPlayer(i);
}
SendClientMessageToAll(WHITE, "Music stopped.");
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gPlayback[i])
{
StopAudioStreamForPlayer(playerid);
audiohandle[i] = PlayAudioStreamForPlayer(i, audioid);//Line 56319
}
}
format(string, sizeof(string), "AdmCmd: Now playing: %s", GetSongName(audioid));
SendClientMessageToAll(LIGHTRED, string);
format(string, sizeof(string), "AdmCmd: %s has started global play for song ID %d, to find out the song name, type /playlist.", PlayerName(playerid), audioid);
SendClientMessageToAll(LIGHTRED, string);
return 1;
}
return 1;
}
if(strcmp(cmd, "/splay", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, WHITE, "[SYNTAX] /splay [audioid] (or use -1 to turn it off)");
new audioid = strval(tmp);
if(audioid == -1)
{
StopAudioStreamForPlayer(playerid);
SendClientMessage(playerid, WHITE, "Music stopped.");
return 1;
}
StopAudioStreamForPlayer(playerid);
audiohandle[playerid] = PlayAudioStreamForPlayer(playerid, audioid);//Line 56342
format(string, sizeof(string), "AdmCmd: Now playing audio ID %d.", audioid);
SendClientMessage(playerid, LIGHTRED, string);
return 1;
}
Код:
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\server\gamemodes\ESRP.pwn(56319) : error 035: argument type mismatch (argument 2) C:\Program Files (x86)\Rockstar Games\GTA San Andreas\server\gamemodes\ESRP.pwn(56342) : error 035: argument type mismatch (argument 2) Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.