Код:
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
if(!IsPlayerNPC(playerid))
{
if(IsPlayerNPC(playerid)) return 1;
new name[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "** %s (%d) Has Joined The Server", name,playerid);
/*some code*/
if(!udb_Exists(PlayerName2(playerid)))
{
if(IsPlayerNPC(playerid)) return 1;
ShowPlayerDialog(playerid, Register, DIALOG_STYLE_INPUT, "Please Register", "This account is not registered \nType a password below (don't forget it)", "Register", "Cancel");
}
if(udb_Exists(PlayerName2(playerid)))
{
if(IsPlayerNPC(playerid)) return 1;
ShowPlayerDialog(playerid, Logged, DIALOG_STYLE_INPUT, "Please Login", "This account is registered \nType you password below", "Login", "Cancel");
}
SetTimerEx("SettingPlayerTeam",10,1,"i",playerid);
playerCheckpoint[playerid] = 999;
PLAYERLIST_authed[playerid]=false;
}
else
{
if(IsPlayerNPC(playerid)) return 1;
new name[MAX_PLAYER_NAME], string[256];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "** %s (%d) Has Joined The Server", name,playerid);
SendClientMessageToAll(COLOUR_GREY,string);
}
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
gPlayerClass[playerid] = classid;
PlayerInfo[playerid][Spawned] = 0;
if(IsPlayerNPC(playerid)) return 1;
if(StartingNewLife(playerid))
{
if(IsPlayerNPC(playerid)) return 1;
SetupPlayerForClassSelection(playerid);
}
else
if(!StartingNewLife(playerid))
{
if(IsPlayerNPC(playerid)) return 1;
SetPlayerSkin(playerid,dUserINT(PlayerName2(playerid)).("Skin"));
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(IsPlayerNPC(playerid))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(playerid, npcname, sizeof(npcname));
if(!strcmp(npcname, "[BOT]PoliceOfficer1", true))
{
SetPlayerColor(playerid,COLOUR_BLUE);
SetPlayerSkin(playerid, 267);
}
return 1;
}
else
{
SetPlayerColor(playerid,COLOUR_WHITE);
PlayerInfo[playerid][Spawned] = 1;
if(!IsPlayerNPC(playerid))
{
if(StartingNewLife(playerid))
{
SendClientMessage(playerid,COLOUR_GREEN,"You Have Started A New Life! You Can Quit And Come Back Later To Continue This Life");
/*some code*/
}
else
if(!StartingNewLife(playerid))
{
SendClientMessage(playerid,COLOUR_GREEN,"Data Loaded - Continuing Current Life...");
/*some code*/
}
}
}
return 1;
}
I hope this will is enough. Thankd for try to help me