Advertisement
Guest User

Untitled

a guest
Nov 30th, 2017
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.07 KB | None | 0 0
  1. #include <a_samp>
  2. #include <CameraMover>
  3. #include <sscanf2>
  4. #include <a_mysql>
  5. #include <foreach>
  6. #include <izcmd>
  7. #include <streamer>
  8. #include <crashdetect>
  9.  
  10. #define C_WHITE             0xFFFFFFFF
  11.  
  12.  
  13. //==============================================================================
  14.  
  15. enum ENUM_PLAYER_DATA
  16. {
  17.     pID,
  18.     pName[MAX_PLAYER_NAME],
  19.     pPassword[65],
  20.     pSalt[11],
  21.     pPasswordFails,
  22.     pKills,
  23.     pDeaths,
  24.     pScore,
  25.     pCash,
  26.     pRoomID,
  27.     bool:pIsCriminal,
  28.     pCountdownStep,
  29.     pCountdownTimer,
  30.     Cache: Player_Cache,
  31.     bool:LoggedIn
  32. }
  33.  
  34. //==============================================================================
  35.  
  36. main( ) { }
  37.  
  38. new Text:welcomeTD[1];
  39. new Float:defaultSpawn[4] = {1545.9104,-1675.3846,13.5613,90.0};
  40.  
  41. public OnGameModeInit()
  42. {
  43.  
  44.     SetGameModeText("test");
  45.     welcomeTD[0] = TextDrawCreate(323.666259, 194.562881, "HELLO");
  46.     TextDrawLetterSize(welcomeTD[0], 0.929331, 2.338371);
  47.     TextDrawAlignment(welcomeTD[0], 2);
  48.     TextDrawColor(welcomeTD[0], -2147483393);
  49.     TextDrawSetShadow(welcomeTD[0], 0);
  50.     TextDrawSetOutline(welcomeTD[0], 1);
  51.     TextDrawBackgroundColor(welcomeTD[0], 255);
  52.     TextDrawFont(welcomeTD[0], 3);
  53.     TextDrawSetProportional(welcomeTD[0], 1);
  54.     TextDrawSetShadow(welcomeTD[0], 0);
  55.    
  56.     ShowPlayerMarkers(0);
  57.     DisableInteriorEnterExits();
  58.     return 1;
  59. }
  60.  
  61. public OnGameModeExit()
  62. {
  63.     return 1;
  64. }
  65.  
  66. public OnPlayerRequestClass(playerid, classid)
  67. {
  68.     return 1;
  69. }
  70.  
  71. public OnPlayerConnect(playerid)
  72. {
  73.     SetSpawnInfo(playerid, NO_TEAM, random(299), defaultSpawn[0], defaultSpawn[1], defaultSpawn[2], defaultSpawn[3], 26, 36, 28, 150, 0, 0 );
  74.    
  75.     ShowWelcomeTextdraws(playerid);
  76.     SetTimerEx("PreOnPlayerDataCheck", 5000, false, "i", playerid);
  77.     TogglePlayerSpectating(playerid, 1);
  78.     return 1;
  79. }
  80.  
  81.  
  82. public OnPlayerSpawn(playerid)
  83. {
  84.     SendClientMessageToAll(C_WHITE, "OnPlayerSpawn called!");
  85.     SetPlayerVirtualWorld(playerid, 0);
  86.     SetPlayerHealth(playerid, 100);
  87.     SetPlayerArmour(playerid, 0);
  88.     SetPlayerColor(playerid, -1);
  89.     ClearAnimations(playerid);
  90.     ResetPlayerWeapons(playerid);
  91.  
  92.     return 1;
  93. }
  94.  
  95. public OnPlayerDeath(playerid, killerid, reason)
  96. {
  97.     if(killerid != INVALID_PLAYER_ID) // Checking if the killer of the player is valid.
  98.     {
  99.         SendDeathMessage(killerid, playerid, reason);
  100.     }
  101.     return 1;
  102. }
  103.  
  104.  
  105. forward public PreOnPlayerDataCheck(playerid, corrupt_check);
  106. public PreOnPlayerDataCheck(playerid, corrupt_check)
  107. {
  108.  
  109.     HideWelcomeTextdraws(playerid);
  110.     OnPlayerLogin(playerid);
  111. }
  112.  
  113.  
  114. forward public OnPlayerLogin(playerid);
  115. public OnPlayerLogin(playerid)
  116. {
  117.     SendClientMessage(playerid, 0x00FF00FF, "Logged in to the account.");
  118.     TogglePlayerSpectating(playerid, 0);
  119.     return 1;
  120. }
  121.  
  122. stock ShowWelcomeTextdraws(playerid)
  123. {
  124.     for(new i; i < sizeof(welcomeTD); i++)
  125.     {
  126.         TextDrawShowForPlayer(playerid, welcomeTD[i]);
  127.     }
  128. }
  129.  
  130. stock HideWelcomeTextdraws(playerid)
  131. {
  132.     for(new i; i < sizeof(welcomeTD); i++)
  133.     {
  134.         TextDrawHideForPlayer(playerid, welcomeTD[i]);
  135.     }
  136. }
  137.  
  138. CMD:kill(playerid, params[])
  139. {
  140.     SetPlayerHealth(playerid, 0);
  141.     return 1;
  142. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement