Small help plz
#1

I just made a command so u do /killmes <some text>. It will display on the players screen as u kill them. But the textdraws are not show on the screen, plz help me tia.

pawn Код:
// at the top

new KillMes[MAX_PLAYERS][128];
new Text:Text[12][MAX_PLAYERS];
//onplayer death

    if(IsPlayerConnected(killerid) && strlen(KillMes[killerid]) > 1)
    {
        TextDrawShowForPlayer(playerid,Text[7][playerid]);
      TextDrawSetString(Text[7][playerid],KillMsg[killerid]);
      SetTimerEx("HideKillMes",5000,0,"i",playerid);
    }
//
dcmd_killmes(playerid,params[])
{
      if(!strlen(params))return SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /killmes [Custom death message]");
      if(strlen(params) <= 1)return SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /killmes [Custom death message]");
      new string[32];
        format(string,sizeof(string),"%s",params);
      Killmes[playerid] = string;
        SendClientMessage(playerid,COLOR_YELLOW,"You have updated ur msg");
        return 1;
}

forward HideKillMes(playerid);
public HideKillMes(playerid)
{
    TextDrawHideForPlayer(playerid,Text[7][playerid]);
}
Reply
#2

Plz help, BUMP
Reply
#3

Don't double post please.

What I think is wrong is that you define the text draw string after the textdraw is showing.
Reply
#4

It shows on player death, it just gets initiated when u do /killmes. So i dont think it is the problem
Reply
#5

Tried this?

pawn Код:
//onplayer death

    if(IsPlayerConnected(killerid) && strlen(KillMes[killerid]) > 1)
    {
        TextDrawSetString(Text[7][playerid],KillMsg[killerid]);
        TextDrawShowForPlayer(playerid,Text[7][playerid]);
        SetTimerEx("HideKillMes",5000,0,"i",playerid);
    }
Reply
#6

It didnt work
Reply
#7

Try this also:

pawn Код:
dcmd_killmes(playerid,params[])
{
    if(!strlen(params))return SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /killmes [Custom death message]");
    if(strlen(params) <= 1)return SendClientMessage(playerid,COLOR_YELLOW,"USAGE: /killmes [Custom death message]");
    new string[32];
    format(string,sizeof(string),"%s",params);
    strmid(KillMes[playerid], string, 0, 31, 128);
    SendClientMessage(playerid,COLOR_YELLOW,"You have updated ur msg");
    return 1;
}
Reply
#8

Thank you very much, that worked but it is fucking with other Texdraw positions in the script. I Made it such that it is to be in center but it is like at the bottom right corner and with a small font.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)