11.04.2015, 13:28
I was following a tutorial on creating a random spawning system, and I was getting errors with the code I wasn't sure about how to fix. I would post on the tutorial, but I'm not going to bump a post from mid-way 2014, so I figured I'd post here.
And this is the code for spawning
The float
I can't find what I did wrong, been trying to figure it out for the past hour almost, anyone able to help?
Код:
C:\Users\Windows7\Desktop\SAMP My Script\gamemodes\Gamemode.pwn(73) : error 017: undefined symbol "RandomSpawns" C:\Users\Windows7\Desktop\SAMP My Script\gamemodes\Gamemode.pwn(73) : error 029: invalid expression, assumed zero C:\Users\Windows7\Desktop\SAMP My Script\gamemodes\Gamemode.pwn(73) : warning 215: expression has no effect C:\Users\Windows7\Desktop\SAMP My Script\gamemodes\Gamemode.pwn(74) : error 017: undefined symbol "RandomSpawns" C:\Users\Windows7\Desktop\SAMP My Script\gamemodes\Gamemode.pwn(74) : warning 215: expression has no effect C:\Users\Windows7\Desktop\SAMP My Script\gamemodes\Gamemode.pwn(74) : error 001: expected token: ";", but found "]" C:\Users\Windows7\Desktop\SAMP My Script\gamemodes\Gamemode.pwn(74) : error 029: invalid expression, assumed zero C:\Users\Windows7\Desktop\SAMP My Script\gamemodes\Gamemode.pwn(74) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 6 Errors.
Код:
public OnPlayerSpawn(playerid) { new Random = random(sizeof(RandomSpawns)); // 73 SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]); // 74 SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]); // return 1; }
Код:
new Float:RandomSpawns[][] = { {1299.6201, 303.8129, 27.5555, 334.1266}, // Randomspawn {1300.2102, 224.2214, 23.7565, 171.3810}, // Randomspawn {1327.3563, 217.3694, 23.9410, 254.5809}, // Randomspawn {1351.4109, 181.9179, 19.6343, 241.7132} // Randomspawn };