07.10.2017, 06:58
I was trying to fix a bug when player put "%" symbol in a dialog it will crash the server
OnDialogResponse :
But when I was trying to compile the script it says :
I've tried everything that I know, can you guys help me with this error?
OnDialogResponse :
PHP код:
if(dialogid == DIALOG_STREAMBOX)
{
new string[MAX_PLAYERS];
if(response)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
for(new s; s < strlen(inputtext); s++)
{
if(inputtext == "%")
{
inputtext = "#";
}
format(string, sizeof(string), "[DEEJAY] %s have play a song from | Url: %s", IsPlayerName(playerid), inputtext);
SendClientMessage(i, 0x00FFCCAA, string);
StopAudioStreamForPlayer(i);
SendClientMessage(i, -1, "================================");
PlayAudioStreamForPlayer(i, inputtext);
SendClientMessage(i, -1, "================================");
SendClientMessage(i, 0x00FF99AA, "Use /stopmusic if you want to stop the song from playing");
}
}
}
return 1;
}
Код:
C:\Users\USER\Desktop\Server Scripts\GM\MYGM.pwn(2131) : error 033: array must be indexed (variable "inputtext") C:\Users\USER\Desktop\Server Scripts\GM\MYGM.pwn(2133) : error 046: unknown array size (variable "inputtext") C:\Users\USER\Desktop\Server Scripts\GM\MYGM.pwn(2133) : warning 215: expression has no effect Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.