random teams
#1

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 ^^
Reply
#2

bump
Reply
#3

What error's are you getting ?
Reply
#4

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.
Reply
#5

But can you give a different code but it will give random when typing a command?
Reply
#6

bump
Reply
#7

Post the error codes here.
Reply
#8

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]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)