SA-MP Forums Archive
Question about nick color and login? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Question about nick color and login? (/showthread.php?tid=238013)



Question about nick color and login? - GBLTeam - 10.03.2011

I want to add colors for some org...

Im using LA-RP.

What i want? I want to make when someone is wanted have wl level from police, his nick to be red and on map
to can see him and i want to add FBI to be blue and on map to be blue? when they go to duty to use that color
and when warn someone add him wanted level he to get red.



And the other thing is when i connect in server to look like this ? How to make it like this?





Really i need this. Please help me!

Thanks..


Re: Question about nick color and login? - xRyder - 10.03.2011

For your second question:

That's just few black textdraws.
Use this to make something like that. I guess you'll have to play around with that FS if you haven't used it before but it's really simple.


Re: Question about nick color and login? - Skylar Paul - 11.03.2011

Well, if you have a /suspect (i'm assuming you're using a godfather edit) command...

1: Create a variable
pawn Код:
new player_WantedLevel[MAX_PLAYERS] = 0;
2: Get their wanted level using GetPlayerWantedLevel and then set a variable to 1.
pawn Код:
new WantedLevel = GetPlayerWantedLevel(playerid);
if(WantedLevel == 6) return
    player_WantedLevel[playerid] = 6;
3: In OnPlayerStreamIn, set their marker color, and make it visible.
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
    if(player_WantedLevel == 6)
    {
        if(//Check if their in the FBI(?) here.)
        {
            SetPlayerMarkerForPlayer(playerid, forplayerid, 0xFF0000FF );
            printf("ID %d now sees ID %d as a red marker.");
            return 1;
        }
    }
    return 1;
}
Something along the lines of this; I'm a bit rusty in the scripting area, but this should work.


Re: Question about nick color and login? - GBLTeam - 11.03.2011

Quote:
Originally Posted by Skylar Paul
Посмотреть сообщение
Well, if you have a /suspect (i'm assuming you're using a godfather edit) command...

1: Create a variable
pawn Код:
new player_WantedLevel[MAX_PLAYERS] = 0;
2: Get their wanted level using GetPlayerWantedLevel and then set a variable to 1.
pawn Код:
new WantedLevel = GetPlayerWantedLevel(playerid);
if(WantedLevel == 6) return
    player_WantedLevel[playerid] = 6;
3: In OnPlayerStreamIn, set their marker color, and make it visible.
pawn Код:
public OnPlayerStreamIn(playerid, forplayerid)
{
    if(player_WantedLevel == 6)
    {
        if(//Check if their in the FBI(?) here.)
        {
            SetPlayerMarkerForPlayer(playerid, forplayerid, 0xFF0000FF );
            printf("ID %d now sees ID %d as a red marker.");
            return 1;
        }
    }
    return 1;
}
Something along the lines of this; I'm a bit rusty in the scripting area, but this should work.
Btw im using LA-RP? Can you tell me for larp.


Suspect command:

pawn Код:
//----------------------------------[SetCrim]-----------------------------------------------
    if(strcmp(cmd, "/suspect", true) == 0 || strcmp(cmd, "/su", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 2 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 1 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pMember] == 11 || OnDuty[playerid] == 1 && PlayerInfo[playerid][pLeader] == 11) { }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   Niste na duznosti!");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [opis zlocina]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (gTeam[playerid] == 2 || IsACop(playerid))
            {
                if(IsPlayerConnected(giveplayerid))
                {
                    if(giveplayerid != INVALID_PLAYER_ID)
                    {
                        if (gTeam[giveplayerid] != 2)
                        {
                            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                            GetPlayerName(playerid, sendername, sizeof(sendername));
                            new length = strlen(cmdtext);
                            while ((idx < length) && (cmdtext[idx] <= ' '))
                            {
                                idx++;
                            }
                            new offset = idx;
                            new result[64];
                            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                            {
                                result[idx - offset] = cmdtext[idx];
                                idx++;
                            }
                            result[idx - offset] = EOS;
                            if(!strlen(result))
                            {
                                SendClientMessage(playerid, COLOR_GRAD2, "Koriscenje: (/su)spect [ID Igraca/Dio Imena] [crime text]");
                                return 1;
                            }
                            if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
                            else { WantedPoints[giveplayerid]+= 2; }
                            SetPlayerCriminalEx(giveplayerid,playerid, result);
                            return 1;
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "   Ne mozete optuziti policajca !");
                        }
                    }
                }
                else
                {
                        format(string, sizeof(string), "   %d nije aktivan igrac.", giveplayerid);
                        SendClientMessage(playerid, COLOR_GRAD1, string);
                        return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GRAD2, "   Niste Policajac / FBI / Swat !");
            }
        }
        return 1;
    }