Posts: 200
Threads: 19
Joined: Jan 2011
Reputation:
4
Is it possible? and if so how
ADD ME ON STEAM: AKNINJA612
Posts: 379
Threads: 37
Joined: Dec 2010
Reputation:
6
i think this was posted somewhere on the forums try searching for it
Posts: 200
Threads: 19
Joined: Jan 2011
Reputation:
4
(03-03-2011, 11:43)No One Wrote: i think this was posted somewhere on the forums try searching for it
k thanks
ADD ME ON STEAM: AKNINJA612
Posts: 949
Threads: 111
Joined: Oct 2010
Reputation:
30
Code: //goes onplayerspawned
if(self.team == "allies") self thread doallies();
else if(self.team == "axis") self thread doaxis();
doallies()
{
//1111,2222,3333 represents the spawn's coordinate, the function automaticly creates other spawnpoints around it so you don't all spawn on the same place,
//be sure to take a free area so you don't spawn in a tree close to your spawnpoint
self setOrigin((1111 - (25 * self GetEntityNumber()), 2222, 3333));
self setPlayerAngles((0,0,0));
}
doaxis()
{
self setOrigin((1111 - (25 * self GetEntityNumber()), 2222, 3333));
self setPlayerAngles((0,0,0));
}
--
Posts: 2,114
Threads: 278
Joined: Oct 2010
Reputation:
41
You can't but you can do:
Code: doRandomSpawn()
{
switch(randomInt(5)) //selects a random number between 0-4
{
case 0:
spwn = (124, 52, 523); //X, Y, Z
break;
case 1:
spwn = (523, 274, 923);
break;
case 2:
spwn = (473, 463, 413);
break;
case 3:
spwn = (469, 123, 634);
break;
case 4:
spwn = (893, 534, 134);
break;
default: //if somehow it jumped to undefined number (a number which you did not include)
spwn = self.origin; //no change at spawn positions
break;
}
self.origin = spwn; //teleports to new place
}
And if you put that under onPlayerSpawned it looks like a custom spawn point.
Posts: 4,530
Threads: 254
Joined: Nov 2010
Reputation:
65
03-04-2011, 14:26
(This post was last modified: 03-04-2011, 14:26 by AZUMIKKEL.)
can be shortened down to this
Code: spawn = [];
spawn[0] = (x,y,z);
spawn[1] = (x,y,z);
spawn[2] = (x,y,z);
spawn[3] = (x,y,z);
self setOrigin(spawn[RandomInt(spawn.size)]);
or if you want to code it fast
Code: spawn = [];
spawn[spawn.size] = (x,y,z);
spawn[spawn.size] = (x,y,z);
spawn[spawn.size] = (x,y,z);
spawn[spawn.size] = (x,y,z);
spawn[spawn.size] = (x,y,z);
spawn[spawn.size] = (x,y,z);
spawn[spawn.size] = (x,y,z);
spawn[spawn.size] = (x,y,z);
spawn[spawn.size] = (x,y,z);
spawn[spawn.size] = (x,y,z);
self setOrigin(spawn[RandomInt(spawn.size)]);
Posts: 949
Threads: 111
Joined: Oct 2010
Reputation:
30
lol we'r having a battle helping somebody set the spawns ^^
Tnx for sharing azu
--
Posts: 4,530
Threads: 254
Joined: Nov 2010
Reputation:
65
Battle?
I'm just being helpful
Okay.
|