07.04.2011, 06:42
(
Последний раз редактировалось wheelman_WM; 07.04.2011 в 08:29.
)
public OnPlayerDisconnect(playerid, reason)
{
new gPlayerName[30], str[256];
switch (reason) {
case 0: {
GetPlayerName(playerid, gPlayerName, 30);
format(str, 256, "%s has Leave the Server! (Timeout)", gPlayerName);
SendClientMessageToAll(colorwhite, str);
}
case 1: {
GetPlayerName(playerid, gPlayerName, 30);
format(str, 256, "%s has Leave the Server! (Leaving)", gPlayerName);
SendClientMessageToAll(colorwhite, str);
}
case 2: {
GetPlayerName(playerid, gPlayerName, 30);
format(str, 256, "%s has Leave the Server! (Kick/Ban)", gPlayerName);
SendClientMessageToAll(colorwhite, str);
}
}
return 1;
}
new Text:txt;
new Text:gTextDraw;
#define INVALID_TEXT_DRAW (0xFFFF)
txt = TextDrawCreate(10.0, 100.0, "Sample text draw under the chat box");
TextDrawUseBox(txt, 1);
TextDrawShowForPlayer(playerid, txt);
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, gTextDraw);
new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has joined the server", pname);
SendClientMessageToAll(0xAAAAAAAA, string);
return 1;
}
OnGameModeinit ()
gTextDraw = TextDrawCreate(10.0, 100.0, "Welcome to my server!");
TextDrawUseBox(gTextDraw, 1);
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
TextDrawHideForPlayer(playerid, gTextDraw);
return 1;
}
new Text:Join;
new pName[MAX_PLAYER_NAME];
new string[128];
Join = TextDrawCreate(5.000000,255.000000, string);
format(string, sizeof(string), "%s has joined the server",pName);
TextDrawUseBox(Join,1);
TextDrawBoxColor(Join,0x00000099);
TextDrawTextSize(Join,191.000000,1.000000);
TextDrawAlignment(Join,0);
TextDrawBackgroundColor(Join,0x000000ff);
TextDrawFont(Join,3);
TextDrawLetterSize(Join,0.299999,1.200000);
TextDrawColor(Join,0xffffffff);
TextDrawSetOutline(Join,1);
TextDrawSetProportional(Join,1);
TextDrawSetShadow(Join,1);
TextDrawShowForAll(Join);
SetTimer("TextDrawHide",4000,true);
forward TextDrawHide();
public TextDrawHide()
{
TextDrawHideForAll(Join);
return 1;
}