SA-MP Forums Archive
Help With Decreasing Wanted Levels - 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 With Decreasing Wanted Levels (/showthread.php?tid=195558)



Help With Decreasing Wanted Levels - <Weponz> - 03.12.2010

Ok im trying to make wanted levels decrease every 4 mins from level 9 to 0 and im trying to do it without someone showing me xD

But im getting a error:

Код:
C:\Users\Weponz\Desktop\Server Files\gamemodes\TESTING.pwn(22) : error 036: empty statement
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Now im not even sure if this is the right way to do this but i thought about it and it looks like it could work.

Can someone 1st help me with the error and if i am doing it wrong state what im doing wrong please

And ive started on 9 to 8 the other timers are just there cause it compiles regardless

Heres the code:

pawn Код:
#include <a_samp>

public OnGameModeInit()
{
    SetTimer("wanted9to8",240000,false);
    SetTimer("wanted8to7",240000,false);
    SetTimer("wanted7to6",240000,false);
    SetTimer("wanted6to5",240000,false);
    SetTimer("wanted5to4",240000,false);
    SetTimer("wanted4to3",240000,false);
    SetTimer("wanted3to2",240000,false);
    SetTimer("wanted2to1",240000,false);
    SetTimer("wanted1to0",240000,false);
   
    return 1;
}

forward wanted9to8(playerid);
public wanted9to8(playerid)
{
 GetPlayerWantedLevel(playerid);
 if(GetPlayerWantedLevel(playerid) == 9);//Line 22
 SetPlayerWantedLevel(playerid, 8);
 SendClientMessage(playerid, 0x0,"[WANTED] You Have Lost A Wanted Level![Level 8]");

 return 1;
 
}
I commented the line with the error line 22

Thanks in advanced!


Re: Help With Decreasing Wanted Levels - Retardedwolf - 03.12.2010

What is line 21 doing? and if statements don't end with a semicolon AKA ';'


Re: Help With Decreasing Wanted Levels - Steven82 - 03.12.2010

Try doing it like this, i havent test it, but if it doesn't work so me the errors.

pawn Код:
if(GetPlayerWantedLevel(playerid) == 9);
{
 SetPlayerWantedLevel(playerid,8);
 SendClientMessage(playerid, 0x0,"[WANTED] You Have Lost A Wanted Level![Level 8]");
}



Re: Help With Decreasing Wanted Levels - <Weponz> - 03.12.2010

@ Steven82

Thanks,

I still get the "Empty Statement" error.

EDIT:

@ Retardedwolf

Thanks dude,

I just typed it up quick,And i didnt know that about if statements xD

Thanks Guys!

Compiles


Re: Help With Decreasing Wanted Levels - Retardedwolf - 03.12.2010

pawn Код:
forward wanted9to8 ( playerid );
public wanted9to8  ( playerid )
{
    if ( GetPlayerWantedLevel ( playerid ) == 9 )
    {
        SetPlayerWantedLevel ( playerid, 8 );
        SendClientMessage ( playerid, 0xFFFFFFAA,"[WANTED] You have lost a wanted level![Level 8]");
    }
    return 1;
}



Re: Help With Decreasing Wanted Levels - <Weponz> - 03.12.2010

Thanks man edited my post i missed ur reply the 1st time and seen it the second


Re: Help With Decreasing Wanted Levels - Steven82 - 03.12.2010

Well dang i guess im getting tired well im off the forums for the night, Retardedwolf, i'll get you next time.