Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerConnect(playerid)
- {
- new playerip[16];
- GetPlayerIp(playerid,playerip,sizeof(playerip));
- playeri_online++;
- if(NumIp(playerip, playerid) >= 5 && !IsAdminOnIP(playerip))
- {
- Kick(playerid);
- SendClientMessage(playerid, COLOR_LIGHTRED, "* Sunt deja 5 conturi conectate de pe acest IP!");
- return 1;
- }
- if(FindAdvertise(GetName(playerid))) BanEx(playerid, "Name Advertising");
- InitFly(playerid);
- SetPlayerChatBubble(playerid, ""SERVER_NAME"", COLOR_WHITE, 25.0, 1000);
- InitVariablesForPlayer(playerid);
- RemoveBuildingsForPlayer(playerid);
- InitPlayerTextdraws(playerid);
- CreateMapIcons(playerid);
- PlayerInfo[playerid][pGiftBox] = 1;
- SpecAttack[playerid] = 0;
- fly[playerid] = 0;
- serverinfo[playerid] = 0;
- //==============================================================================
- gQuery[0] = (EOS);
- mysql_format(handle, gQuery, sizeof(gQuery), "SELECT `Name` FROM `players` WHERE `AName` = '%e' LIMIT 1", GetName(playerid));
- new Cache:result = mysql_query(handle, gQuery);
- new name[25];
- if(cache_num_rows())
- {
- cache_get_field_content(0, "Name", name);
- if(GetPlayerID(name) != INVALID_PLAYER_ID && GetPlayerID(name) != playerid || strlen(name) > 20)
- {
- SendClientMessage(playerid, 0x88AA62FF, "CONNECTION REJECTED: Unacceptable NickName");
- SendClientMessage(playerid, 0x88AA62FF, "Please choose another nick between and 3-20 characters");
- SendClientMessage(playerid, 0x88AA62FF, "Please use only a-z, A-Z, 0-9");
- SendClientMessage(playerid, 0x88AA62FF, "Use /quit to exit or press ESC and select Quit Game");
- Kick(playerid);
- }
- SetPlayerName(playerid, name);
- }
- cache_delete(result);
- PlayerTextDrawShow(playerid, Logo[0]);
- PlayerTextDrawSetString(playerid,NameText[playerid], GetName(playerid));
- PlayerTextDrawShow(playerid, NameText[playerid]);
- gQuery[0] = (EOS);
- mysql_format(handle, gQuery, sizeof(gQuery), "SELECT * FROM `bans` WHERE `Name` = '%e'", GetName(playerid));
- mysql_tquery(handle, gQuery, "WhenBanCheck", "i", playerid);
- PlayerTextDrawShow(playerid, ClockTime);
- PlayerTextDrawShow(playerid, ClockDate);
- PlayerTextDrawHide(playerid, InfoBox[playerid]);
- SetPlayerColor(playerid,0xCECECE00);
- SetPlayerArmourEx(playerid, 0);
- SetPlayerHealthEx(playerid, 100);
- //SetTimerEx("TimerLogin", 30000, false, "i", playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement