Advertisement
Guest User

Gun GAME event

a guest
Jul 17th, 2012
812
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.41 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. new Text:Kill_Streak[MAX_PLAYERS];
  5. new kills[MAX_PLAYERS];
  6. new joined[MAX_PLAYERS];
  7.  
  8.  
  9. #if defined FILTERSCRIPT
  10.  
  11. public OnFilterScriptInit()
  12. {
  13.     print("\nSigned, Preda");
  14.     print("! GunGame SCRIPT !");
  15.     print("Signed, Preda\n");
  16.    
  17.     for(new i=0;i<MAX_PLAYERS;i++)
  18.     {
  19.     Kill_Streak[i] = TextDrawCreate(11.000000,273.000000,"Kills : 0");
  20.     TextDrawAlignment(Kill_Streak[i],0);
  21.     TextDrawBackgroundColor(Kill_Streak[i],0x000000ff);
  22.     TextDrawFont(Kill_Streak[i],1);
  23.     TextDrawLetterSize(Kill_Streak[i],0.699999,1.600000);
  24.     TextDrawColor(Kill_Streak[i],0x8B0000FF);
  25.     TextDrawSetOutline(Kill_Streak[i],1);
  26.     TextDrawSetProportional(Kill_Streak[i],1);
  27.     TextDrawSetShadow(Kill_Streak[i],1);
  28.     }
  29.     return 1;
  30. }
  31.  
  32. public OnFilterScriptExit()
  33. {
  34.     return 1;
  35. }
  36.  
  37. #else
  38. #endif
  39.  
  40. public OnPlayerConnect(playerid)
  41. {
  42.     joined[playerid] = 0;
  43.     return 1;
  44. }
  45. public OnPlayerDisconnect(playerid, reason)
  46. {
  47.     joined[playerid] = 0;
  48.     return 1;
  49. }
  50.  
  51. public OnPlayerSpawn(playerid)
  52. {
  53.                     joined[playerid] = 0;
  54.                     return 1;
  55. }
  56.  
  57. public OnPlayerDeath(playerid, killerid, reason)
  58. {
  59.             joined[playerid] = 0;
  60.             leavefunction(playerid);
  61.            
  62.             new szString[128];
  63.             kills[killerid]++;
  64.             format(szString,sizeof(szString),"Kills :%d",kills[killerid]);
  65.             TextDrawSetString(Kill_Streak[killerid],szString);
  66.  
  67.             SetPlayerScore(killerid,GetPlayerScore(killerid) +1);
  68.             SetPlayerScore(playerid,0);
  69.             if(GetPlayerScore(killerid) == 2)
  70.             {
  71.                 SetPlayerHealth(killerid,100);
  72.                 SetPlayerArmour(killerid,100);
  73.                 GivePlayerWeapon(killerid, 23, 500);
  74.                 GameTextForPlayer(killerid, "~r~LEVEL UP", 3500, 5);
  75.                 SetPlayerArmedWeapon(playerid, 23);
  76.                 return 1;
  77.             }
  78.             if(GetPlayerScore(killerid) == 3)
  79.             {
  80.                 SetPlayerHealth(killerid,150);
  81.                 SetPlayerArmour(killerid,150);
  82.                 GivePlayerWeapon(killerid,24,200);
  83.                 GameTextForPlayer(killerid, "~r~LEVEL UP", 3500, 5);
  84.                 return 1;
  85.             }
  86.             if(GetPlayerScore(killerid) == 4)
  87.             {
  88.                 SetPlayerHealth(killerid,150);
  89.                 SetPlayerArmour(killerid,150);
  90.                 GivePlayerWeapon(killerid, 27, 500);
  91.                 GameTextForPlayer(killerid, "~r~LEVEL UP", 3500, 5);
  92.                 return 1;
  93.             }
  94.             if(GetPlayerScore(killerid) == 5)
  95.             {
  96.                 SetPlayerHealth(killerid,150);
  97.                 SetPlayerArmour(killerid,150);
  98.                 GivePlayerWeapon(killerid,28,500);
  99.                 GameTextForPlayer(killerid, "~r~LEVEL UP", 3500, 5);
  100.                 SetPlayerArmedWeapon(playerid, 28);
  101.                 return 1;
  102.             }
  103.             if(GetPlayerScore(killerid) == 6)
  104.             {
  105.                 GivePlayerWeapon(killerid, 32, 500);
  106.                 SetPlayerHealth(killerid, 100);
  107.                 SetPlayerArmour(killerid, 100);
  108.                 GameTextForPlayer(killerid, "~r~LEVEL UP", 3500, 5);
  109.                 SetPlayerArmedWeapon(playerid, 32);
  110.                 return 1;
  111.             }
  112.  
  113.             return 1;
  114. }
  115.  
  116. public OnPlayerCommandText(playerid, cmdtext[])
  117. {
  118.     if (strcmp("/joingungame", cmdtext, true, 10) == 0)
  119.     {
  120.             joined[playerid] = 1;
  121.             new colorsGUNGAME[] = {
  122.             0x33DD1100,
  123.             0xFF880000
  124.             };
  125.  
  126.             new skinsGUNGAME[] = {
  127.             3,
  128.             6,
  129.             21,
  130.             46,
  131.             121
  132.  
  133.             };
  134.             SetPlayerSkin(playerid, skinsGUNGAME[random(5)]);
  135.             SetPlayerPos(playerid, 1308.0341,2110.7769,11.0156);
  136.             SetPlayerColor(playerid, colorsGUNGAME[random(2)]);
  137.             TextDrawShowForPlayer(playerid,Kill_Streak[playerid]);
  138.             SetPlayerHealth(playerid, 100);
  139.             SetPlayerArmour(playerid, 100);
  140.             GivePlayerWeapon(playerid, 22, 500);
  141.             new
  142.             g_szString [ 256 ],
  143.             pName      [  24 ];
  144.  
  145.             GetPlayerName(playerid, pName, sizeof ( pName ) );
  146.             format( g_szString, sizeof ( g_szString ), "[GUN GAME] %s has joined the EVENT !", pName );
  147.             SendClientMessageToAll(0x9ACD32FF, g_szString );
  148.  
  149.  
  150.             return 1;
  151.     }
  152.     if(strcmp("/leavegungame", cmdtext, true, 10) == 0)
  153.     {
  154.  
  155.             joined[playerid] = 0;
  156.             leavefunction(playerid);
  157.             SendClientMessage(playerid, 0x00FFFFFF, "You left GUN GAME event !");
  158.             new
  159.             g_szString [ 256 ],
  160.             pName      [  24 ];
  161.  
  162.             GetPlayerName(playerid, pName, sizeof ( pName ) );
  163.             format( g_szString, sizeof ( g_szString ), "[GUN GAME] %s has left the EVENT !", pName );
  164.             SendClientMessageToAll(0x9ACD32FF, g_szString );
  165.             SetPlayerArmour(playerid, 0);
  166.             SetPlayerHealth(playerid, 100);
  167.            
  168.             return 1;
  169.     }
  170.     return 0;
  171. }
  172. forward leavefunction(playerid);
  173. public leavefunction(playerid)
  174. {
  175.     if(joined[playerid] == 0)
  176.     {
  177.         SpawnPlayer(playerid);
  178.     }
  179. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement