Spawn Protection + Spawn Health Help (rep++) - 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: Spawn Protection + Spawn Health Help (rep++) (
/showthread.php?tid=333965)
Spawn Protection + Spawn Health Help (rep++) -
iOmar - 13.04.2012
Hey Guys!
==> First Of All I want Spawn Protection for every player who spawn for 10 seconds. How can i dot it.
====> 2nd is that i have rank system. I want player which is on rookie rank get health only 75.00 and player who is on Brigadier rank (3rd rank) have 100 health + 10.00 armour on spawn and so on....
How can i do this??
Examples:
pawn Код:
if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 150) rookie
if(GetPlayerScore(playerid) >= 150 && GetPlayerScore(playerid) < 300)
if(GetPlayerScore(playerid) >= 300 && GetPlayerScore(playerid) < 450) Brigadier
Re: Spawn Protection + Spawn Health Help (rep++) -
Faisal_khan - 13.04.2012
Add this below your defines:
pawn Код:
forward SpawnKill(playerid);
Add this under OnPlayerSpawn:
pawn Код:
SetPlayerHealth(playerid,99999);
SetTimerEx("SpawnKill",10000,0,"i",playerid);
Add this anywhere in you script:
pawn Код:
public SpawnKill(playerid)
{
SetPlayerHealth(playerid,100.0);
SendClientMessage(playerid,COLOR_BRIGHTRED,"SpawnKill Over!");
return 1;
}
This was for Spawn Kill.
Re: Spawn Protection + Spawn Health Help (rep++) -
Faisal_khan - 13.04.2012
Add this under OnPlayerSpawn:
pawn Код:
if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) < 150) rookie
{
SetPlayerHealth(playerid, 75);
}
if(GetPlayerScore(playerid) >= 150 && GetPlayerScore(playerid) < 300)
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 25);
}
if(GetPlayerScore(playerid) >= 300 && GetPlayerScore(playerid) < 450) Brigadier
{
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 50);
}