Random Gms - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Random Gms (
/showthread.php?tid=260741)
Random Gms -
muhib777 - 10.06.2011
Is there a way to make a score count of both teams so each time they kill someone theyre teams total killcount will show for everyone.
Also is there a way once a timer is done the gamemode will change into a random one?
Re: Random Gms -
0ne - 10.06.2011
Well your question answers would be: Yes there are ways to both of them. To make score count to both teams just create 2 new vars like this:
new teamkillcount1;
new teamkillcount2;
OnPlayerDeath
check if the killer is from one team(if you have it defined)
teamkillcount1++;
new str[24];
format(str,sizeof(str),"Team one now has: %d kills",teamkillcount1);
SendClientMessageToAll(COLOR,str);
check if the killer is from other team(if you have it defined)
teamkillcount2++;
format(str,sizeof(str),"Team two now has: %d kills",teamkillcount2;
SendClientMessageToAll(COLOR,str);
That is of course if you use messages. If you want to use a textdraw check wiki, it has a good explanation.
For the gamemode changing part there is a simple way:
new GameModes[][] = {
{"lvdm"},{"grandlarc"} // Put in bunch of game mode names you want to change here
};
after this is done put on a timer ongamemodeinit or somewhere to set it for the first time to count to a gamemode change. ex: SetTimer("GMChange",3000000,0); // Not repeatable,changes after 5mins
in the timer callback put:
public GMChange();
{
SendRconCommand("changemode",random(GameModes));
}
and that should be it.
P.s code untested writed it asap. GL.