Death spawn team - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Death spawn team (
/showthread.php?tid=660582)
Death spawn team -
Spawe - 07.11.2018
How do I make one of these team die, send them with a spawninfo to what I leave here below and get the skin 230, 233, 299
I explain how I can make when the player of some of these team (code below) dies send them to the coordinates of the spawninfo and apart from a skin random of the ones mentioned
Code
1: skin random 230, 233, 299 when dying
2: and also that when dying spawnee with a SetSpawnInfo I leave it in the code
PHP код:
if(dialogid == 9999)
{
if(response)
{
if(listitem == 0) //Dragons
{
SetSpawnInfo(playerid, 0, 179, 324.6891,1126.8384,1083.8828,142.3408, 24,99999, 24,99999, 24,99999);
SetPlayerColor(playerid, COLOR_DRAGONS);
SetPlayerInterior(playerid, 5);
SetPlayerHealth(playerid, 100);
SpawnPlayer(playerid);
}
if(listitem == 1) //Templarios
{
SetSpawnInfo(playerid, 1, 206, 760.3945,1441.3341,1102.7031,120.5558, 24,99999, 24,99999, 24,99999);
SetPlayerColor(playerid, COLOR_TEMPLARIOS);
SetPlayerInterior(playerid, 6);
SetPlayerHealth(playerid, 100);
SpawnPlayer(playerid);
}
}
}
Re: Death spawn team -
cSharp - 07.11.2018
Mody logical way as I see it:
Define a one-dimensional constant array with the value of the skins, ranging from 0 to 2.
pawn Код:
const playerDeathSkins[] = { 230, 233, 299 };
Generate an integer between 0 to 2 and select the index from the array to return the skin ID.
pawn Код:
SetSpawnInfo(.., .., playerDeathSkins[Random(sizeof playerDeathSkins)], ..);
Re: Death spawn team -
Spawe - 07.11.2018
Yes but how do I do it with team 1 and team 2? they are two team that I have