Different spawn
#1

Hai everyone
i am making a SACNR and i want my cop class to spawn in 3 differnt places, like

LV, LS and SF
Can i get any help ?
Reply
#2

Just use random?

random

Then you can define three different spawns and depending on the random result you spawn them at each one of them. You can't spawn someone at three places at the same time anyway
Reply
#3

yea i mean random ofcourse else the cop guy have to bwe splitted iin 3 :P

Thanks
Reply
#4

i got it compiled, but when i use /kill to test each city with cop i just spawn random places like where civilian shall spawn etc
Reply
#5

You have to set teams.
Reply
#6

like how?
Reply
#7

Anyone??
Reply
#8

pawn Код:
new spawn[4] = { // you will just create new spawn's for each teams with different position's.
    cords,
    cords1,
    cords2,
    cords3,
};
new Teamspawn[2] = { // TEAM SPAWN...
    cords,
    cords1,
};

public OnPlayerSpawn(playerid)
{
   SetPlayerPos(playerid,spawn[random(sizeof(spawn)]);
}
//if you wish to teams..
   
public OnPlayerSpawn(playerid)
{
   if(gTeam == 1) // this can be different in your gm...
   {
      SetPlayerPos(playerid,Teamspawn[random(sizeof(Teamspawn)]);
   }
   // and so on...
}
Reply
#9

Thanks
Reply
#10

i am getting those 3 errors:
Quote:

C:\Users\Kajinth Thaas\Desktop\SACNR\gamemodes\SACNR.pwn(3222) : error 008: must be a constant expression; assumed zero
C:\Users\Kajinth Thaas\Desktop\SACNR\gamemodes\SACNR.pwn(3233) : error 033: array must be indexed (variable "gTeam")
C:\Users\Kajinth Thaas\Desktop\SACNR\gamemodes\SACNR.pwn(3235) : error 001: expected token: ",", but found "]"

and my code for it is

Quote:

new Teamspawn[3] = { // TEAM SPAWN...
{1568.2250,-1693.5483,5.8906,177.0983},
{-1604.8442,732.9442,-5.2344,37.6041},
{2343.4553,2455.5994,14.9688,96.5022}
};



public OnPlayerSpawn(playerid)
{


if(gTeam == TEAM_COPS) // this can be different in your gm...
{
SetPlayerPos(playerid,Teamspawn[random(sizeof(Teamspawn)]);
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)