Код:
public OnPlayerConnect(playerid)
{
//SafeZones
GangZoneShowForPlayer(playerid, LVSpawnSZ, SZColor);
GangZoneShowForPlayer(playerid, SFASpawnSZ, SZColor);
GangZoneShowForPlayer(playerid, ChilliadSZ, SZColor);
GangZoneShowForPlayer(playerid, AASpawnSZ, SZColor);
GangZoneShowForPlayer(playerid, LSASpawnSZ, SZColor);
GangZoneShowForPlayer(playerid, DamSpawnSZ, SZColor);
GangZoneShowForPlayer(playerid, RCSpawnSZ, SZColor);
//DMZones
GangZoneShowForPlayer(playerid, DMZone1, DMZColor);
if(!xini_exist("ServerStats.ini"))
{
xini_create("ServerStats.ini");
}
xini_setint("ServerStats.ini", "Players", "PlayersJoined", xini_int("ServerStats.ini","Players","PlayersJoined",false)+1, false);
for(new slot=0; slot<=10; slot++)
{
SavedX[playerid][slot] = 0.0;
SavedY[playerid][slot] = 0.0;
SavedZ[playerid][slot] = 0.0;
SavedA[playerid][slot] = 0.0;
SavedI[playerid][slot] = 0;
}
for(new stunt=0; stunt<50; stunt++)
{
StuntPointTaken[playerid][stunt] = false;
}
DMRespawn[playerid] = 0;
DMZone[playerid] = 0;
RaceStartCPCreated[playerid] = false;
PlayerRacing[playerid] = false;
LiftMoving[playerid] = false;
LiftStandingStillUp[playerid] = false;
LiftStandingStillDown[playerid] = true;
PlatformsCreated[playerid] = false;
TextDrawsShown[playerid] = false;
VHSCreated[playerid] = false;
LightRedHealthCreated[playerid] = false;
LightYellowSpeedCreated[playerid] = false;
GoToOn[playerid] = true;
AutoFixOn[playerid] = true;
AFK[playerid] = false;
InfoMessagesOn[playerid] = true;
AntiFalloff[playerid] = false;
InCar[playerid] = false;
BombArmed[playerid] = false;
PlayerHasBomb[playerid] = 0;
PlayerStuntPoints[playerid] = 0;
HideMoneyTexttRunning[playerid] = false;
MoneyTextShown[playerid] = false;
DestroyInfoTexttRunning[playerid] = false;
DestroyInfoTexttRunning2[playerid] = false;
DestroyInfoTextToAlltRunning = false;
InfoTextShown[playerid] = false;
InfoTextCreated2[playerid] = false;
InfoTextToAllShown[playerid] = false;
Muted[playerid] = false;
PlayerMoney[playerid] = 0;
PlayerBankMoney[playerid] = 0;
PlayerRank[playerid] = 0;
PlayerLoggedIn[playerid] = 0;
PlayerCokOPops[playerid] = 0;
CurrentSpawnView[playerid] = 0;
RadioShown[playerid] = false;
PickupsCreated[playerid] = false;
MoneyBeforeDied[playerid] = 0;
new name[MAX_PLAYER_NAME], File[64];
GetPlayerName(playerid, name, sizeof name);
format(File, sizeof File, "UserFiles/%s.ini", name);
if (xini_exist(File))
{
xini_set(File,"Info","Online","Yes",false);
}
//Hospitals
SetPlayerMapIcon(playerid, 0, 1581.9529,1765.1115,10.4000, 22, 0 );
SetPlayerMapIcon(playerid, 1, -314.7613, 1049.4744, 19.7443, 22, 0 );
SetPlayerMapIcon(playerid, 2, -1511.2435, 2518.9419, 55.2682, 22, 0 );
SetPlayerMapIcon(playerid, 3, -2200.6379, -2305.8945, 30.0290, 22, 0 );
SetPlayerMapIcon(playerid, 4, -2677.8521, 634.5194, 13.8571, 22, 0 );
SetPlayerMapIcon(playerid, 5, -2677.8521, 634.5194, 13.8571, 22, 0 );
SetPlayerMapIcon(playerid, 6, 1172.1625, -1328.1008, 14.8036, 22, 0 );
//DollarIcons
SetPlayerMapIcon(playerid, 7, -2395.8655,-40.8319,35.3125, 52, 0 ); //HomeMade 24-7
SetPlayerMapIcon(playerid, 8, 1007.1584,-917.0974,46.6641, 52, 0 ); //24-7
SetPlayerMapIcon(playerid, 9, 1841.6007,-1842.8639,17.0780, 52, 0 ); //24-7
SetPlayerMapIcon(playerid, 10, 1350.6414,-1764.1642,19.0781, 52, 0 ); //24-7
SetPlayerMapIcon(playerid, 11, 1315.8279,-889.0602,45.2266, 52, 0 ); //24-7
SetPlayerMapIcon(playerid, 12, -1561.9849,-2729.2844,53.0564, 52, 0 ); //24-7
TextDrawShowForPlayer(playerid, Text:TdLogo1);
TextDrawShowForPlayer(playerid, Text:TdLogo2);
TextDrawShowForPlayer(playerid, Text:TdWebsite);
new NewPlayer[128];
format(NewPlayer, sizeof NewPlayer, "%s has joined the server.", name);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && i != playerid)
{
SendClientMessage(i, COLOR_GREY, NewPlayer);
}
}
SendClientMessage(playerid, COLOR_GREY, "Welcome to Stunt Universe (v2.1)");
SendClientMessage(playerid, COLOR_GREY, "For more info, type /help.");
SendClientMessage(playerid, COLOR_GREY, "Last update: Races added! see /teles (/teleports)");
new String[128];
format(String, sizeof String, "Welcome %s, please enter your password.", name);
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Login - Register", String, "Login", "Register");
return 1;
}