15.06.2014, 13:07
i was editing an gamemode this is the pwn code of player when he connnect to the server
public OnPlayerConnect(playerid)
{
if (udb_Exists(PlayerName2(playerid)))
{
if(PlayerInfo[playerid][LoggedIn] == 0)
{
ShowPlayerDialog(playerid, 125, DIALOG_STYLE_PASSWORD, "Login","This account is register!login please","Login","Kick");
}
}
if (!udb_Exists(PlayerName2(playerid)))
{
if(PlayerInfo[playerid][Registered] == 0)
{
new string[200];
format(string, sizeof(string),""cwhite"Welcome To COD - Black Ops 2 "cred"%s "cwhite"You are not Registered\nPlease Enter a password to register an account", PlayerName2(playerid));
ShowPlayerDialog(playerid, 126, DIALOG_STYLE_PASSWORD, "Register",string,"Register","Kick");
}
}
if(PlayerInfo[playerid][LoggedIn] == 1)
{
new pname[128];
new file[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), savefolder,pname);
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Score", 0);
dini_IntSet(file, "Money", 0);
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
}
else
{
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
}
}
//-----
IsPlayerUsingAnims[playerid] = 0;
Synching[playerid] = false;
IsPlayerAnimsPreloaded[playerid] = 0;
for(new i; i<PING_MAX_EXCEEDS; i++) PlayerInfo[playerid][pPing][i] = 0;
PlayerInfo[playerid][PingCount] = 0;
PlayerInfo[playerid][PingTime] = 0;
new name[MAX_PLAYER_NAME], string1[40+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string1, sizeof(string1), "~w~%s has ~g~joined ~w~the server.", name);
SendBoxMessage(string1);
but i want this to be shown like this Player(0) has joined the server (INDIA)
how to make it like this
and also is their is any plugins need plz help and explain brieflly
public OnPlayerConnect(playerid)
{
if (udb_Exists(PlayerName2(playerid)))
{
if(PlayerInfo[playerid][LoggedIn] == 0)
{
ShowPlayerDialog(playerid, 125, DIALOG_STYLE_PASSWORD, "Login","This account is register!login please","Login","Kick");
}
}
if (!udb_Exists(PlayerName2(playerid)))
{
if(PlayerInfo[playerid][Registered] == 0)
{
new string[200];
format(string, sizeof(string),""cwhite"Welcome To COD - Black Ops 2 "cred"%s "cwhite"You are not Registered\nPlease Enter a password to register an account", PlayerName2(playerid));
ShowPlayerDialog(playerid, 126, DIALOG_STYLE_PASSWORD, "Register",string,"Register","Kick");
}
}
if(PlayerInfo[playerid][LoggedIn] == 1)
{
new pname[128];
new file[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), savefolder,pname);
if(!dini_Exists(file))
{
dini_Create(file);
dini_IntSet(file, "Score", 0);
dini_IntSet(file, "Money", 0);
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
}
else
{
SetPlayerScore(playerid, dini_Int(file, "Score"));
SetPlayerMoney(playerid, dini_Int(file, "Money"));
}
}
//-----
IsPlayerUsingAnims[playerid] = 0;
Synching[playerid] = false;
IsPlayerAnimsPreloaded[playerid] = 0;
for(new i; i<PING_MAX_EXCEEDS; i++) PlayerInfo[playerid][pPing][i] = 0;
PlayerInfo[playerid][PingCount] = 0;
PlayerInfo[playerid][PingTime] = 0;
new name[MAX_PLAYER_NAME], string1[40+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(string1, sizeof(string1), "~w~%s has ~g~joined ~w~the server.", name);
SendBoxMessage(string1);
but i want this to be shown like this Player(0) has joined the server (INDIA)
how to make it like this
and also is their is any plugins need plz help and explain brieflly