SA-MP Forums Archive
revive command - 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: revive command (/showthread.php?tid=480870)



revive command - Jes - 13.12.2013

This command is a roleplay server. When a player is dead, a admin can revive that player. Can someone make this cmd in dcmd or strcmp command? thanks

Код:
CMD:revive(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /revive [playerid]");

if(IsPlayerConnected(giveplayerid))
{
if(GetPVarInt(giveplayerid, "Injured") == 1)
{
format(string, sizeof(string), " You have revived %s.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have been revived by an Admin.");

KillEMSQueue(giveplayerid);
ClearAnimations(giveplayerid);
SetPlayerHealth(giveplayerid, 100);
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, "That player is not injured!");
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}



Re: revive command - SilentSoul - 13.12.2013

You already started the same thread yesterday and we answered you , Check it!


Re: revive command - TahaAsif12 - 13.12.2013

Код:
dcmd_revive(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
new string[128], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /revive [playerid]");

if(IsPlayerConnected(giveplayerid))
{
if(GetPVarInt(giveplayerid, "Injured") == 1)
{
format(string, sizeof(string), " You have revived %s.", GetPlayerNameEx(giveplayerid));
SendClientMessageEx(playerid, COLOR_WHITE, string);
SendClientMessageEx(giveplayerid, COLOR_WHITE, "You have been revived by an Admin.");

KillEMSQueue(giveplayerid);
ClearAnimations(giveplayerid);
SetPlayerHealth(giveplayerid, 100);
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD2, "That player is not injured!");
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
return 1;
}
hope it works ^^