Hello Im New Help me please?
#1

Hello Guys i need help with How to i can

SetPlayerWanted(playerid, +1); with colour Yellow
SetPlayerWanted(playerid, +4); Color Orange
? Can you help me?

EDITED: Look Guys i mean when Player Have 4 stars
Код:
SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid)+4);
and 3stars too but yellow.
Reply
#2

Код:
SetPlayerColor(playerid, COLOR_YELLOW); 
SetPlayerColor(playerid, COLOR_ORANGE);
_____________________________________
if i help you REP ME.
Reply
#3

Can you give me Full Code? This Dosn't work!
Reply
#4

You have to define it.
Код:
#define name value
for example:
Код:
#define COLOR_YELLOW 0xFFFF00FF
Reply
#5

ARE You Crazy? I KNOW IT ! I Mean How did player when HAVE 3 Stars Got YELLOW Color and when get 4 got Ornage.... Plesae Understand
Reply
#6

Quote:
Originally Posted by Recardo
Посмотреть сообщение
ARE You Crazy? I KNOW IT ! I Mean How did player when HAVE 3 Stars Got YELLOW Color and when get 4 got Ornage.... Plesae Understand
You mean the color of the player?
SetPlayerColor(playerid, color);
Reply
#7

Quote:
Originally Posted by Recardo
Посмотреть сообщение
ARE You Crazy? I KNOW IT ! I Mean How did player when HAVE 3 Stars Got YELLOW Color and when get 4 got Ornage.... Plesae Understand
Firstly, you have to chill bro'. We are to help you, but we oblige.
So, you want when a player gets 4th stars, his name is orange?

Check this native function called OnPlayerUpdate(playerid)
PHP код:
public OnPlayerUpdate(playerid
This function return something every player's action. So it's usefull to check if the player have 0, 1, ..., 4 stars!
Let's make a condition :
PHP код:
#define COLOR_YELLOW 0xFFFF00FF
#define COLOR_ORANGE 0xff9900FF
public OnPlayerUpdate(playerid)
{
    if(
GetPlayerWantedLevel(playerid) > && GetPlayerWantedLevel(playerid) =< 3// Check if the player has more 0 wanted level AND (&&) if the players have less of 4 wanted level
    
{
        
SetPlayerColor(playeridCOLOR_YELLOW); // So.. We set the player's YELLOW
    
}
    if(
GetPlayerWantedLevel(playerid) > 3// Check again if the player has MORE 3 wanted levels
    
{
        
SetPlayerColor(playeridCOLOR_ORANGE); // Set the player's color in ORANGE
    
}
    return 
1// Return 1 to finish the function

I hope, I helped you. Also you may check the SA:MP's WIKI.
Reply
#8

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
...
That's one way to go about this; however, it is not that efficient. OnPlayerUpdate is called multiple times per second, and it's use isn't needed in this case. As the script knows when a player receives wanted level, the update of the player's color should be done at the same instance. The same way other related updates should be handled.
Reply
#9

Quote:
Originally Posted by KevinReinke
Посмотреть сообщение
That's one way to go about this; however, it is not that efficient. OnPlayerUpdate is called multiple times per second, and it's use isn't needed in this case. As the script knows when a player receives wanted level, the update of the player's color should be done at the same instance. The same way other related updates should be handled.
He is newbie and he needs to understand a very simple way to do this. He can also put this in his command without redefine SetPlayerWantedLevel(playerid);.
Anyway, you are right!
Reply
#10

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
...
With the code I posted, all he has to do is copy/paste it into his script before the native function is used anywhere. And continue to use SetPlayerWantedLevel. I also included comments. It couldn't be any simpler.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)