SA-MP Forums Archive
Show Spawn protection - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Show Spawn protection (/showthread.php?tid=244863)



Show Spawn protection - BlackWolf120 - 28.03.2011

hi,

on my server all spawned plaayers get 10 secs of spawn kill protection.
But is there a method i can show other players that a player is spawn protected?
E.g. with a flashin health bar over the head or sth. like that?
How would i do that?

thx in advance.


Re: Show Spawn protection - BlackWolf120 - 28.03.2011

mhh, thx for ur answer but that would be a very bad way to show spawn protection!
Just imagine how the mainchat would be spammed if there are about 20-30 players online...

//edit

really? it starts flashing if set to 99999?


Re: Show Spawn protection - Ihsan-Cingisiz - 28.03.2011

Quote:
Originally Posted by BlackWolf120
Посмотреть сообщение
mhh, thx for ur answer but that would be a very bad way to show spawn protection!
Just imagine how the mainchat would be spammed if there are about 20-30 players online...

//edit

really? it starts flashing if set to 99999?
The easiest and the simplest way:

Код:
SetPlayerChatBubble(playerid, "Spawn Protected!", 50.0, 10000);



Re: Show Spawn protection - Fj0rtizFredde - 28.03.2011

You could attach a 3DTextLabel to the player or use a chat bubble


Re: Show Spawn protection - BlackWolf120 - 28.03.2011

also tried it with chat bubble already but it does not work for me cause i use 3d text labels attached to every player to display their rank and chat bubble does not work in combination with 3dtext labels.


Re: Show Spawn protection - Ihsan-Cingisiz - 28.03.2011

Quote:
Originally Posted by BlackWolf120
Посмотреть сообщение
also tried it with chat bubble already but it does not work for me cause i use 3d text labels attached to every player to display their rank and chat bubble does not work in combination with 3dtext labels.
Can you post your 3d labels for a player here, maybe We or I can do something with that to help you


Re: Show Spawn protection - BlackWolf120 - 28.03.2011

pawn Код:
//OnPlayerSpawn
SetPlayerChatBubble(playerid,"Spawn-Kill Protected",0xFF9900AA, 100.0,10000);
Add3DTextLabelToPlayer(playerid);


//stock
stock Add3DTextLabelToPlayer(playerid)
{
            //Labels
           
    ranklabelCTU[playerid] = Create3DTextLabel("{1464F4}CTU",0xF97804FF,30.0,40.0,50.0,30,-1,1);
    ranklabelSNAKES[playerid] = Create3DTextLabel("{CC3232}Coral Snake",0xF97804FF,30.0,40.0,50.0,30,-1,1);


    {
    switch (gTeam[playerid])
    {
    case 1: //police
    {
    Attach3DTextLabelToPlayer(ranklabelCTU[playerid], playerid, 0.0, 0.0, 0.5);
    new labelstring[50];
    format(labelstring, sizeof(labelstring), "Police %s", RankName[pRank[playerid]]);
    Update3DTextLabelText(ranklabelCTU[playerid], 0xF97804FF, labelstring);
    }

    case 2: //terrorists
    {
    Attach3DTextLabelToPlayer(ranklabelSNAKES[playerid], playerid, 0.0, 0.0, 0.5);
    new labelstring[50];
    format(labelstring, sizeof(labelstring), "Terrorist %s", RankName[pRank[playerid]]);
    Update3DTextLabelText(ranklabelSNAKES[playerid], 0xF97804FF, labelstring);
    }
    }

    }
}