I would do that if I want.
But that's not my problem. I need a command, /start rc, you can find it in training servers.
Let me show you an example.
Code:
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;
}
It's an example, I don't want the other parts (arena & base), I want rc only.
Here is what does the command does (/Start rc): It starts a match between 2 teams (Alpha v Beta), with Combat - Deagle - M4, they keep fighting in the RC Map, when a team wins (Example: Alpha members killing Beta and winning the round) they spawn on the spawn place, with a dialog. And an admin starts the second round... there should be 9 rounds if the Match mode is enabled (/war command to enable it), if it's disabled, you can play as many rounds as you want without any limit. And the dmg you did in the round shows in a dialog (I have the dialog already), and there is a dialog who counts the dmg you have did in all the rounds.
It's simple, and most of the Training servers have the command, and you can join a one to see how is the /Start rc command.
About the example I sent, its owner used YCMD, and I don't know if that will work for me because I am not using YCMD, and I don't know the call backs. That's why I need your help at a new command with call backs.
P.S: I don't know if I'm allowed to say this or not, but you can pm me in Discord to show you some examples (Tell me if you want).