SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 07/07/2017, 10:24 PM   #1
s3ek
Big Clucker
 
Join Date: Dec 2013
Posts: 164
Reputation: 3
Default invalid expression, assumed zero

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.

PHP Code:
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(cmdstrsizeof(cmdstr), "Administrator %s (ID:%d) has started the Global Playback of{FFFFFF} %s"FormatName(playerid), playeridURL);
    
SendClientMessageToAll(COLOR_ORANGEcmdstr);
    
SendClientMessageToAll(COLOR_YELLOW"/stop to stop..");
    }
    else return 
SendClientMessage(playeridyellow"Sorry");
    return 
1;

line is:
Code:
new URL[250];
s3ek is offline   Reply With Quote
Old 07/07/2017, 10:45 PM   #2
s3ek
Big Clucker
 
Join Date: Dec 2013
Posts: 164
Reputation: 3
Default Re: invalid expression, assumed zero

Quote:
Originally Posted by [HLF]Southclaw View Post
`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
s3ek is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Help] invalid expression, assumed zero Doniczzz Scripting Help 1 25/10/2016 06:05 AM
invalid expression, assumed zero Bondz Scripting Help 12 16/10/2016 03:53 PM
error 029: invalid expression, assumed zero & warning 215: expression has no effect tboysamp Scripting Help 3 23/03/2015 05:49 PM
Invalid Expression assumed Zero Blackazur Scripting Help 3 07/07/2013 08:42 PM
invalid expression, assumed zero Stanford Scripting Help 0 20/02/2013 06:02 AM


All times are GMT. The time now is 12:00 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.