SA-MP Forums Archive
Spawn Ramdom Como Hacer Ayuda - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Spawn Ramdom Como Hacer Ayuda (/showthread.php?tid=635143)



Spawn Ramdom Como Hacer Ayuda - Gamerd - 02.06.2017

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



Respuesta: Spawn Ramdom Como Hacer Ayuda - Matyaas - 02.06.2017

Код:
//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;
}



Re: Spawn Ramdom Como Hacer Ayuda - Gamerd - 02.06.2017

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


Respuesta: Spawn Ramdom Como Hacer Ayuda - Matyaas - 02.06.2017

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


Re: Spawn Ramdom Como Hacer Ayuda - Toroi - 02.06.2017

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.


Re: Spawn Ramdom Como Hacer Ayuda - Gamerd - 02.06.2017

OK Ya Entiendo Vere Si Funciona Correcta Mente


Re: Spawn Ramdom Como Hacer Ayuda - Gamerd - 02.06.2017

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;
}




Respuesta: Spawn Ramdom Como Hacer Ayuda - Matyaas - 02.06.2017

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}
};




Re: Spawn Ramdom Como Hacer Ayuda - Gamerd - 02.06.2017

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}
};




Re: Spawn Ramdom Como Hacer Ayuda - Blackaslan - 02.06.2017

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