SA-MP Forums Archive
Whats Wrong Here? - 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: Whats Wrong Here? (/showthread.php?tid=66149)



Whats Wrong Here? - CJ101 - 19.02.2009

Код:
C:\PROGRA~1\ROCKST~1\GAMEMO~1\sftdm.pwn(2039) : error 001: expected token: ";", but found "{"
C:\PROGRA~1\ROCKST~1\GAMEMO~1\sftdm.pwn(2041) : error 010: invalid function or declaration
C:\PROGRA~1\ROCKST~1\GAMEMO~1\sftdm.pwn(2045) : error 054: unmatched closing brace ("}")
C:\PROGRA~1\ROCKST~1\GAMEMO~1\sftdm.pwn(2049) : error 054: unmatched closing brace ("}")
Code:

Код:
SetTimer("WantedCheck", 1000, true);
forward WantedCheck();



public WantedCheck
{

if GetPlayerWantedLevel(playerid) > 0)
{
SendClientMessage(playerid, COLOR_RED, "== Lose Your Stars, fool!");

}



}



Re: Whats Wrong Here? - Grim_ - 19.02.2009

try this:
pawn Код:
public WantedCheck()
{
 for(new i=0; i<MAX_PLAYERS; i++)
 {
   if(GetPlayerWantedLevel(i) > 0)
   {
    SendClientMessage(i, COLOR_RED, "== Lose Your Stars, fool!");
   }
 }
}
but remember that that will send the player a message every second if their wanted level is greater than 0.
You may want to make a variable to check if it has already sent the message to the player.


Re: Whats Wrong Here? - CJ101 - 19.02.2009

ok got it one question though..

|| is or right?


Re: Whats Wrong Here? - Grim_ - 19.02.2009

Quote:
Originally Posted by cj101
ok got it one question though..

|| is or right?
what?..


Re: Whats Wrong Here? - CJ101 - 19.02.2009

if i want to say

if WantedLevel = 4 or 5

or dont work.. what do i put there?


Re: Whats Wrong Here? - Grim_ - 19.02.2009

i think i understand what your trying to say...sorry if not:
pawn Код:
public WantedCheck()
{
 for(new i=0; i<MAX_PLAYERS; i++)
 {
   if(GetPlayerWantedLevel(i) == 1)
   {
    SendClientMessage(i, COLOR_RED, "You now have one star wanted level!");
   }
   else if(GetPlayerWantedLevel(i) == 2)
   {
    SendClientMessage(i, COLOR_RED, "You now have a two star wanted level!");
   }
   else if(GetPlayerWantedLevel(i) == 3)
   {
    //and so on
   }
 }
}



Re: Whats Wrong Here? - Mikep - 20.02.2009

Why?

pawn Код:
public WantedCheck()
{
  for(new i=0; i<MAX_PLAYERS; i++)
  {
    if(GetPlayerWantedLevel(i) == 4 || GetPlayerWantedLevel(i) == 5)
    {
      //Do stuff
    }
  }
  return 1;
}