commands + HELP? - 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: commands + HELP? (
/showthread.php?tid=349214)
commands + HELP? -
sanrock - 08.06.2012
How do I make like
zcmd
heal <id> (so the id needs to be near you and it gives the player 35 health each time, also you need to wait 1 minute before you can use again?
How do I make it so that team_zombies can't use cmd:kill
and they have to get 1 kill without dying before they can become team_human?
Re: commands + HELP? -
Faisal_khan - 08.06.2012
pawn Code:
//On Top
new HealedPlayerRecently[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("HealedPlayerRecently",120000,1);
return 1;
}
//Put this in your /heal command
forward HealedPlayerRecent();
public HealedPlayerRecent()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(HealedPlayerRecently[i] == 1)
{
HealedPlayerRecently[i] = 0;
}
}
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/heal", cmdtext, true, 4) == 0)
{
if(GetPlayerTeam(team_humans))
{
if(HealedPlayerRecently[playerid] = 1)
{
SetPlayerHealth(playerid, 35);
}
else
{
HealedPlayerRecently[playerid] = 1;
return 1;
}
}
return 1;
}
return 0;
}