SA-MP Forums Archive
Small help plz - 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: Small help plz (/showthread.php?tid=88409)



Small help plz - cloud9 - 26.07.2009

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]);
}



Re: Small help plz - cloud9 - 26.07.2009

Plz help, BUMP


Re: Small help plz - DMSOrg - 26.07.2009

Don't double post please.

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


Re: Small help plz - cloud9 - 26.07.2009

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


Re: Small help plz - MadeMan - 26.07.2009

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);
    }



Re: Small help plz - cloud9 - 26.07.2009

It didnt work


Re: Small help plz - MadeMan - 26.07.2009

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;
}



Re: Small help plz - cloud9 - 26.07.2009

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.