[AYUDA]Problemas con RandomSpawn
#1

holaaa

bueno quisiera saber si me pueden dar una mano puse en mi sv el randomspawn para q spawneen en muchos lugares pero tiene un bug :S

cuando entras al server y spawneas despues de elejir skin no carga ningun mapa, nisikiera el de los teleport, pero una ves q te matan o pone /kill ahi recien cargan los mapas,,,,,

alguna respuesta?? nose q sera pero creo q no puse nada mal
Reply
#2

como hiciste el randomspawn?
Reply
#3

Quote:
Originally Posted by the_chaoz
como hiciste el randomspawn?
Aca estan los codigos:
pawn Код:
forward SetPlayerRandomSpawn(playerid);

new iSpawnSet[MAX_PLAYERS];
new Float:gRandomPlayerSpawns[22][3] =
{
{2199.6531,1393.3678,10.8203},
{2483.5977,1222.0825,10.8203},
{2637.2712,1129.2743,11.1797},
{2000.0106,1521.1111,17.0625},
{2024.8190,1917.9425,12.3386},
{2261.9048,2035.9547,10.8203},
{2262.0986,2398.6572,10.8203},
{2244.2566,2523.7280,10.8203},
{2335.3228,2786.4478,10.8203},
{2150.0186,2734.2297,11.1763},
{2158.0811,2797.5488,10.8203},
{1969.8301,2722.8564,10.8203},
{1652.0555,2709.4072,10.8265},
{1564.0052,2756.9463,10.8203},
{1271.5452,2554.0227,10.8203},
{1441.5894,2567.9099,10.8203},
{1480.6473,2213.5718,11.0234},
{1400.5906,2225.6960,11.0234},
{1598.8419,2221.5676,11.0625},
{1318.7759,1251.3580,10.8203},
{1558.0731,1007.8292,10.8125},
{1705.2347,1025.6808,10.8203}
};
y abajo esto:
pawn Код:
public OnPlayerSpawn(playerid)

{
    SetPlayerRandomSpawn(playerid);
    return 1;
}
public SetPlayerRandomSpawn(playerid)
{
  if (iSpawnSet[playerid] == 0)
  {
        new rand = random(sizeof(gRandomPlayerSpawns));
        SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
    }
    return 1;
}
Eso es todo pero no me tira ningun error

asike ni idea
Reply
#4

Код:
public OnPlayerSpawn(playerid)
{
  new randomspawn = random(8);
  switch(randomspawn)
  {
    case 0: SetPlayerPos(playerid, X, Y, Z);
    case 1: SetPlayerPos(playerid, X, Y, Z);
    case 2: SetPlayerPos(playerid, X, Y, Z);
    case 3: SetPlayerPos(playerid, X, Y, Z);
    case 4: SetPlayerPos(playerid, X, Y, Z);
    case 5: SetPlayerPos(playerid, X, Y, Z);
    case 6: SetPlayerPos(playerid, X, Y, Z);
    case 7: SetPlayerPos(playerid, X, Y, Z);
  }
  return 1;
}
Usa ese ami me sirvio
Reply
#5

Quote:
Originally Posted by angel-laam
Код:
public OnPlayerSpawn(playerid)
{
  new randomspawn = random(8);
  switch(randomspawn)
  {
    case 0: SetPlayerPos(playerid, X, Y, Z);
    case 1: SetPlayerPos(playerid, X, Y, Z);
    case 2: SetPlayerPos(playerid, X, Y, Z);
    case 3: SetPlayerPos(playerid, X, Y, Z);
    case 4: SetPlayerPos(playerid, X, Y, Z);
    case 5: SetPlayerPos(playerid, X, Y, Z);
    case 6: SetPlayerPos(playerid, X, Y, Z);
    case 7: SetPlayerPos(playerid, X, Y, Z);
  }
  return 1;
}
Usa ese ami me sirvio
Pero lo que tu dices es por si hay 8 jugadores.
Reply
#6

Quote:
Originally Posted by CristianTdj
Quote:
Originally Posted by angel-laam
Код:
public OnPlayerSpawn(playerid)
{
  new randomspawn = random(8);
  switch(randomspawn)
  {
    case 0: SetPlayerPos(playerid, X, Y, Z);
    case 1: SetPlayerPos(playerid, X, Y, Z);
    case 2: SetPlayerPos(playerid, X, Y, Z);
    case 3: SetPlayerPos(playerid, X, Y, Z);
    case 4: SetPlayerPos(playerid, X, Y, Z);
    case 5: SetPlayerPos(playerid, X, Y, Z);
    case 6: SetPlayerPos(playerid, X, Y, Z);
    case 7: SetPlayerPos(playerid, X, Y, Z);
  }
  return 1;
}
Usa ese ami me sirvio
Pero lo que tu dices es por si hay 8 jugadores.
claro esas son los sppawns para cada skin y yo lo q busco es q todos los skins spawneen en todos los lugares :S
pero no me funciona nose q le pasara ya explike q e s lo q susede
Reply
#7

Quote:
Originally Posted by laborgward
Quote:
Originally Posted by CristianTdj
Quote:
Originally Posted by angel-laam
Код:
public OnPlayerSpawn(playerid)
{
  new randomspawn = random(8);
  switch(randomspawn)
  {
    case 0: SetPlayerPos(playerid, X, Y, Z);
    case 1: SetPlayerPos(playerid, X, Y, Z);
    case 2: SetPlayerPos(playerid, X, Y, Z);
    case 3: SetPlayerPos(playerid, X, Y, Z);
    case 4: SetPlayerPos(playerid, X, Y, Z);
    case 5: SetPlayerPos(playerid, X, Y, Z);
    case 6: SetPlayerPos(playerid, X, Y, Z);
    case 7: SetPlayerPos(playerid, X, Y, Z);
  }
  return 1;
}
Usa ese ami me sirvio
Pero lo que tu dices es por si hay 8 jugadores.
claro esas son los sppawns para cada skin y yo lo q busco es q todos los skins spawneen en todos los lugares :S
pero no me funciona nose q le pasara ya explike q e s lo q susede
En el numero 8 tienes qe cambiar el numero de cordenadas qe pongas
por ejemplo si pones 15 cordenadas distintas pones

Код:
new randomSpawn = random(15);
y ya pones los case
Код:
    case 0: SetPlayerPos(playerid, X, Y, Z);
    case 1: SetPlayerPos(playerid, X, Y, Z);
    case 2: SetPlayerPos(playerid, X, Y, Z);
    case 3: SetPlayerPos(playerid, X, Y, Z);
    case 4: SetPlayerPos(playerid, X, Y, Z);
    case 5: SetPlayerPos(playerid, X, Y, Z);
    case 6: SetPlayerPos(playerid, X, Y, Z);
    case 7: SetPlayerPos(playerid, X, Y, Z);
    case 8: SetPlayerPos(playerid, X, Y, Z);
    case 9: SetPlayerPos(playerid, X, Y, Z);
    case 10: SetPlayerPos(playerid, X, Y, Z);
    case 11: SetPlayerPos(playerid, X, Y, Z);
    case 12: SetPlayerPos(playerid, X, Y, Z);
    case 13: SetPlayerPos(playerid, X, Y, Z);
    case 14: SetPlayerPos(playerid, X, Y, Z);
y este funciona con todos los Skins cualkier skin aparece en distintos lugares al morir y al entrar atu server

Код:
public OnPlayerSpawn(playerid)
{
  new randomspawn = random(15);
  switch(randomspawn)
  {
    case 0: SetPlayerPos(playerid, X, Y, Z);
    case 1: SetPlayerPos(playerid, X, Y, Z);
    case 2: SetPlayerPos(playerid, X, Y, Z);
    case 3: SetPlayerPos(playerid, X, Y, Z);
    case 4: SetPlayerPos(playerid, X, Y, Z);
    case 5: SetPlayerPos(playerid, X, Y, Z);
    case 6: SetPlayerPos(playerid, X, Y, Z);
    case 7: SetPlayerPos(playerid, X, Y, Z);
    case 8: SetPlayerPos(playerid, X, Y, Z);
    case 9: SetPlayerPos(playerid, X, Y, Z);
    case 10: SetPlayerPos(playerid, X, Y, Z);
    case 11: SetPlayerPos(playerid, X, Y, Z);
    case 12: SetPlayerPos(playerid, X, Y, Z);
    case 13: SetPlayerPos(playerid, X, Y, Z);
    case 14: SetPlayerPos(playerid, X, Y, Z);

  }
  return 1;
}
Reply
#8

tema solucionado, estaba todo bien, el problema era un bug causado x un dialog

CERRAR TEMA

gracias
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)