SA-MP Forums Archive
[HELP] Whats wrong? - 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: [HELP] Whats wrong? (/showthread.php?tid=138432)



[HELP] Whats wrong? - Thrarod - 01.04.2010

I got a code that makes you lose wanted level but I got errors
Код:
	public PayHour()
	{
	for(new i =0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i)) {
		  if (GetPlayerWantedLevel(i) >=1) {
			SetPlayerWantedLevel(i, GetPlayerWantedLevel(i) - 1;
			SendClientMessage(i, 0xFFFF00FF, "[Wanted] You lost 1 wanted level");
			}
		else {
			return 1;
			}
	}
	}
And errors
Код:
C:\Counter-Strike 2D\BlueberryFR\gamemodes\SFFreeroam3.0.pwn(608) : warning 235: public function lacks forward declaration (symbol "PayHour")
C:\Counter-Strike 2D\BlueberryFR\gamemodes\SFFreeroam3.0.pwn(614) : error 001: expected token: ",", but found ";"
C:\Counter-Strike 2D\BlueberryFR\gamemodes\SFFreeroam3.0.pwn(622) : error 030: compound statement not closed at the end of file (started at line 610)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: [HELP] Whats wrong? - Thrarod - 01.04.2010

Noany helP?


Re: [HELP] Whats wrong? - Micko9 - 01.04.2010

Quote:
Originally Posted by Thrarod
I got a code that makes you lose wanted level but I got errors
Код:
	public PayHour()
	{
	for(new i =0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i)) {
		  if (GetPlayerWantedLevel(i) >=1) {
			SetPlayerWantedLevel(i, GetPlayerWantedLevel(i) - 1;
			SendClientMessage(i, 0xFFFF00FF, "[Wanted] You lost 1 wanted level");
			}
		else {
			return 1;
			}
	}
	}
And errors
Код:
C:\Counter-Strike 2D\BlueberryFR\gamemodes\SFFreeroam3.0.pwn(608) : warning 235: public function lacks forward declaration (symbol "PayHour")
C:\Counter-Strike 2D\BlueberryFR\gamemodes\SFFreeroam3.0.pwn(614) : error 001: expected token: ",", but found ";"
C:\Counter-Strike 2D\BlueberryFR\gamemodes\SFFreeroam3.0.pwn(622) : error 030: compound statement not closed at the end of file (started at line 610)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
and you a big scripter lolz!

pawn Код:
public PayHour()
    {
    for(new i =0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i)) {
          if (GetPlayerWantedLevel(i) >=1) {
            SetPlayerWantedLevel(i, GetPlayerWantedLevel(i) - 1); // ya forgot ')'
            SendClientMessage(i, 0xFFFF00FF, "[Wanted] You lost 1 wanted level");
            }
         else {
            return 1;
            }
    }
    }



Re: [HELP] Whats wrong? - aircombat - 01.04.2010

Код:
public PayHour()
	{
	for(new i =0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i)) {
		  if (GetPlayerWantedLevel(i) >=1) {
			SetPlayerWantedLevel(i, GetPlayerWantedLevel(i) - 1);
			SendClientMessage(i, 0xFFFF00FF, "[Wanted] You lost 1 wanted level");
			}
		else {
			return 1;
			}
	}
	}



Re: [HELP] Whats wrong? - Whitetiger - 01.04.2010

try

Код:
forward PayHour();
public PayHour()
{
	for(new i =0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i)) {
		  if (GetPlayerWantedLevel(i) >=1) {
			SetPlayerWantedLevel(i, GetPlayerWantedLevel(i) - 1);
			SendClientMessage(i, 0xFFFF00FF, "[Wanted] You lost 1 wanted level");
      } else {
			return 1;
      }
	  }
  }
  return 1;
}
indention is not right in this, but you can fix it im sure


Re: [HELP] Whats wrong? - Thrarod - 02.04.2010

I fixed it with some time, thx