Colors. -
CannonBolt - 02.10.2016
Код:
forward WantedLevelColour(playerid);
public WantedLevelColour(playerid)
{
switch(GetPlayerWantedLevel(playerid))
{
case 0: SetPlayerColor(playerid, COLOR_WHITE);
case 1: SetPlayerColor(playerid, COLOR_PURPLE);
default: SetPlayerColor(playerid, COLOR_RED);
}
return 1;
}
Could somebody tell me why this isn't working?
i've it all ways and it still doesn't work.
Re: Colors. -
MCZOFT - 04.10.2016
....
give us more we'll help you more .
you're missing something
where is the stocks of SetPlayerWantedColor .. GetPlayerWanted... where r the
IF conditions on your " OnPlayerUpdate "
Revise your Sctructors
PHP код:
EXAMPLE ....
new
a = 5;
switch (a)
{
case 1:
{
// Won't be called
}
case 2:
{
// Won't be called
}
case 5:
{
// Will be called
}
default:
{
// Won't be called
}
}
i cant do much for you just with 3 randomly Lines...
Good luck
Re: Colors. -
GoldenLion - 04.10.2016
Quote:
Originally Posted by MCZOFT
.... give us more we'll help you more .
you're missing something
where is the stocks of SetPlayerWantedColor .. GetPlayerWanted... where r the IF conditions on your " OnPlayerUpdate "
Revise your Sctructors
PHP код:
EXAMPLE ....
new
a = 5;
switch (a)
{
case 1:
{
// Won't be called
}
case 2:
{
// Won't be called
}
case 5:
{
// Will be called
}
default:
{
// Won't be called
}
}
i cant do much for you just with 3 randomly Lines...
Good luck
|
First of all:
https://sampforum.blast.hk/showthread.php?tid=570635
Second: do you see that he uses SetPlayerColor and GetPlayerWantedLevel, which are the premade functions? Why would he need to make some custom ones?
Third: you copied the switch from SA-MP wiki lol.
Quote:
Originally Posted by CannonBolt
Код:
forward WantedLevelColour(playerid);
public WantedLevelColour(playerid)
{
switch(GetPlayerWantedLevel(playerid))
{
case 0: SetPlayerColor(playerid, COLOR_WHITE);
case 1: SetPlayerColor(playerid, COLOR_PURPLE);
default: SetPlayerColor(playerid, COLOR_RED);
}
return 1;
}
Could somebody tell me why this isn't working?
i've it all ways and it still doesn't work.
|
Where do you call WantedLevelColour? Do you have a timer? Nothing seems to be wrong with your code though...
Re: Colors. -
MCZOFT - 04.10.2016
3 words for you
Learn Algorithms First.
Then talk to me .
surely it's copied example i didn't say i wrote it . so instead of trying to be a hero , solve his problem with the information given or Quit the forum "breow"
Re: Colors. -
GoldenLion - 04.10.2016
Quote:
Originally Posted by MCZOFT
3 words for you
Learn Algorithms First.
Then talk to me .
surely it's copied example i didn't say i wrote it . so instead of trying to be a hero , solve his problem with the information given or Quit the forum "breow"
|
I am trying to help him and stop complaining about my name, watch yourself instead of disrespecting others or just don't even reply if you don't like me. If you reply again, I won't reply to you. This is not a place to act childish.
Re: Colors. -
Crayder - 04.10.2016
Quote:
Originally Posted by MCZOFT
3 words for you
Learn Algorithms First.
Then talk to me .
surely it's copied example i didn't say i wrote it . so instead of trying to be a hero , solve his problem with the information given or Quit the forum "breow"
|
Dude, just leave the fucking Scripting Help section. You aren't helping anyone. In fact, you've lied to this guy.
@CannonBolt: Ignore everything MCZOFT said. Your code is correct, as GoldenLion said. Just answer GoldenLion's question.
Re: Colors. -
CannonBolt - 09.10.2016
Thanks @Crayder.
1. Should i change it to a stock?
2. i place it onplayerspawn as "WantedLevelColour(playerid);"
even when i get stars my color doesn't seem to change.
Re: Colors. -
azzerking - 09.10.2016
May I ask where you are calling this function?
Are you calling it under
OnPlayerUpdate ? Or when they do a specific action?
Re: Colors. -
CannonBolt - 09.10.2016
Quote:
Originally Posted by azzerking
May I ask where you are calling this function?
Are you calling it under OnPlayerUpdate ? Or when they do a specific action?
|
Quote:
Originally Posted by CannonBolt
2. i place it onplayerspawn as "WantedLevelColour(playerid);"
even when i get stars my color doesn't seem to change.
|
Putting this under OnPlayerUpdate is a bad idea.
Re: Colors. -
Crayder - 09.10.2016
Quote:
Originally Posted by CannonBolt
Thanks @Crayder.
1. Should i change it to a stock?
2. i place it onplayerspawn as "WantedLevelColour(playerid);"
even when i get stars my color doesn't seem to change.
|
There is your problem. If you are only calling it when the player spawns it will not change when the wanted level of that player changes.
You should hook SetPlayerWantedLevel and add this line to it. That will be the only time you ever need to call it! Do not call it anywhere else!