Connect and Disconnect textdraw box.
#1

Need a script that will contain all this...
Connect, Disconnect textdraw box.

Connection: [JOIN] %s joined the game.
Disconnection: [LEAVE] %s left the game.
Zone Captured: [ZONE] (Team) captured the (Zone).

The displayed textdraw should start from the [JOIN]/[LEAVE]/[ZONE]...

If someone can help me I would appreciate it.
Reply
#2

onplayerconnect;

PHP код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playeridplayername30);
new 
str[256];
format(strsizeof(str), "[JOIN] %s has joined the server."playername);
            for(new 
i=0;i<MAX_PLAYERS;i++) if(IsPlayerConnected(i)) SendClientMessage(i,COLOR_LIGHTGREYstr); 
onplayerdisconnect
PHP код:
new playername[MAX_PLAYER_NAME];
GetPlayerName(playeridplayername30);
new 
str[256];
format(strsizeof(str), "[LEAVE] %s has left the server"playername);
            for(new 
i=0;i<MAX_PLAYERS;i++) if(IsPlayerConnected(i)) SendClientMessage(i,COLOR_LIGHTGREYstr); 
Reply
#3

I don't want this to be announced in main chat....
I want this to be on the right down corner as a text draw.....
Btw, Add one for kick to

Example: [KICK] %s has left the server

Moreover: Join = Green
Kick/Disconnect = Red.
Reply
#4

Код:
new PlayerText:I_text[MAX_PLAYERS] = {PlayerText:INVALID_TEXT_DRAW, ...};
new I_timer[MAX_PLAYERS];

stock I_textShow(playerid, color, text[], time)
{
    if(I_timer[playerid] != 0){
    if(I_text[playerid] != PlayerText:INVALID_TEXT_DRAW){
    PlayerTextDrawDestroy(playerid, I_text[playerid]);
    I_text[playerid] = PlayerText:INVALID_TEXT_DRAW;}
    KillTimer(I_timer[playerid]);}
    I_text[playerid] = CreatePlayerTextDraw(playerid, 635.000000, 422.750122, text);
    PlayerTextDrawLetterSize(playerid, I_text[playerid], 0.400000, 1.600000);
    PlayerTextDrawAlignment(playerid, I_text[playerid], 3);
    PlayerTextDrawColor(playerid, I_text[playerid], color);
    PlayerTextDrawSetOutline(playerid, I_text[playerid], 1);
    PlayerTextDrawShow(playerid, I_text[playerid]);
    I_timer[playerid] = SetTimerEx("I_timer_", time, false, "i", playerid);
    return 1;
}

forward I_timer_(playerid);
public I_timer_(playerid)
{
    if(!IsPlayerConnected(playerid)) return 1;
    if(I_text[playerid] != PlayerText:INVALID_TEXT_DRAW){
    PlayerTextDrawDestroy(playerid, I_text[playerid]);
    I_text[playerid] = PlayerText:INVALID_TEXT_DRAW;}
    I_timer[playerid] = 0;
    return 1;
}

stock pname(playerid)
{
    new name[24];
    if(IsPlayerConnected(playerid)){
    GetPlayerName(playerid, name, sizeof(name));}
    return name;
}

public OnPlayerConnect(playerid)
{
    new str[128];
    format(str, sizeof(str), "[JOIN] %s has joined the server.", pname(playerid));
    new HPID = GetPlayerPoolSize();
    for(new i=0; i <= HPID; i++){
    if(IsPlayerConnected(i)){
    I_textShow(i, 0x00FF00FF, str, 5000);}}
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new DisconnectReason[3][] =
    {
        "Timeout/Crash",
        "Quit",
        "Kick/Ban"
    };
    new str[128];
    format(str, sizeof(str), "[LEAVE] %s has left the server (%s).", pname(playerid), DisconnectReason[reason]);
    new HPID = GetPlayerPoolSize();
    for(new i=0; i <= HPID; i++){
    if(IsPlayerConnected(i)){
    I_textShow(i, 0xFF0000FF, str, 5000);}}
    return 1;
}
Reply
#5

Hey thank you a lot for killing your time for me but I want something like
A black box in the right down corner where not that big letters will appear and stay for the whole server...
I just found this in the ****** images... http://s2.dmcdn.net/JSoeg/x240-o_Q.jpg
Something like that

(inside brackets = green color) [JOIN] %s has joined (only the word joined should be green the other should be white) the game.
(inside brackets = red color, same goes for kick) [LEAVE] %s has left (left word red the other white) the game.
[KICK] %s has left the game.
and after adding my zones I would like to have
(inside brackets = yellow color) [ZONE] (Team) has captured the (The zone they captured).
Note just a box, without these stuff showing in that picture.

EDIT: a better example would be: http://s2.dmcdn.net/IqsEv/1280x720-F4t.jpg
I want something like this but with black background not green and at the bottom add Call of Duty - Greek Warfare
nothing else....
Reply
#6

bump,,,,,, anyone please ?? I would appreciate it A LOOOT !!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)