Added check to make sure player are alive to perform sm_slap, sm_burn, sm_slay.
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401247
This commit is contained in:
parent
bcc798e165
commit
71245a441d
@ -102,8 +102,21 @@ public Action:Command_Burn(client, args)
|
||||
decl String:arg[65];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
new Float:seconds = 20.0;
|
||||
new target = FindTarget(client, arg);
|
||||
if (target == -1)
|
||||
{
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
GetClientName(target, arg, sizeof(arg));
|
||||
|
||||
if (!IsPlayerAlive(target))
|
||||
{
|
||||
ReplyToCommand(client, "[SM] %t", "Cannot performed on dead", arg);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
new Float:seconds = 20.0;
|
||||
if (args > 1)
|
||||
{
|
||||
decl String:time[20];
|
||||
@ -115,14 +128,6 @@ public Action:Command_Burn(client, args)
|
||||
}
|
||||
}
|
||||
|
||||
new target = FindTarget(client, arg);
|
||||
if (target == -1)
|
||||
{
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
GetClientName(target, arg, sizeof(arg));
|
||||
|
||||
ShowActivity(client, "%t", "Ignited player", arg);
|
||||
LogMessage("\"%L\" ignited \"%L\" (seconds \"%f\")", client, target, seconds);
|
||||
IgniteEntity(target, seconds);
|
||||
@ -141,8 +146,21 @@ public Action:Command_Slap(client, args)
|
||||
decl String:arg[65];
|
||||
GetCmdArg(1, arg, sizeof(arg));
|
||||
|
||||
new damage = 5;
|
||||
new target = FindTarget(client, arg);
|
||||
if (target == -1)
|
||||
{
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
GetClientName(target, arg, sizeof(arg));
|
||||
|
||||
if (!IsPlayerAlive(target))
|
||||
{
|
||||
ReplyToCommand(client, "[SM] %t", "Cannot performed on dead", arg);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
new damage = 5;
|
||||
if (args > 1)
|
||||
{
|
||||
decl String:arg2[20];
|
||||
@ -154,14 +172,6 @@ public Action:Command_Slap(client, args)
|
||||
}
|
||||
}
|
||||
|
||||
new target = FindTarget(client, arg);
|
||||
if (target == -1)
|
||||
{
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
GetClientName(target, arg, sizeof(arg));
|
||||
|
||||
ShowActivity(client, "%t", "Slapped player", arg);
|
||||
LogMessage("\"%L\" slapped \"%L\" (damage \"%d\")", client, target, damage);
|
||||
SlapPlayer(target, damage, true);
|
||||
@ -188,6 +198,12 @@ public Action:Command_Slay(client, args)
|
||||
|
||||
GetClientName(target, arg, sizeof(arg));
|
||||
|
||||
if (!IsPlayerAlive(target))
|
||||
{
|
||||
ReplyToCommand(client, "[SM] %t", "Cannot performed on dead", arg);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
ShowActivity(client, "%t", "Slayed player", arg);
|
||||
LogMessage("\"%L\" slayed \"%L\"", client, target);
|
||||
ForcePlayerSuicide(target);
|
||||
|
@ -157,4 +157,10 @@
|
||||
{
|
||||
"en" "Invalid amount specified"
|
||||
}
|
||||
|
||||
"Cannot performed on dead"
|
||||
{
|
||||
"#format" "{1:s}"
|
||||
"en" "This action cannot be performed on a dead client \"{1}\""
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user