Jump to content
  • 0

pomoc Nefunguje random spawn


LemoNSK

Dotaz

Nevíte proč toto nefunguje? Píše mi to errory ale nevím je opravit, sem totiž začátečník. Prosím opravte errory dekuju vám.

 

 

 

new BFSPAWNS[] = {
  535.43,911.73,-41.56,
  678.79,833.78,-42.00,
  623.58,953.55,-33.82,
  2
};
 
 
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid, BFSPAWNS[random(3)]);
return 1;
}
 
 
Errory:
 
C:\Users\LemoNSK\Desktop\Battlefield 4.pwn(95) : error 017: undefined symbol "BFSPAWNS"
C:\Users\LemoNSK\Desktop\Battlefield 4.pwn(95) : error 001: expected token: ";", but found "]"
C:\Users\LemoNSK\Desktop\Battlefield 4.pwn(95) : error 029: invalid expression, assumed zero
C:\Users\LemoNSK\Desktop\Battlefield 4.pwn(95) : fatal error 107: too many error messages on one line
 
Link to comment
Share on other sites

4 odpovědí na tuto otázku

Recommended Posts

  • 0

new Float:BFSPAWNS[][] = {

  { 535.43,911.73,-41.56},

  {678.79,833.78,-42.00},

  {623.58,953.55,-33.82}

};

 

a ptm:

 

SetPlayerPos(playerid, BFSPAWNS[random(3)][0], BFSPAWNS[random(3)][1], BFSPAWNS[random(3)][2]);

Link to comment
Share on other sites

  • 0

new Float:BFSPAWNS[][] = {

  { 535.43,911.73,-41.56},

  {678.79,833.78,-42.00},

  {623.58,953.55,-33.82}

};

 

a ptm:

 

SetPlayerPos(playerid, BFSPAWNS[random(3)][0], BFSPAWNS[random(3)][1], BFSPAWNS[random(3)][2]);

 

Nejsem si jistej, ale myslim, že takhle ti vždy random hodí jiné číslo .. takže

new rand = random(3);
SetPlayerPos(playerid, BFSPAWNS[rand][0], BFSPAWNS[rand][1], BFSPAWNS[rand][2]);
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...