17.08.2014, 11:16
PHP код:
public OnPlayerDisconnect(playerid)
{
new
string[64],
name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
switch(reason)
{
case 0: format(string,sizeof string,"%s partiу del server. (Crash)",name);
case 1: format(string,sizeof string,"%s partiу del server. (Salio)",name);
case 2: format(string,sizeof string,"%s partiу del server. (Kick/Ban)",name);
}
SendClientMessageToAll(0xFFFFFFAA,string);
SavePlayer(playerid);
return 1;
}
And i want to add join message here but i dont know where ?
PHP код:
public OnPlayerConnect(playerid)
{
GameTextForPlayer(playerid,"~g~Welcome to Test",5000,4);
SendClientMessage(playerid,0xFFFFFFFF,"{FF0000}Welcome {FFFFFF}to Russia vs Ukraine!\n{FFFFFF}Type {FF0000}/help {FFFFFF}for help :)");
SendClientMessage(playerid, COLOR_YELLOW, "Click Spawn to spawn to your previous team and class");
new playername[MAX_PLAYER_NAME];
new string[128];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"players/%s.ini", playername);
if(fexist(string))
{
PAccount[playerid] = 1;
}
else
{
PAccount[playerid] = 0;
}
if(PAccount[playerid] == 1)
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"{FF0000}Login","{FFFFFF}Hello!\nYour account registred in server\nPlease,type your password below:","OK","Exit");
}
else
{
ShowPlayerDialog(playerid,2,DIALOG_STYLE_INPUT,"{00FF00}Register","{FFFFFF}Hello!\nYour account not registred!\nType password below:","OK","Exit");
}
return 1;
PHP код:
public OnPlayerConnect(playerid)
{
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"%s has joined the server. Welcome!",pName);
SendClientMessageToAll(0xFFFFFFAA,string);
return 1;
}