Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new IsInBA[MAX_PLAYERS];
- new Text:BATD[2];
- new BAPlayers;
- // la OnPlayerDeath
- if(IsInBA[playerid] == 1)
- {
- BAPlayers -= 1;
- TextDrawHideForPlayer(playerid, BATD[0]);
- TextDrawHideForPlayer(playerid, BATD[1]);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerHealthEx(playerid, 100);
- IsInBA[playerid] = 0;
- SCM(playerid, -1, "Because you died you have been respawned to your house.");
- }
- // La OnGameModeInit
- CreateObject(358, 1045.7656,1011.8483,11.0000, 0.00000, 0.00000, 0.00000);
- BAPlayers = 0;
- BATD[0] = TextDrawCreate(126.000106, 322.906799, "PLAYERS");
- TextDrawLetterSize(BATD[0], 0.382400, 1.719467);
- TextDrawAlignment(BATD[0], 3);
- TextDrawColor(BATD[0], -1);
- TextDrawSetOutline(BATD[0], 1);
- TextDrawBackgroundColor(BATD[0], 255);
- TextDrawFont(BATD[0], 3);
- TextDrawSetProportional(BATD[0], 1);
- BATD[1] = TextDrawCreate(69.999992, 320.666625, "10");
- TextDrawLetterSize(BATD[1], 0.367199, 2.130133);
- TextDrawAlignment(BATD[1], 3);
- TextDrawColor(BATD[1], -26113);
- TextDrawSetOutline(BATD[1], 1);
- TextDrawBackgroundColor(BATD[1], 255);
- TextDrawFont(BATD[1], 2);
- TextDrawSetProportional(BATD[1], 1);
- Create3DTextLabel("{FFFF99}Battle Arena\n{FFFFFF}Type {FFFF99}[/enterba]{FFFFFF} to enter in arena.",0xFFFFFFFF,1045.7656,1011.8483,11.0000,5.0, 0, 1);
- // La onPlayerConnect
- IsInBA[playerid] = 0;
- // Comenzile:
- CMD:enterba(playerid, params[])
- {
- if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
- if(IsPlayerInRangeOfPoint(playerid, 3.0, 1045.7656,1011.8483,11.0000))
- {
- SetPlayerVirtualWorld(playerid, 27127);
- IsInBA[playerid] = 1;
- BAPlayers += 1;
- TextDrawShowForPlayer(playerid, BATD[0]);
- TextDrawShowForPlayer(playerid, BATD[1]);
- GivePlayerWeaponEx(playerid, 24, 1000);
- GivePlayerWeaponEx(playerid, 31, 1000);
- SetPlayerHealthEx(playerid, 100);
- foreach(Player, i)
- {
- if(IsInBA[i] == 1) {
- new string[2];
- format(string, sizeof(string), "%d", BAPlayers);
- TextDrawSetString(BATD[1], string);
- TextDrawShowForPlayer(i, BATD[0]);
- TextDrawShowForPlayer(i, BATD[1]);
- }
- }
- SetPlayerPos(playerid, 2245.8538,1087.8802,469.6204);
- GivePlayerWeaponEx(playerid, 46, 1);
- SCM(playerid, -1, "You need to parachute in the castles to battle");
- }
- return 1;
- }
- CMD:exitba(playerid, params[])
- {
- if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
- if(IsInBA[playerid] == 1)
- {
- IsInBA[playerid] = 0;
- SCM(playerid, -1, "You have left Battle Arena");
- BAPlayers -= 1;
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerPos(playerid, 1045.7656,1011.8483,11.0000);
- TextDrawHideForPlayer(playerid, BATD[0]);
- TextDrawHideForPlayer(playerid, BATD[1]);
- foreach(Player, i)
- {
- if(IsInBA[i] == 1) {
- new string[2];
- format(string, sizeof(string), "%d", BAPlayers);
- TextDrawSetString(BATD[1], string);
- TextDrawShowForPlayer(i, BATD[0]);
- TextDrawShowForPlayer(i, BATD[1]);
- }
- }
- ResetPlayerWeaponsEx(playerid);
- SetPlayerHealthEx(playerid, 100);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement