Is this possible?
#1

I'm planning to make a textdraw box in which the onplayerdisconnect reasons will be shown. Like this. Is it possible?
Reply
#2

Yeah, it's possible.
Reply
#3

PHP код:
stock UpdateTD(string[])
{
    new 
tdmsg[500], msgbox[3][128];
    
format(msgbox[2], 128"%s"msgbox[1]);
    
format(msgbox[1], 128"%s"msgbox[0]);
    
format(msgbox[0], 128"%s"string);
    new 
line[10];
    
line "~n~";
    
format(tdmsgsizeof(tdmsg), "%s%s%s%s%s"msgbox[0], linemsgbox[1], linemsgbox[2]);
    
TextDrawSetString(TDtdmsg);
    
TextDrawShowForAll(TD);
    return 
1;
}
//EXAMPLE USAGE;
CMD:kill(playerid)
{
    
SetPlayerHealth(playerid0);
    new 
playerName[MAX_PLAYER_NAME], str[80];
    
GetPlayerName(playeridplayerNamesizeof(playerName));
    
format(strsizeof(str), "%s has committed suicide"playerName);
    
UpdateTD(str);
    return 
1;

This might work.
Reply
#4

Yes it is. Search for a released script.
Reply
#5

Like this Click Me

if yes then use

PHP код:
#include <a_samp>
#define CONNECT_MESSAGES (5)
new Text:ConnectTextdraw[CONNECT_MESSAGES];
new 
CurrentStr[5][64];
public 
OnFilterScriptInit()
{
    for(new 
i=0CONNECT_MESSAGESi++)
    {
        
ConnectTextdraw[i] = TextDrawCreate(496.000000253.000000 + (10), "_");
        
TextDrawBackgroundColor(ConnectTextdraw[i], 255);
        
TextDrawFont(ConnectTextdraw[i], 1);
        
TextDrawLetterSize(ConnectTextdraw[i], 0.21.2);
        
TextDrawColor(ConnectTextdraw[i], -1);
        
TextDrawSetOutline(ConnectTextdraw[i], 1);
        
TextDrawSetProportional(ConnectTextdraw[i], 1);
    }
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    new 
playerName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayerNamesizeof(playerName));
    
CurrentStr[0] = CurrentStr[1];
    
CurrentStr[1] = CurrentStr[2];
    
CurrentStr[2] = CurrentStr[3];
    
CurrentStr[3] = CurrentStr[4];
    
format(CurrentStr[4], sizeof(CurrentStr[]), "~g~join:~w~%s(%i)"playerNameplayerid);
    for(new 
i=0CONNECT_MESSAGESi++)
    {
        
TextDrawSetString(ConnectTextdraw[i], CurrentStr[i]);
        
TextDrawShowForPlayer(playeridConnectTextdraw[i]);
    }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    new 
playerName[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayerNamesizeof(playerName));
    
CurrentStr[0] = CurrentStr[1];
    
CurrentStr[1] = CurrentStr[2];
    
CurrentStr[2] = CurrentStr[3];
    
CurrentStr[3] = CurrentStr[4];
    
format(CurrentStr[4], sizeof(CurrentStr[]), "~r~%s: ~w~%s(%i)", (reason == 0) ? ("TIME") : ((reason == 1) ? ("QUIT") : ("KICK")),playerNameplayerid);
    for(new 
i=0CONNECT_MESSAGESi++) TextDrawSetString(ConnectTextdraw[i], CurrentStr[i]);
      return 
1;
}
public 
OnGameModeExit()
{
    for(new 
i=0CONNECT_MESSAGESi++)
    {
        
TextDrawDestroy(ConnectTextdraw[i]);
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)