random teams - 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 teams (
/showthread.php?tid=247022)
random teams -
fissekarl - 07.04.2011
I have done like this to set random teams, and I know myself it wont work.
But I need help
I have done like this
pawn Код:
#define ATTACK 100
#define DEFENCE 101
pawn Код:
new SetTeam[][2] =
{
{SetPlayerTeam, 100},
{SetPlayerTeam, 101}
};
Then in a command
pawn Код:
new teamrandom = random(sizeof(SetTeamm));
SetPlayerTeam(i, SetTeam[SetTeam][100], SetTeam[SetTeam][101]);
Yes this makes error, but I want a working code like this, i dont expect that code there work ^^
Re: random teams -
fissekarl - 07.04.2011
bump
Re: random teams -
Stigg - 07.04.2011
What error's are you getting ?
Re: random teams -
alpha500delta - 07.04.2011
It's SetTeam not SetTeamm
Also you have defined ATTACK to 100, but you're still using 100. And you're not using a loop in SetPlayerTeam.
Re: random teams -
fissekarl - 07.04.2011
But can you give a different code but it will give random when typing a command?
Re: random teams -
fissekarl - 08.04.2011
bump
Re: random teams -
[BKR]LUCAGRABACR - 08.04.2011
Post the error codes here.
Re: random teams -
fissekarl - 08.04.2011
pawn Код:
E:\GTA San Andreas\DM\gamemodes\DM.pwn(179) : error 076: syntax error in the expression, or invalid function call
E:\GTA San Andreas\DM\gamemodes\DM.pwn(181) : error 010: invalid function or declaration
E:\GTA San Andreas\DM\gamemodes\DM.pwn(1782) : error 032: array index out of bounds (variable "SetTeam")
E:\GTA San Andreas\DM\gamemodes\DM.pwn(2781) : warning 203: symbol is never used: ""
EDIT:
I got this in my command now
pawn Код:
new rand = random(sizeof(RandomSpawn));
new teamrand = random(sizeof(SetTeam));
SetPlayerTeam(i, SetTeam[teamrand][100], SetTeam[teamrand][101]);