Spawn Ramdom Como Hacer Ayuda
#1

Como Dice El Titulo Como Estoy Trabajando En Un Servidor FreeRoam Como Creao Un Spawn Ramdom En La Ventura Si Me Puedes Ayudar Doy Rep Gracia
Reply
#2

Код:
//Defines un new
new Float:RandomSpawns[5][3] = // 5= El numero de randoms de spawns (abajo) / 3= Numero de switchs del onplayerspawn, si te fijas hay 3 (RandomSpawns[rand][0], RandomSpawns[rand][1], 
        RandomSpawns[rand][2])
{
    {1807.0757,-1690.0712,13.5457}, // Coordenadas X Y Z, > Son las coordinadas de algъn lugar, tu lo modificas.
    {1379.6189,-1659.0195,13.5457},
    {1409.3663,-1306.9072,9.2937},
    {1340.3314,-1775.7716,13.5114},
    {2426.0017,-1230.0343,24.9293}
};

public OnPlayerSpawn(playerid)
{
        new rand = random(sizeof RandomSpawns);
	SetPlayerPos(playerid, RandomSpawns[rand][0], RandomSpawns[rand][1], 
        RandomSpawns[rand][2]);
	return 1;
}
Reply
#3

Pero Me Estas Dando La De Tu Servidor Amigo Zombie Eso De Zombie Es De tu Servidor
Reply
#4

xD pero solo le cambias el nombre a las variables amigo, le puedes poner el nombre que tu quieras.
Reply
#5

Quote:
Originally Posted by Gamerd
Посмотреть сообщение
Pero Me Estas Dando La De Tu Servidor Amigo Zombie Eso De Zombie Es De tu Servidor
Se supone que tienes que usar ese cуdigo de ejemplo, te explicу que tienes que cambiar en los comentarios del cуdigo, no es para que copies y pegues.

EDIT: No vi que ya habнa respondido el de arriba.
Reply
#6

OK Ya Entiendo Vere Si Funciona Correcta Mente
Reply
#7

Me Salio Esto
Quote:

C:\Users\User Principal 2\Documents\DeTodoUnPoco\gamemodes\DeTodoUnPocoVIP .pwn(97 : error 017: undefined symbol "RandomSpawns"
C:\Users\User Principal 2\Documents\DeTodoUnPoco\gamemodes\DeTodoUnPocoVIP .pwn(979) : error 017: undefined symbol "RandomSpawns"
C:\Users\User Principal 2\Documents\DeTodoUnPoco\gamemodes\DeTodoUnPocoVIP .pwn(979) : warning 215: expression has no effect
C:\Users\User Principal 2\Documents\DeTodoUnPoco\gamemodes\DeTodoUnPocoVIP .pwn(979) : error 001: expected token: ";", but found "]"
C:\Users\User Principal 2\Documents\DeTodoUnPoco\gamemodes\DeTodoUnPocoVIP .pwn(979) : error 029: invalid expression, assumed zero
C:\Users\User Principal 2\Documents\DeTodoUnPoco\gamemodes\DeTodoUnPocoVIP .pwn(979) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

y Lo Tengo De Esta Manera
Quote:

public OnPlayerSpawn(playerid)
{
//=====================Armas Dada Al Spawnear A El Jugador=============================
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 24,1000);
GivePlayerWeapon(playerid, 31,1000);
GivePlayerWeapon(playerid, 26,1000);
GivePlayerWeapon(playerid, 32,1000);
GivePlayerWeapon(playerid, 28,1000);
GivePlayerWeapon(playerid, 34,1000);
GameTextForPlayer(playerid,"~y~Proteccion ~r~5~y~sg",6000,5); Inorar Pero Si Puedes Ayudarme Como Creo Protecion Por 5 Segundos al Jugador Que Spawnea

//================================================== ===================================
new rand = random(sizeof RandomSpawns);
SetPlayerPos(playerid, RandomSpawns[rand][0], RandomSpawns[rand][1],
RandomSpawns[rand][2]);
return 1;
}

Reply
#8

Creo que se te olvidу crear el new arriba amigo, por eso dice que no reconoce RandomSpawns...
Quote:

new Float:RandomSpawns[5][3] = // 5= El numero de randoms de spawns (abajo) / 3= Numero de switchs del onplayerspawn, si te fijas hay 3 (RandomSpawns[rand][0], RandomSpawns[rand][1],
RandomSpawns[rand][2])
{
{1807.0757,-1690.0712,13.5457}, // Coordenadas X Y Z, > Son las coordinadas de algъn lugar, tu lo modificas.
{1379.6189,-1659.0195,13.5457},
{1409.3663,-1306.9072,9.2937},
{1340.3314,-1775.7716,13.5114},
{2426.0017,-1230.0343,24.9293}
};

Reply
#9

Si Amigo Lo Puse Como Me Dijiste
Quote:

new Float:RandomSpawns[5][3] = // 5= El numero de randoms de spawns (abajo) / 3= Numero de switchs del onplayerspawn, si te fijas hay 3 (RandomSpawns[rand][0], RandomSpawns[rand][1],
RandomSpawns[rand][2])
{
{1807.0757,-1690.0712,13.5457}, // Coordenadas X Y Z, > Son las coordinadas de algъn lugar, tu lo modificas.
{1379.6189,-1659.0195,13.5457},
{1409.3663,-1306.9072,9.2937},
{1340.3314,-1775.7716,13.5114},
{2426.0017,-1230.0343,24.9293}
};

Reply
#10

Quote:
Originally Posted by Gamerd
Посмотреть сообщение
Si Amigo Lo Puse Como Me Dijiste
El numero del final dejalo asн:
Код:
{2426.0017,-1230.0343,24.9293
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)