Advertisement
Guest User

ceva

a guest
Feb 27th, 2019
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. public OnPlayerConnect(playerid)
  2. {
  3. new playerip[16];
  4. GetPlayerIp(playerid,playerip,sizeof(playerip));
  5. playeri_online++;
  6. if(NumIp(playerip, playerid) >= 5 && !IsAdminOnIP(playerip))
  7. {
  8. Kick(playerid);
  9. SendClientMessage(playerid, COLOR_LIGHTRED, "* Sunt deja 5 conturi conectate de pe acest IP!");
  10. return 1;
  11. }
  12. if(FindAdvertise(GetName(playerid))) BanEx(playerid, "Name Advertising");
  13. InitFly(playerid);
  14. SetPlayerChatBubble(playerid, ""SERVER_NAME"", COLOR_WHITE, 25.0, 1000);
  15. InitVariablesForPlayer(playerid);
  16. RemoveBuildingsForPlayer(playerid);
  17. InitPlayerTextdraws(playerid);
  18. CreateMapIcons(playerid);
  19. PlayerInfo[playerid][pGiftBox] = 1;
  20. SpecAttack[playerid] = 0;
  21. fly[playerid] = 0;
  22. serverinfo[playerid] = 0;
  23. //==============================================================================
  24. gQuery[0] = (EOS);
  25. mysql_format(handle, gQuery, sizeof(gQuery), "SELECT `Name` FROM `players` WHERE `AName` = '%e' LIMIT 1", GetName(playerid));
  26. new Cache:result = mysql_query(handle, gQuery);
  27. new name[25];
  28. if(cache_num_rows())
  29. {
  30. cache_get_field_content(0, "Name", name);
  31. if(GetPlayerID(name) != INVALID_PLAYER_ID && GetPlayerID(name) != playerid || strlen(name) > 20)
  32. {
  33. SendClientMessage(playerid, 0x88AA62FF, "CONNECTION REJECTED: Unacceptable NickName");
  34. SendClientMessage(playerid, 0x88AA62FF, "Please choose another nick between and 3-20 characters");
  35. SendClientMessage(playerid, 0x88AA62FF, "Please use only a-z, A-Z, 0-9");
  36. SendClientMessage(playerid, 0x88AA62FF, "Use /quit to exit or press ESC and select Quit Game");
  37. Kick(playerid);
  38. }
  39. SetPlayerName(playerid, name);
  40. }
  41. cache_delete(result);
  42.  
  43. PlayerTextDrawShow(playerid, Logo[0]);
  44.  
  45. PlayerTextDrawSetString(playerid,NameText[playerid], GetName(playerid));
  46. PlayerTextDrawShow(playerid, NameText[playerid]);
  47.  
  48. gQuery[0] = (EOS);
  49. mysql_format(handle, gQuery, sizeof(gQuery), "SELECT * FROM `bans` WHERE `Name` = '%e'", GetName(playerid));
  50. mysql_tquery(handle, gQuery, "WhenBanCheck", "i", playerid);
  51.  
  52. PlayerTextDrawShow(playerid, ClockTime);
  53. PlayerTextDrawShow(playerid, ClockDate);
  54. PlayerTextDrawHide(playerid, InfoBox[playerid]);
  55.  
  56. SetPlayerColor(playerid,0xCECECE00);
  57. SetPlayerArmourEx(playerid, 0);
  58. SetPlayerHealthEx(playerid, 100);
  59. //SetTimerEx("TimerLogin", 30000, false, "i", playerid);
  60. return 1;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement