SA-MP Forums Archive
Invalid Expression assumed Zero - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Invalid Expression assumed Zero (/showthread.php?tid=412643)



Invalid Expression assumed Zero - Blackazur - 02.02.2013

Код:
	        if(strfind(text, ":", true) != -1) {
	            new i_numcount, i_period, i_pos;
	            while(text[i_pos]) {
	                if('0' <= text[i_pos] <= '9') i_numcount ++;
	                else if(text[i_pos] == '.') i_period ++;
	                i_pos++;
	            }
	            }
	                if(i_numcount >= 8 && i_period >= 3) {
          			format(str,144,"«| %s Has Been Banned! [Reason: Advertisement] |»",PlayerName[playerid]);
                    SendClientMessageToAll(COLOR_HAUT,str);
                    SendClientMessage(playerid,0xFF997FFF,"«| You're banned from Zombies Vs Survivors [ZvS]! |»");
                    SendClientMessage(playerid,0xFF997FFF,"«| You Want To Get Unbanned? Post An Unban-Appeal On Our Website: www.Zombie-Opr.tk |»");
                    SendClientMessage(playerid,0xFF997FFF,"«| Press F8 To Take An Picture! |»");
                    Ban(playerid);
	                return 0;
	}
	return 0;
}
new i_numcount, i_period, i_pos; - Invalid Expression assumed Zero
if(i_numcount >= 8 && i_period >= 3) { - undefined Symbol "i_numcount"

Know everyone an Answer?


Re: Invalid Expression assumed Zero - Roach_ - 02.02.2013

Try this:
pawn Код:
if(strfind(text, ":", true) != -1)
{
    new i_numcount, i_period, i_pos;
    while(text[i_pos])
    {
        if('0' <= text[i_pos] <= '9') i_numcount ++;
        else if(text[i_pos] == '.') i_period ++;
        i_pos++;
    }
    if(i_numcount >= 8 && i_period >= 3)
    {
        format(str, 144, "«| %s Has Been Banned! [Reason: Advertisement] |»", PlayerName[playerid]);
        SendClientMessageToAll(COLOR_HAUT, str);
        SendClientMessage(playerid, 0xFF997FFF, "«| You're banned from Zombies Vs Survivors [ZvS]! |»");
        SendClientMessage(playerid, 0xFF997FFF, "«| You Want To Get Unbanned? Post An Unban-Appeal On Our Website: http://www.Zombie-Opr.tk |»");
        SendClientMessage(playerid, 0xFF997FFF, "«| Press F8 To Take An Picture! |»");
        Ban(playerid);
    }
    return 0;
}



AW: Invalid Expression assumed Zero - Blackazur - 02.02.2013

Work not then i get Bracketerrors.


Re: Invalid Expression assumed Zero - Vince - 02.02.2013

Then you screwed up elsewhere. That code Roach_ posted looks perfectly fine to me.