Were to put this?
#1

HI. Need Help

I don't know were to put this:
PHP код:
            if(GetPlayerWantedLevel(playerid) == && GetPlayerWantedLevel(playerid) == 2)
            {
                
SetPlayerColor(playeridBOJA_ZUTA);
            }
            else if(
GetPlayerWantedLevel(playerid) == 3)
            {
                
SetPlayerColor(playeridBOJA_NARANDASTA);
            }
            else if(
GetPlayerWantedLevel(playerid) == && GetPlayerWantedLevel(playerid) == 5)
            {
                
SetPlayerColor(playeridBOJA_CRVENA);
            }
            else if(
GetPlayerWantedLevel(playerid) >= )
            {
                
SetPlayerColor(playeridBOJA_CRNA);
            } 
Anybody know were?

Thanks!!
Reply
#2

well dude we don't know what u want to do that code and u shouldnt just copy and paste u should start by learning basics with http://wiki.sa-mp.com
Reply
#3

This is a TOTAL copy, but, if you really want it to update all the time, put it under OnPlayerUpdate( playerid ).

I am assuming you are using a GodFather edit.
Reply
#4

@aircombat I want it to change player color if he has wanted level. I know the basics

@Mean NO its not a copy I wrote it I just don't know were to put it and i'm not using godfather edit
and btw thanks it worked!

ps. godfather sucks
Reply
#5

this action can never get triggered, coz GetPlayerWantedLevel will return either 1 OR 2. so the logical AND ( && ) is making it impossible:
Код:
            if(GetPlayerWantedLevel(playerid) == 1 && GetPlayerWantedLevel(playerid) == 2)
a small fix, the logical OR ( || ) will do the trick:
Код:
            if(GetPlayerWantedLevel(playerid) == 1 || GetPlayerWantedLevel(playerid) == 2)
hm... and i guess this is supposed to be in the OnPlayerSpawn(playerid); coz its the only callback i can imagine where you need to set a players color... ah, since there are wanted levels, there are crimes to commit - seek all callbacks where a player can "gain" some wanted levels... like in the OnPlayerDeath() after setting the WantedLevel for the killerid, in a Command like /rob /rape /infect, or even the OnPlayerStateChange() in some certain vehiclemodel ids...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)