Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new
- TeamScore[2],
- TeamPlayers[2],
- AllPlayers;
- main(){}
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case 1:
- {
- if(!response)
- Kick(playerid);
- else
- {
- switch(listitem)
- {
- case 0: SetPlayerTeam(playerid, 0), AllPlayers++, TeamPlayers[0]++;
- case 1: SetPlayerTeam(playerid, 1), AllPlayers++, TeamPlayers[1]++;
- }
- }
- return 1;
- }
- }
- return 0;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(killerid != INVALID_PLAYER_ID)
- {
- if(TeamPlayers[0] == 0)
- {
- new string[64];
- format(string,sizeof(string),"Team 1 je pobedio! ( Team 1 | %d : Team 2 | %d)",TeamScore[1], TeamScore[0]);
- SendClientMessageToAll(-1, string);
- //printf("%s", string);
- TeamScore[0] = 0;
- TeamScore[1] = 0;
- for(new i = 0; i < AllPlayers; i++)
- {
- SetPlayerTeam(i, 255);
- //printf("%d, %d", i, AllPlayers);
- }
- TeamPlayers[0] = 0;
- TeamPlayers[1] = 0;
- AllPlayers = 0;
- }
- else if(TeamPlayers[1] == 0)
- {
- new string[64];
- format(string,sizeof(string),"Team 0 je pobedio! ( Team 0 | %d : Team 1 | %d)",TeamScore[0], TeamScore[1]);
- SendClientMessageToAll(-1, string);
- //printf("%s", string);
- TeamScore[0] = 0;
- TeamScore[1] = 0;
- for(new i = 0; i < AllPlayers; i++)
- {
- SetPlayerTeam(i, 255);
- //printf("%d, %d", i, AllPlayers);
- }
- TeamPlayers[0] = 0;
- TeamPlayers[1] = 0;
- AllPlayers = 0;
- }
- else if(GetPlayerTeam(killerid) == 0)
- {
- TeamScore[0]++;
- TeamScore[1]--;
- TeamPlayers[1]--;
- }
- else if(GetPlayerTeam(killerid) == 1)
- {
- TeamScore[1]++;
- TeamScore[0]--;
- TeamPlayers[0]--;
- }
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(GetPlayerTeam(playerid) == 0)
- {
- TeamPlayers[0]--;
- AllPlayers--;
- }
- else if(GetPlayerTeam(playerid) == 1)
- {
- TeamPlayers[1]--;
- AllPlayers--;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment