11.07.2018, 22:43
Hello, I'm in need of a command, if you have it or would like to script a one for me, that would be apreciated.
The command is /Start rc (it's /Start [arena - base - rc - last] but I don't need arena & base & last, only Rc).
Now, I'm gonna tell you what is this command for. This command is mostly in training servers, and it can't be in other servers. It starts a match between 2 teams (Alpha V Beta, the names can be changed if you enable the Match-Mode), in RC Battlefield Map. And at the end, you get a dialog that shows the top Dmg's (Top 3 players with high dmg in each round, I have this dialog), and another dialog shows you the dmg of all players. There are 9 rounds (That's only when the match mode is enabled, if it's disabled, you can play as many rounds as you want). And also a dialog that shows the dmg that a player has done in the 9 rounds (that's only when the match mode is enabled, if it's disabled, it keeps counting the dmg without any limit, and it removes once the player leaves).
I just explained the command a bit if you didn't see it before, but if you play in training servers, you would find it for sure.
I have got the /Start command, but RC doesn't exist, and it's the most important map for us, and I also got a one with RC, but it's working with YCMD, and I don't have the call backs, so it didn't want to work.
I will show you this Command:
Here is it, I will show you mine (the one I got, but it doesn't have rc map).
You also can find this cmd on most of training servers. And if you want me to show you some examples on Discord (Tell me).
Thanks for reading, and help me if you can please that would be appreciated.
The command is /Start rc (it's /Start [arena - base - rc - last] but I don't need arena & base & last, only Rc).
Now, I'm gonna tell you what is this command for. This command is mostly in training servers, and it can't be in other servers. It starts a match between 2 teams (Alpha V Beta, the names can be changed if you enable the Match-Mode), in RC Battlefield Map. And at the end, you get a dialog that shows the top Dmg's (Top 3 players with high dmg in each round, I have this dialog), and another dialog shows you the dmg of all players. There are 9 rounds (That's only when the match mode is enabled, if it's disabled, you can play as many rounds as you want). And also a dialog that shows the dmg that a player has done in the 9 rounds (that's only when the match mode is enabled, if it's disabled, it keeps counting the dmg without any limit, and it removes once the player leaves).
I just explained the command a bit if you didn't see it before, but if you play in training servers, you would find it for sure.
I have got the /Start command, but RC doesn't exist, and it's the most important map for us, and I also got a one with RC, but it's working with YCMD, and I don't have the call backs, so it didn't want to work.
I will show you this Command:
Код:
YCMD:start(playerid, params[], help)
{
//if(Player[playerid][Level] < 1 && !IsPlayerAdmin(playerid)) return SendErrorMessage(playerid,"You need to be a higher admin level.");
if(help)
{
SendCommandHelpMessage(playerid, "start a round.");
return 1;
}
if(Current != -1) return SendErrorMessage(playerid,"A round is in progress, please wait for it to end.");
if(AllowStartBase == false) return SendErrorMessage(playerid,"Please wait.");
new Params[2][64], CommandID;
sscanf(params, "ss", Params[0], Params[1]);
if(isnull(Params[0]) || IsNumeric(Params[0])) return
SendUsageMessage(playerid,"/start [base | arena | rc | last] [ID]");
if(!strcmp(Params[0], "rc", true))
{
AllowStartBase = false; // Make sure other player or you yourself is not able to start base on top of another base.
SetTimer("OnRCStart", 2000, false);
new iString[144];
format(iString, sizeof(iString), "{FFFFFF}%s "COL_PRIM"has started RC Battlefield round (Interior: 72)", Player[playerid][Name]);
SendClientMessageToAll(-1, iString);
}
else if(!strcmp(Params[0], "last", true))
{
if(ServerLastPlayed > -1 && ServerLastPlayedType > -1)
{
if(ServerLastPlayedType == 1)
{
new BaseID = ServerLastPlayed;
if(BaseID > MAX_BASES) return SendErrorMessage(playerid,"The last played base does not exist.");
if(!BExist[BaseID]) return SendErrorMessage(playerid,"The last played base does not exist.");
AllowStartBase = false; // Make sure other player or you yourself is not able to start base on top of another base.
SetTimerEx("OnBaseStart", 2000, false, "i", BaseID);
new iString[144];
format(iString, sizeof(iString), "{FFFFFF}%s "COL_PRIM"has started the last played Base: {FFFFFF}%s (ID: %d)", Player[playerid][Name], BName[BaseID], BaseID);
SendClientMessageToAll(-1, iString);
GameType = BASE;
goto skipped;
}
else if(ServerLastPlayedType == 0)
{
new ArenaID = ServerLastPlayed;
if(ArenaID > MAX_ARENAS) return SendErrorMessage(playerid,"The last played arena does not exist.");
if(!AExist[ArenaID]) return SendErrorMessage(playerid,"The last played arena does not exist.");
GameType = ARENA;
AllowStartBase = false; // Make sure other player or you yourself is not able to start base on top of another base.
SetTimerEx("OnArenaStart", 2000, false, "i", ArenaID);
new iString[144];
format(iString, sizeof(iString), "{FFFFFF}%s "COL_PRIM"has started the last played Arena: {FFFFFF}%s (ID: %d)", Player[playerid][Name], AName[ArenaID], ArenaID);
SendClientMessageToAll(-1, iString);
goto skipped;
}
}
else
return SendErrorMessage(playerid, "No bases/arenas have been played lately!");
}
else if(strcmp(Params[0], "base", true) == 0) CommandID = 1;
else if(strcmp(Params[0], "arena", true) == 0) CommandID = 2;
else return
SendUsageMessage(playerid,"/start [base | arena | rc | last] [ID]");
if(!IsNumeric(Params[1])) return SendErrorMessage(playerid,"Base/Arena ID can only be numerical.");
if(CommandID == 1) {
new BaseID = strval(Params[1]);
if(BaseID > MAX_BASES) return SendErrorMessage(playerid,"That base does not exist.");
if(!BExist[BaseID]) return SendErrorMessage(playerid,"That base does not exist.");
AllowStartBase = false; // Make sure other player or you yourself is not able to start base on top of another base.
SetTimerEx("OnBaseStart", 2000, false, "i", BaseID);
new iString[144];
format(iString, sizeof(iString), "{FFFFFF}%s "COL_PRIM"has started Base: {FFFFFF}%s (ID: %d)", Player[playerid][Name], BName[BaseID], BaseID);
SendClientMessageToAll(-1, iString);
} else if(CommandID == 2) {
new ArenaID = strval(Params[1]);
if(ArenaID > MAX_ARENAS) return SendErrorMessage(playerid,"That arena does not exist.");
if(!AExist[ArenaID]) return SendErrorMessage(playerid,"That arena does not exist.");
AllowStartBase = false; // Make sure other player or you yourself is not able to start base on top of another base.
SetTimerEx("OnArenaStart", 2000, false, "i", ArenaID);
new iString[144];
format(iString, sizeof(iString), "{FFFFFF}%s "COL_PRIM"has started Arena: {FFFFFF}%s (ID: %d)", Player[playerid][Name], AName[ArenaID], ArenaID);
SendClientMessageToAll(-1, iString);
}
skipped:
foreach(new i : Player) {
if(CanPlay(i)) {
TogglePlayerControllable(i, 0); // Pause all the players.
Player[i][ToAddInRound] = true;
}
}
return 1;
}
Код:
CMD:start(playerid, params[])
{
if(Player[playerid][Level] < 1) return SendClientMessage(playerid,-1,"{FFFFFF}Error: {FF5555}You need to be a higher admin level.");
if(Current != -1) return SendClientMessage(playerid,-1,"{FFFFFF}Error: {FF5555}A round is in progress, please wait for it to end.");
if(AllowStartBase == false) return SendClientMessage(playerid,-1,"{FFFFFF}Error: {FF5555}Please wait.");
new Params[2][64], iString[160], CommandID;
sscanf(params, "s[64]s[64]", Params[0], Params[1]);
if(isnull(Params[0]) || IsNumeric(Params[0])) return SendClientMessage(playerid,-1,"{FFFFFF}Usage: {FF5555}/start [base | arena] [ID]");
if(strcmp(Params[0], "base", true) == 0) CommandID = 1;
else if(strcmp(Params[0], "arena", true) == 0) CommandID = 2;
else return SendClientMessage(playerid,-1,"{FFFFFF}Usage: {FF5555}/start [base | arena] [ID]");
if(!IsNumeric(Params[1])) return SendClientMessage(playerid,-1,"{FFFFFF}Error: {FF5555}Base/Arena ID can only be numerical.");
if(CommandID == 1) {
new BaseID = strval(Params[1]);
if(BaseID > MAX_BASES) return SendClientMessage(playerid,-1,"{FFFFFF}Error: {FF5555}That base does not exist.");
if(!BExist[BaseID]) return SendClientMessage(playerid,-1,"{FFFFFF}Error: {FF5555}That base does not exist.");
AllowStartBase = false; // Make sure other player or you yourself is not able to start base on top of another base.
SetTimerEx("OnBaseStart", 4000, false, "i", BaseID);
format(iString, sizeof(iString), "{FFFFFF}%s {FF5555}has started Base: {FFFFFF}%s (ID: %d)", Player[playerid][Name], BName[BaseID], BaseID);
SendClientMessageToAll(-1, iString);
GameType = BASE;
} else if(CommandID == 2) {
new ArenaID = strval(Params[1]);
if(ArenaID > MAX_ARENAS) return SendClientMessage(playerid,-1,"{FFFFFF}Error: {FF5555}That arena does not exist.");
if(!AExist[ArenaID]) return SendClientMessage(playerid,-1,"{FFFFFF}Error: {FF5555}That anrea does not exist.");
AllowStartBase = false; // Make sure other player or you yourself is not able to start base on top of another base.
SetTimerEx("OnArenaStart", 4000, false, "i", ArenaID);
format(iString, sizeof(iString), "{FFFFFF}%s {FF5555}has started Arena: {FFFFFF}%s (ID: %d)", Player[playerid][Name], AName[ArenaID], ArenaID);
SendClientMessageToAll(-1, iString);
GameType = ARENA;
}
foreach(new i : Player) {
if(Player[i][Team] == ATTACKER || Player[i][Team] == DEFENDER) {
TogglePlayerControllable(i, false); // Pause all the players.
}
}
return 1;
}
Thanks for reading, and help me if you can please that would be appreciated.

