Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*foreach(Player, i)
- {
- switch(PlayerInfo[i][Team])
- {
- case TEAM_USA: tcount[TEAM_USA]++;
- case TEAM_UK: tcount[TEAM_UK]++;
- case TEAM_GER: tcount[TEAM_GER]++;
- case TEAM_ARAB: tcount[TEAM_ARAB]++;
- case TEAM_RUS: tcount[TEAM_RUS]++;
- case TEAM_BALKAN: tcount[TEAM_BALKAN]++;
- case TEAM_TURKEY: tcount[TEAM_TURKEY]++;
- case TEAM_TERROR: tcount[TEAM_TERROR]++;
- case TEAM_CIVIL: tcount[TEAM_CIVIL]++;
- }
- }*/
- public OnPlayerDisconnect(playerid,reason)
- {
- if(PlayerInfo[playerid][Team] != TEAM_NONE) TeamInfo[PlayerInfo[playerid][Team]][team_count]--;
- return 1;
- }
- // need to update the teams in /setteam
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- static str[128];
- for(new i=0; i < 100; i++) SendClientMessage(playerid, WHITE, " ");
- SendDeathMessageToPlayer(playerid, 202, 202, 202);
- SendDeathMessageToPlayer(playerid, 202, 202, 202);
- SendDeathMessageToPlayer(playerid, 202, 202, 202);
- SendDeathMessageToPlayer(playerid, 202, 202, 202);
- SendDeathMessageToPlayer(playerid, 202, 202, 202);
- SendDeathMessageToPlayer(playerid, 202, 202, 202);
- //if(_:clickedid == INVALID_TEXT_DRAW) return SelectTextDraw(playerid, 0xFF0000FF);
- new total = GetPlayerPoolSize();
- for(new x=1; x < sizeof(TeamInfo); x++)
- {
- if(clickedid == TeamInfo[x][team_td])
- {
- if(TeamInfo[x][team_count] > (total/4) && total > 20) return SendClientMessage(playerid, RED, "This team is full."), 1;
- if(PlayerInfo[playerid][Team] != TEAM_NONE) TeamInfo[PlayerInfo[playerid][Team]][team_count]--;
- SetPlayerTeam(playerid, x);
- PlayerInfo[playerid][Team] = x;
- TeamInfo[x][team_count]++;
- format(str,sizeof(str), "Team set: %s.", TeamName(PlayerInfo[playerid][Team]));
- SendClientMessage(playerid, GREY, str);
- PlayerPlaySound(playerid, 1149, 0.0, 0.0, 0.0);
- if(x == TEAM_TERROR)
- {
- PlayerInfo[playerid][Class] = SUICIDER;
- CancelSelectTextDraw(playerid);
- ChosenClass[playerid] = false, ChosenTeam[playerid] = false;
- for(new y=0; y < sizeof(OutLook); y++) TextDrawHideForPlayer(playerid, OutLook[y]);
- for(new y=1; y < sizeof(TeamInfo); y++) TextDrawHideForPlayer(playerid, TeamInfo[y][team_td]);
- for(new y=1; y < sizeof(ClassInfo); y++) TextDrawHideForPlayer(playerid, ClassInfo[y][class_td]);
- SetSpawnInfo(playerid, TEAM_TERROR, 144, -88.0120, 1378.4677, 10.2734, 0, 0, 0, 0, 0, 0, 0);
- PlayerPlaySound(playerid, 1184, 0.0, 0.0, 0.0);
- TogglePlayerSpectating(playerid, false);
- }
- else ChosenTeam[playerid] = true, PlayerInfo[playerid][Class] = ASSAULT;
- return 1; //Player choose a Team TD so needn't check the Class TD
- }
- }
- for(new x=1; x < sizeof(ClassInfo)-1; x++)
- {
- if(clickedid == ClassInfo[x][class_td])
- {
- if(!ChosenTeam[playerid]) return SendClientMessage(playerid, RED, "You need to choose your team before choosing your class.");
- if(x == DONATOR && PlayerInfo[playerid][VIP] < 5) return SendClientMessage(playerid, RED, "You need VIP level 5 to use Donator class.");
- if(PlayerInfo[playerid][Rank] < ClassInfo[x][class_rank])
- {
- format(str,sizeof(str), "You need rank %d (%d score) for %s class.", ClassInfo[x][class_rank], Ranks[ClassInfo[x][class_rank]][rank_score], ClassName(x));
- return SendClientMessage(playerid, RED, str);
- }
- PlayerInfo[playerid][Class] = x;
- PlayerPlaySound(playerid, 1149, 0.0, 0.0, 0.0);
- format(str,sizeof(str), "Class set: %s.", ClassName(PlayerInfo[playerid][Class]));
- SendClientMessage(playerid, GREY, str);
- //------------------------------------------------------------------
- CancelSelectTextDraw(playerid);
- ChosenClass[playerid] = false, ChosenTeam[playerid] = false;
- for(new y=0; y < sizeof(OutLook); y++) TextDrawHideForPlayer(playerid, OutLook[y]);
- for(new y=1; y < sizeof(TeamInfo); y++) TextDrawHideForPlayer(playerid, TeamInfo[y][team_td]);
- for(new y=1; y < sizeof(ClassInfo); y++) TextDrawHideForPlayer(playerid, ClassInfo[y][class_td]);
- switch(PlayerInfo[playerid][Team])
- {
- case TEAM_USA: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 287, -253.7154, 2603.2998, 62.8582, 0, 0, 0, 0, 0, 0, 0);
- case TEAM_UK: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 285, -136.3097, 1116.5957, 20.1966, 0, 0, 0, 0, 0, 0, 0);
- case TEAM_GER: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 121, -1394.5361, 498.3870, 18.2344, 0, 0, 0, 0, 0, 0, 0);
- case TEAM_ARAB: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 143, -741.9535, 1586.3195, 27.1244, 0, 0, 0, 0, 0, 0, 0);
- case TEAM_RUS: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 179, -1483.3645, 2626.5925, 58.7813, 0, 0, 0, 0, 0, 0, 0);
- case TEAM_BALKAN: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 250, 950.7467, 2361.2383, 10.8203, 0, 0, 0, 0, 0, 0, 0);
- case TEAM_TURKEY: SetSpawnInfo(playerid, PlayerInfo[playerid][Team], 122, -2279.4128, 2288.3809, 4.9645, 0, 0, 0, 0, 0, 0, 0);
- case TEAM_CIVIL: SetSpawnInfo(playerid, NO_TEAM, 288, 2592.2097, 2790.6689, 11.3685, 0, 0, 0, 0, 0, 0, 0), SetPlayerTeam(playerid, NO_TEAM);
- }
- PlayerPlaySound(playerid, 1184, 0.0, 0.0, 0.0);
- TogglePlayerSpectating(playerid, false);
- break;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment