Different spawns for players and death list
#1

Well, I'm wondering how can you make different spawns for players. I mean, if there are 20 players in your server, you want to spawn them in different positions? Any idea how?

2. I want to make a custom deahtlist, which chows who dies first, second and so on. Can someone give me a basic code, where I can start from? Basically, I will make something like 10 Textdraws, every time a player dies, a textdraw is going to get filled up with his name, so if we got 1. -, it will be come 1. Private200, I though of an stock to fix this, but maybe there's a easier way? I mean, instead of using "if(FirstDeath == 1)" that shows if firstdeath has been done, than go to the next textdraw. It is like textdraw usage.
Reply
#2

You want total random spawns or you save ~10 positions and then it chooses randomly a position?
Reply
#3

I don't know what's the difference, they still want a basic code.

I might have something like 20 spawns. I have 10 players, I want to spawn them on one of these spawns, but it shall not be the same.
Reply
#4

Read this: https://sampwiki.blast.hk/wiki/Random
Reply
#5

For random spawns:
pawn Код:
new
    Float:gSpawnPoints[][4] =
    {
        {0.0, 0.0, 0.0, 180.0},
        {11.0, 12.0, 13.0, 17.0}
    };

public OnPlayerSpawn(playerid)
{
    new
        randSpawn = random(sizeof(gSpawnPoints));
    SetPlayerPos(playerid, gSpawnPoints[randSpawn][0], gSpawnPoints[randSpawn][1], gSpawnPoints[randSpawn][2]);
    SetPlayerFacingAngle(playerid, gSpawnPoints[randSpawn][3]);
    return 1;
}
Reply
#6

I know how to make people random spawn, but I want to do the random spawn for something like 20 people and I don't want them to be on top of each other because they will be inside vehicles. Like a DD/DM spawning system guys..
Reply
#7

bump
Reply
#8

Quote:
Originally Posted by Private200
Посмотреть сообщение
I know how to make people random spawn, but I want to do the random spawn for something like 20 people and I don't want them to be on top of each other because they will be inside vehicles. Like a DD/DM spawning system guys..
then use the random that you created. and add it on OnPlayerSpawn
Reply
#9

Than stop reusing the same coordinate, just asign each player an idividual position
If you got two array, one player array (players) and one with the positions (data) you only need to loop through them
pawn Код:
for(new idx; idx < PLAYER_COUNT_WHO_JOINT; idx++) {
    SetPlayerPos(player[idx], data[idx][0], data[idx][1], data[idx][2]);
    SetPlayerFacingAngle(player[idx], data[idx][3]);
}
Now you only need to limit the players who can join to the maximal position number
Reply
#10

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
Now you only need to limit the players who can join to the maximal position number
That's what I'm actually trying to figure out and what I need help mainly with.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)