Quote:
Originally Posted by funky1234
I know you have already found a way to do it, but you can use an array and reduce the effort it takes to complete such a task:
Example:
pawn Код:
enum S_Info{Float:x, Float:y, Float:z, Float:rot} new Spawn[][S_Info] ={ {x here, y here, z here, rotation here}, //1st Spawn {x here, y here, z here, rotation here} // 2nd Spawn etc etc };
public OnPlayerSpawn(playerid) { new rand = random(sizeof(Spawn)); SetPlayerPos(playerid, Spawn[rand][x], Spawn[rand][y], Spawn[rand][z]); SetPlayerFacingAngle(playerid, Spawn[rand][rot]); return 1; }
It reduces the need for if, else if, else code blocks and makes it easier to edit and add positions.
|
I find my code easier for editing, but thats me lol