25.05.2014, 09:42
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
We are done with the includes so let's make wanted levels
First to set a player's wanted level we have to put
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
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 :-
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
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
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!
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>
First to set a player's wanted level we have to put
Code:
SetPlayerWantedLevel(playerid, LEVEL);
For now I will add it in OnPlayerSpawn Like this
Code:
public OnPlayerSpawn(playerid) { SetPlayerWantedLevel(playerid, Level); return 1; }
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
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);
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);
End :-
Thank you all to read this tutorial I will be back with some awesome tutorial
Bye Guyz!