[HELP] Whats wrong?
#1

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.
Reply
#2

Noany helP?
Reply
#3

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;
            }
    }
    }
Reply
#4

Код:
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;
			}
	}
	}
Reply
#5

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
Reply
#6

I fixed it with some time, thx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)