Guest User

Untitled

a guest
Aug 1st, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.53 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new
  4. TeamScore[2],
  5. TeamPlayers[2],
  6. AllPlayers;
  7.  
  8. main(){}
  9.  
  10. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  11. {
  12.     switch(dialogid)
  13.     {
  14.         case 1:
  15.         {
  16.             if(!response)
  17.                 Kick(playerid);
  18.             else
  19.             {
  20.                 switch(listitem)
  21.                 {
  22.                     case 0: SetPlayerTeam(playerid, 0), AllPlayers++, TeamPlayers[0]++;
  23.                     case 1: SetPlayerTeam(playerid, 1), AllPlayers++, TeamPlayers[1]++;
  24.                 }
  25.             }
  26.             return 1;
  27.         }
  28.     }
  29.     return 0;
  30. }
  31.  
  32. public OnPlayerDeath(playerid, killerid, reason)
  33. {
  34.     if(killerid != INVALID_PLAYER_ID)
  35.     {
  36.         if(TeamPlayers[0] == 0)
  37.         {
  38.             new string[64];
  39.             format(string,sizeof(string),"Team 1 je pobedio! ( Team 1 | %d : Team 2 | %d)",TeamScore[1], TeamScore[0]);
  40.             SendClientMessageToAll(-1, string);
  41.             //printf("%s", string);
  42.             TeamScore[0] = 0;
  43.             TeamScore[1] = 0;
  44.             for(new i = 0; i < AllPlayers; i++)
  45.             {
  46.                 SetPlayerTeam(i, 255);
  47.                 //printf("%d, %d", i, AllPlayers);
  48.             }
  49.             TeamPlayers[0] = 0;
  50.             TeamPlayers[1] = 0;
  51.             AllPlayers = 0;
  52.         }
  53.         else if(TeamPlayers[1] == 0)
  54.         {
  55.             new string[64];
  56.             format(string,sizeof(string),"Team 0 je pobedio! ( Team 0 | %d : Team 1 | %d)",TeamScore[0], TeamScore[1]);
  57.             SendClientMessageToAll(-1, string);
  58.             //printf("%s", string);
  59.             TeamScore[0] = 0;
  60.             TeamScore[1] = 0;
  61.             for(new i = 0; i < AllPlayers; i++)
  62.             {
  63.                 SetPlayerTeam(i, 255);
  64.                 //printf("%d, %d", i, AllPlayers);
  65.             }
  66.             TeamPlayers[0] = 0;
  67.             TeamPlayers[1] = 0;
  68.             AllPlayers = 0;
  69.         }
  70.         else if(GetPlayerTeam(killerid) == 0)
  71.         {
  72.             TeamScore[0]++;
  73.             TeamScore[1]--;
  74.             TeamPlayers[1]--;
  75.         }
  76.         else if(GetPlayerTeam(killerid) == 1)
  77.         {
  78.             TeamScore[1]++;
  79.             TeamScore[0]--;
  80.             TeamPlayers[0]--;
  81.         }
  82.     }
  83.     return 1;
  84. }
  85.  
  86. public OnPlayerDisconnect(playerid, reason)
  87. {
  88.     if(GetPlayerTeam(playerid) == 0)
  89.     {
  90.         TeamPlayers[0]--;
  91.         AllPlayers--;
  92.     }
  93.     else if(GetPlayerTeam(playerid) == 1)
  94.     {
  95.         TeamPlayers[1]--;
  96.         AllPlayers--;
  97.     }
  98.     return 1;
  99. }
Advertisement
Add Comment
Please, Sign In to add comment