SA-MP Forums Archive
Little error. Having this many times - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Little error. Having this many times (/showthread.php?tid=134149)



Little error. Having this many times - bartje01 - 15.03.2010

Hey guys. When I use this:
Код:
	}

	if (strcmp("/policetolsv", cmdtext, true, 10) == 0)
	{
	if(PlayerInfo[playerid][Warperm] > 1)
	GangZoneDestroy(LspZone);
  LspZone = GangZoneCreate(1326.343, -1887.144, 1702.824, -1575.273);
  	GangZoneShowForAll( LspZone, 0xFFFF00AA);
  	else
  	SendClientMessage(playerid,red,"You don't have any gang perms");

	

	return 1;
	}
It tells me this
Код:
C:\Users\Bart\Desktop\samp server\filterscripts\ladmin4v2.pwn(5759) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.



Re: Little error. Having this many times - Correlli - 15.03.2010

You should really learn some basic things first, your code is very messy and i don't even know what do you want to do with it..


Re: Little error. Having this many times - bartje01 - 15.03.2010

Well, this is the wrong thing

else
SendClientMessage(playerid,red,"You don't have any gang perms");

It gives the errors when I put else in


Re: Little error. Having this many times - Sascha - 15.03.2010

Quote:
Originally Posted by bartje01
Hey guys. When I use this:
Код:
	}

	if (strcmp("/policetolsv", cmdtext, true, 10) == 0)
	{
	if(PlayerInfo[playerid][Warperm] > 1)
	GangZoneDestroy(LspZone);
  LspZone = GangZoneCreate(1326.343, -1887.144, 1702.824, -1575.273);
 	GangZoneShowForAll( LspZone, 0xFFFF00AA);
 	else
 	SendClientMessage(playerid,red,"You don't have any gang perms");

	

	return 1;
	}
It tells me this
Код:
C:\Users\Bart\Desktop\samp server\filterscripts\ladmin4v2.pwn(5759) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
uhm...good to know which line is the error line well...firstly change it to:

if (strcmp("/policetolsv", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][Warperm] >= 1){
GangZoneDestroy(LspZone);
LspZone = GangZoneCreate(1326.343, -1887.144, 1702.824, -1575.273);
GangZoneShowForAll(LspZone, 0xFFFF00AA);
}else{
SendClientMessage(playerid,red,"You don't have any gang perms");
}
return 1;
}


Re: Little error. Having this many times - biltong - 15.03.2010

pawn Код:
if (strcmp("/policetolsv", cmdtext, true, 10) == 0)
    {
    if(PlayerInfo[playerid][Warperm] > 1)
    {
      GangZoneDestroy(LspZone);
      LspZone = GangZoneCreate(1326.343, -1887.144, 1702.824, -1575.273);
      GangZoneShowForAll(LspZone, 0xFFFF00AA);
    }
    else SendClientMessage(playerid,red,"You don't have any gang perms");
    return 1;
    }
L2bracket.

EDIT: Ninja'd. Either post will probably work.


Re: Little error. Having this many times - bartje01 - 15.03.2010

Thx guys



Re: Little error. Having this many times - biltong - 15.03.2010

Seriously, learn to use brackets.


Re: Little error. Having this many times - Correlli - 15.03.2010

Quote:
Originally Posted by biltong
Seriously, learn to use brackets.
Not only that, he should also learn some basics like i already mentioned before.

Quote:
Originally Posted by bartje01
pawn Код:
if (strcmp("/policetolsv", cmdtext, true, 10) == 0)
{
  // other code
}
/policetolsv has 12 characters, not 10.

So this would be correct:
pawn Код:
if(strcmp("/policetolsv", cmdtext, true, 12) == 0)
{
  // other code
}
or:
pawn Код:
if(strcmp("/policetolsv", cmdtext, true) == 0)
{
  // other code
}



Re: Little error. Having this many times - biltong - 15.03.2010

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by biltong
Seriously, learn to use brackets.
Not only that, he should also learn some basics like i already mentioned before.

Quote:
Originally Posted by bartje01
pawn Код:
if (strcmp("/policetolsv", cmdtext, true, 10) == 0)
{
  // other code
}
/policetolsv has 12 characters, not 10.

So this would be correct:
pawn Код:
if(strcmp("/policetolsv", cmdtext, true, 12) == 0)
{
  // other code
}
or:
pawn Код:
if(strcmp("/policetolsv", cmdtext, true) == 0)
{
  // other code
}
Thank you for showing me what that number means, lol I didn't know that. ZCMD has made me lazy -.-