09.11.2011, 15:25
Im here for a long time and without any release :/ so lets relese something :P
What does it used for?
-Its a small and simple include that will hook to OnPlayerDisconnect and modify reason variable
[NOTE]These include is only for GameMode!
I also added 2 custom functions
Here is example how to use it (for newbies)
If you find any bugs report them here
If you have any questions feel free ask
Mirrors are welcome (PM me and i will add it)
What does it used for?
-Its a small and simple include that will hook to OnPlayerDisconnect and modify reason variable
[NOTE]These include is only for GameMode!
pawn Код:
#define REASON_CRASH 0 //Timed out
#define REASON_LEAVE 1 //Left normally (/q or ESC menu and quit)
#define REASON_KICK 2 //Kicked
#define REASON_BAN 3 //Banned
#define REASON_RECONNECT 4 //Custom reconnect function
I also added 2 custom functions
pawn Код:
native ReconnectPlayer(playerid);
native CrashPlayer(playerid);
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new pName[MAX_PLAYER_NAME], StringMessage[128];
GetPlayerName(playerid, pName, sizeof(pName));
switch(reason)
{
case REASON_CRASH: format(StringMessage, sizeof(StringMessage), "%s["embed_white"%i"embed_orange"]"embed_white" Has left the server! "embed_orange"[CRASH]",pName[playerid], playerid);
case REASON_LEAVE: format(StringMessage, sizeof(StringMessage), "%s["embed_white"%i"embed_orange"]"embed_white" Has left the server! "embed_orange"[LEAVING]",pName[playerid], playerid);
case REASON_KICK: format(StringMessage, sizeof(StringMessage), "%s["embed_white"%i"embed_orange"]"embed_white" Has left the server! "embed_orange"[KICK]",pName[playerid], playerid);
case REASON_BAN: format(StringMessage, sizeof(StringMessage), "%s["embed_white"%i"embed_orange"]"embed_white" Has left the server! "embed_orange"[BAN]",pName[playerid], playerid);
case REASON_RECONNECT: format(StringMessage, sizeof(StringMessage), "%s["embed_white"%i"embed_orange"]"embed_white" Has left the server! "embed_orange"[RECONNECT]",pName[playerid], playerid);
}
SendClientMessageToAll(0xFF0000AA, StringMessage);
}
If you have any questions feel free ask
Mirrors are welcome (PM me and i will add it)