PDA

View Full Version : invalid expression, assumed zero


s3ek
07/07/2017, 10:24 PM
42877) : error 029: invalid expression, assumed zero
42877) : error 017: undefined symbol "URL"
42877) : warning 215: expression has no effect
42877) : error 001: expected token: ";", but found "]"
42877) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

CMD:play(playerid,params[]){
// if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"This command is only for RCON admins!");
if((PlayerInfo[playerid][Level] >= 9)
{
new URL[250];
if(sscanf(params,"s[250]",URL)) return SendClientMessage(playerid,-1,"{39AACC}USAGE: play [URL]");
for(new i=0;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
PlayAudioStreamForPlayer(i,URL);
}
SendClientMessage(playerid,COLOR_RED,"You have played a song for all players!");
format(cmdstr, sizeof(cmdstr), "Administrator %s (ID:%d) has started the Global Playback of{FFFFFF} %s", FormatName(playerid), playerid, URL);
SendClientMessageToAll(COLOR_ORANGE, cmdstr);
SendClientMessageToAll(COLOR_YELLOW, "/stop to stop..");
}
else return SendClientMessage(playerid, yellow, "Sorry");
return 1;
}

line is:
new URL[250];

s3ek
07/07/2017, 10:45 PM
Southclaw;3899336']`if((PlayerInfo[playerid][Level] >= 9)` count the brackets!

It's a good idea to use a modern IDE such as Sublime, Atom or VS Code which will make it more obvious to you if you have a missing bracket or brace. Check out http://forum.sa-mp.com/showthread.php?t=531379

fixed thanks you friend +1 :)