Textdraw showing wantedlevel
#1

Greetings samp forums,

I have a question, im trying to make a textdraw under the wanted level stars,
telling the actual wanted level since the max wanted level is 250 on my server.
im thinking of something like this :

http://prntscr.com/98g3n0


Could someone please help me on realizing this?
Reply
#2

I don't know if I got you right but hare:
pawn Код:
Text[playerid] = TextDrawCreate(105.0, 480.0, "[]");
TextDrawFont(Text[playerid], 2);
TextDrawColor(Text[playerid], 0xFFFF800);
TextDrawShowForPlayer(playerid, Text[playerid]);
Reply
#3

i would like to show the wanted level in numbers,
where i placed --wanted here-- something like *LVL*
Reply
#4

oh then you showld make a string with variables
code:
pawn Код:
new Wanted[MAX_PLAYERS];
new PlayerText:Text;

//OnPlayerConnect

Text = CreatePlayerTextDraw(playerid, 480.0, 105.0, " ");
PlayerTextDrawFont(playerid, Text, fontid);
PlayerTextDrawColor(playerid, Text, color);
/*
more like shadow proportional and more if you want...
*/

SetTimerEx("LEVELCHECK", 1000, true, "i", playerid);
PlayerTextDrawShow(playerid, Text);
/////////////////////////////

//////////////////
forward LEVELCHECK(playerid);

public LEVELCHECK(playerid)
{
    new Str[128];
    format(Str, sizeof(Str), "Wanted level: %d", Wanted[playerid]);
    PlayerTextDrawSetString(playerid, Text, Str);
    return 1;
}
////////////////////

//////CMD//////
CMD:test(playerid, params[])
{
    Wanted[playerid] = 1; //or Wanted[playerid] += 1;
    return 1;
}
///////////////
Reply
#5

im already using new Wanted[MAX_PlAYERS]; for something else,
could that be an issue, since its giving me errors on compilation

I'm using new Wantedl[Max_PLAYERS]; for calling the wantedlevel could i simply use that?
Reply
#6

It should work the Wanted[playerid] get how much wanted level you got because we made a string wi don't add
Reply
#7

it didnt work unfortunately.

C:\Users\startklaar\Desktop\LvCnr\gamemodes\lvcnr. pwn(251) : warning 219: local variable "Wanted" shadows a variable at a preceding level
C:\Users\startklaar\Desktop\LvCnr\gamemodes\lvcnr. pwn(254) : error 017: undefined symbol "fontid"
C:\Users\startklaar\Desktop\LvCnr\gamemodes\lvcnr. pwn(255) : error 017: undefined symbol "color"
C:\Users\startklaar\Desktop\LvCnr\gamemodes\lvcnr. pwn(251) : warning 204: symbol is assigned a value that is never used: "Wanted"
C:\Users\startklaar\Desktop\LvCnr\gamemodes\lvcnr. pwn(266) : error 028: invalid subscript (not an array or too many subscripts): "Wanted"
C:\Users\startklaar\Desktop\LvCnr\gamemodes\lvcnr. pwn(266) : warning 215: expression has no effect
C:\Users\startklaar\Desktop\LvCnr\gamemodes\lvcnr. pwn(266) : error 001: expected token: ";", but found "]"
C:\Users\startklaar\Desktop\LvCnr\gamemodes\lvcnr. pwn(266) : error 029: invalid expression, assumed zero
C:\Users\startklaar\Desktop\LvCnr\gamemodes\lvcnr. pwn(266) : fatal error 107: too many error messages on one line
Reply
#8

this should work right?
new PlayerText:Text;
forward LEVELCHECK(playerid);
public LEVELCHECK(playerid)
{
new Str[128];
format(Str, sizeof(Str), "Wanted level: %d", GetPlayerWantedLevel(playerid));
PlayerTextDrawSetString(playerid, Text, Str);
return 1;
}
Reply
#9

How come TextDrawSetShadow(Text, -1);
is giving me a tag mismatch error?
Reply
#10

dont type -1
type 0 or 1
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)