Death spawn team
#1

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(playerid0179324.6891,1126.8384,1083.8828,142.340824,9999924,9999924,99999);
                         
SetPlayerColor(playeridCOLOR_DRAGONS);
                         
SetPlayerInterior(playerid5);
                         
SetPlayerHealth(playerid100);
                         
SpawnPlayer(playerid);
                 }
                 if(
listitem == 1//Templarios
                 
{
                         
SetSpawnInfo(playerid1206760.3945,1441.3341,1102.7031,120.555824,9999924,9999924,99999);
                         
SetPlayerColor(playeridCOLOR_TEMPLARIOS);
                         
SetPlayerInterior(playerid6);
                         
SetPlayerHealth(playerid100);
                         
SpawnPlayer(playerid);
                 }
        }
     } 
Reply
#2

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)], ..);
Reply
#3

Yes but how do I do it with team 1 and team 2? they are two team that I have
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)