Most wanted
#1

Hello, is possible to make most wanted player with TextDraw tag? i mean if he killed more than 5 players ? and who kill this most wanted get +10 score and 10000$ how to script ?
Reply
#2

It is possible.
Reply
#3

It's very simple you just need a brain and some fingers, create the textdraw, set his wanted level if his wanted level is 5 or w/e then show him that textdraw, when he dies, check if he has got 5 wanted levels, if yes then give the killerid +10 score and 100k (or w/e u want).
Reply
#4

First you will need to create your textdraws then declarate your vars.
Код:
new pWanted[MAX_PLAYERS];
new Text3D:NameTag;[MAX_PLAYERS];
Under OnPlayerConnect
Код:
pWanted[playerid] = 0;
Under OnPlayerDeath

Код:
pWanted[killerid] += 1;
if(pWanted[killerid] == 5)
{
    SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid)+1);
}
Код:
GetMostWantedPlayer() // Function by SuperVIper
{
    new highPlayerWantedLevel, player = INVALID_PLAYER_ID, wl;
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            wl = GetPlayerWantedLevel(i);
            if(wl > highPlayerWantedLevel)
            {
                highPlayerWantedLevel = wl, player = i;
            }
        }
    }
    return player;
}
Under OnGameModeInit
Код:
SetTimer("checkmostwantedplayer", 1000, true);
Код:
forward checkmostwantedplayer(playerid);
public checkmostwantedplayer()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new score[128], name[MAX_PLAYER_NAME];
            GetPlayerName(i, name, sizeof(name));
            format(score, sizeof(score), "MostWanted: %s(%d)",name, GetPlayerWantedLevel(i));
            NameTag[playerid] = Create3DTextLabel(string, 0xFFFFFFFF, 0, 0, 0, 40, 0, 1 );
            Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.2); // With Label
        }
    }
    return 1;
}
I'm from school so you will need to test
Reply
#5

Quote:
Originally Posted by RenSoprano
Посмотреть сообщение
First you will need to create your textdraws then declarate your vars.
Код:
new pWanted[MAX_PLAYERS];
Under OnPlayerConnect
Код:
pWanted[playerid] = 0;
Under OnPlayerDeath

Код:
pWanted[killerid] += 1;
if(pWanted[killerid] == 5)
{
    SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid)+1);
}
Thanks but i want a Create3DTextLabel
Reply
#6

What you mean with textdraw tag ? you wanna add textdraw above his character/head ?
pawn Код:
new Kills[MAX_PLAYERS];
new bool:MostWanted[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
    Kills[killerid]++;
    Kills[playerid] =0;
    if(Kills[killerid] == 5) MostWanted[killerid] = true;
    if(MostWanted[playerid]) SetPlayerScore(killerid,GetPlayerScore(playerid)+10) && GivePlayerMoney(playerid,1000);
    return 1;
}
EDIT: Ops sorry guys too late , @topic everything is possible in scripting you just need to think on another options maybe similar to the one you want!
Reply
#7

Thanks alot yeah textdraw above the character
Reply
#8

Quote:
Originally Posted by MahdiGames
Посмотреть сообщение
Thanks alot yeah textdraw above the character
No you can't do that , you can use Attach3DTextLabelToPlayer
Reply
#9

So just to add the line "Attach3DTextLabelToPlayer(.. under SetPlayerScore..?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)