Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public FlagFunc()
- {
- new Msg[200];
- format(Msg, sizeof(Msg), "~w~ .: Score :. ~n~ ~r~%i~w~-~b~%i~n~~n~~w~ .: Joueurs :. ~n~~r~ Rouge~w~ : %i ~n~~b~ Bleu~w~ : %i ~n~", TeamRougeScore, TeamBleuScore, TeamRouge, TeamBleu);
- TextDrawSetString(ScoreDM,Msg);
- if (FlagOwner != 999)
- {
- if (GetPVarInt(FlagOwner, "InAreaFlag") == 1)
- {
- FlagTime = FlagTime - 1;
- new string[256];
- format(string, 256, "%i avant la fin de la manche !", FlagTime);
- SendClientMessageToAll(-1, string);
- if (FlagTime == 0)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerAttachedObjectSlotUsed(i, FlagTeam))
- {
- RemovePlayerAttachedObject(i, FlagTeam);
- GivePlayerMoney(i, 10000);
- SetPVarInt(i, "InAreaFlag", 0);
- FlagOwner = 999;
- FlagLastOwner = 999;
- new string2[256];
- switch(GetPVarInt(i, "TeamDM"))
- {
- case 1:
- {
- format(string2, sizeof(string2), ""COLOR_GREEN"%s"COLOR_WHITE" a fait gagner "COLOR_LRED"10"COLOR_WHITE" point suplémentaire a l'équipe "COLOR_RED"Rouge"COLOR_WHITE".", CheckPlayerName(i));
- TeamRougeScore = TeamRougeScore + 10;
- }
- case 2:
- {
- format(string2, sizeof(string2), ""COLOR_GREEN"%s"COLOR_WHITE" a fait gagner "COLOR_LRED"10"COLOR_WHITE" point suplémentaire a l'équipe "COLOR_BLUE"Bleu"COLOR_WHITE".", CheckPlayerName(i));
- TeamBleuScore = TeamBleuScore + 10;
- }
- }
- SendClientMessageToAll(-1, string2);
- SetDynamicObjectPos(FlagTeamGlobal,-2080.6843,195.4559,35.8256);
- }
- }
- SendClientMessageToAll(-1, "Fin de la manche");
- }
- }
- else
- {
- FlagTime = 10;
- }
- }
- else CheckFlag();
- return 1;
- }
- public CheckFlag()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if (GetObjectToPlayerDistance(i, FlagTeamGlobal) < 5 && i != FlagLastOwner)
- {
- if(GetPlayerVirtualWorld(i) == 20)
- {
- new pName[50];
- GetPlayerName(i, pName, 24);
- SetPlayerAttachedObject(i, FlagTeam, 2914, 1, -0.2, -0.1, 0, 270, 90, 0, 1.500000, 1.500000, 1.500000 );
- SetDynamicObjectPos(FlagTeamGlobal, -1000, -1000, -1000);
- new string[256];
- format(string, sizeof(string), "%s a capturer le drapeau !", pName);
- SendClientMessageToAll(-1, string);
- FlagOwner = i;
- FlagTime = 10;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement