SA-MP Forums Archive
[FilterScript] [FS] More wanted level stars - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [FS] More wanted level stars (/showthread.php?tid=63167)



[FS] More wanted level stars - Slice - 26.01.2009

Hey,
I noticed a while ago that ] becomes a star in one of the fonts, so I did some positioning and stuff.. This is the result:

http://slice.pastebay.org/19134

Код:
#include <a_samp>

#pragma tabsize 4

// ------------------------------------
// Extended wanted level FS, by Slice
// ------------------------------------

new bool:gme;

public OnGameModeInit()
{
	if ( gme )
		DoInit();
	
	gme = false;
	
	new playerid;
	
	for ( playerid = 0; playerid < GetMaxPlayers(); playerid++ )
		SetPlayerWantedLevel( playerid, 0 );

	return 1;
}

public OnGameModeExit  () { gme = true; DoExit(); return 1; }
public OnFilterScriptInit() {       DoInit(); return 1; }
public OnFilterScriptExit() {       DoExit(); return 1; }

#define WLCheck(%1) if ( GetPlayerWantedLevel( playerid ) >= %1 ) TextDrawShowForPlayer( playerid, tStar%1 ); else TextDrawHideForPlayer( playerid, tStar%1 )

new Text:tStar7, Text:tStar8, Text:tStar9, Text:tStar10, Text:tStar11, Text:tStar12, UPDTimer;

Text:CreateStarTD( starnum )
{
	new Text:tStar = TextDrawCreate( 503.5 - ( 18 * ( starnum - 7 ) ), 102.1, "]" );
	
	TextDrawColor     ( tStar, 0x906210FF );
	TextDrawBackgroundColor( tStar, 0x000000AA );
	TextDrawFont      ( tStar,     2 );
	TextDrawSetShadow   ( tStar,     0 );
	TextDrawSetProportional( tStar,    true );
	TextDrawLetterSize   ( tStar, 0.6, 2.4 );
	TextDrawAlignment   ( tStar,     3 );
	TextDrawSetOutline   ( tStar,     1 );
	
	return tStar;
}

DoInit()
{
	tStar7 = CreateStarTD( 7 );
	tStar8 = CreateStarTD( 8 );
	tStar9 = CreateStarTD( 9 );
	tStar10 = CreateStarTD( 10 );
	tStar11 = CreateStarTD( 11 );
	tStar12 = CreateStarTD( 12 );
	
	UPDTimer = SetTimer( "Wlevel_UPD", 250, 1 );
}

DoExit()
{
	TextDrawDestroy( tStar7 );
	TextDrawDestroy( tStar8 );
	TextDrawDestroy( tStar9 );
	TextDrawDestroy( tStar10 );
	TextDrawDestroy( tStar11 );
	TextDrawDestroy( tStar12 );
	
	KillTimer( UPDTimer );
}

forward Wlevel_UPD();
public Wlevel_UPD()
{
	new playerid;
	
	for ( playerid = 0; playerid < GetMaxPlayers(); playerid++ )
	{
		WLCheck(7);
		WLCheck(8);
		WLCheck(9);
		WLCheck(10);
		WLCheck(11);
		WLCheck(12);
	}
}
It's pretty simple to use, load the filterscipt and use the SetPlayerWantedLevel function. In this script the limit of stars is 12 (6 extra), but it's not that hard to increase/decrease.



Share, modify, steal or whatever you want.

Edit: Pastebin post died, added another one.


Re: [FS] More wanted level stars - Shadowww - 26.01.2009

screenshit?


Re: [FS] More wanted level stars - Slice - 26.01.2009

Added.


Re: [FS] More wanted level stars - tomnidi - 26.01.2009

Look nice!


Re: [FS] More wanted level stars - Dinero - 27.01.2009

Not bad.


Re: [FS] More wanted level stars - Jese - 27.01.2009

looks cool.


Re: [FS] More wanted level stars - Mikep - 27.01.2009

Ooh nice


Re: [FS] More wanted level stars - [MF]FACE - 27.01.2009

very useful
thanks !


Re: [FS] More wanted level stars - MenaceX^ - 27.01.2009

Cool =D
I like the Idea


Re: [FS] More wanted level stars - eXtreme72 - 27.01.2009

Hehe, nice idea. Will use this.