[Tutorial] How to make wanted level's with colors
#1

Firstly I am Very sorry for my last Tutorial Because it was very bad.

Introduction:-

Today I will teach you all how to make wanted level with colors and also a command of how to set a player's wanted level.

Requirements:-

Sscanf2 :- http://forum.sa-mp.com/showthread.ph...hlight=sscanf2
Zcmd :- https://sampforum.blast.hk/showthread.php?tid=91354

Let's Get Started:-

So first you will need to add these lines at the top.
they are includes we will use in our script
Code:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
We are done with the includes so let's make wanted levels

First to set a player's wanted level we have to put
Code:
SetPlayerWantedLevel(playerid, LEVEL);
So by our colors you can add this line where ever you need to give a player wanted level.
For now I will add it in OnPlayerSpawn Like this
Code:
public OnPlayerSpawn(playerid)
{
SetPlayerWantedLevel(playerid, Level);
return 1;
}
So level's means which level or how many starts 1 2 3 4 5 or 6.

So we will make a color pattern like this 1,2,3 = Yellow Color
4= Orange Color
5,6 = Red Color

So for the colors We need to define them like this :-
Code:
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_ORANGE 0xFFA500FF
#define COLOR_RED 0xFF0000FF
So now we have set wanted level when the player spawns

Now you need to find public OnPlayerUpdate(playerid)
If its not in your script you need to make it like this
[CODE]public OnPlayerUpdate(playerid)
{
return 1;
}/CODE]

So below OnPlayerUpdate we will add this
Code:
if(GetPlayerWantedLevel(playerid) == 0) return SetPlayerColor(playerid, -1);
if(GetPlayerWantedLevel(playerid) == 1) return SetPlayerColor(playerid, COLOR_YELLOW);
if(GetPlayerWantedLevel(playerid) == 2) return SetPlayerColor(playerid, COLOR_YELLOW);
if(GetPlayerWantedLevel(playerid) == 3) return SetPlayerColor(playerid, COLOR_YELLOW);
if(GetPlayerWantedLevel(playerid) == 4) return SetPlayerColor(playerid, COLOR_ORANGE);
if(GetPlayerWantedLevel(playerid) == 5) return SetPlayerColor(playerid, COLOR_RED);
if(GetPlayerWantedLevel(playerid) == 6) return SetPlayerColor(playerid, COLOR_RED);
Ok so here we check that if The player's Wanted level is something then set the player's color to something
You can also add your own colors but dont forget to define it

Also We need to clear the player's wanted level when he dies So Just add this in OnPlayerDeath
Code:
SetPlayerWantedLevel(playerid, 0);
So that the player gets no starts

End :-
Thank you all to read this tutorial I will be back with some awesome tutorial
Bye Guyz!
Reply


Messages In This Thread
How to make wanted level's with colors - by rockhopper - 25.05.2014, 09:42
Re: How to make wanted level's with colors - by rockhopper - 25.05.2014, 16:41
Re: How to make wanted level's with colors - by Isolated - 25.05.2014, 16:57
Re: How to make wanted level's with colors - by NaClchemistryK - 25.05.2014, 17:02
Re: How to make wanted level's with colors - by [WSF]ThA_Devil - 30.05.2014, 17:32
Re: How to make wanted level's with colors - by iFarbod - 30.05.2014, 17:50
Re: How to make wanted level's with colors - by SickAttack - 21.10.2014, 02:48
Re: How to make wanted level's with colors - by TwinkiDaBoss - 21.10.2014, 13:27

Forum Jump:


Users browsing this thread: 1 Guest(s)