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
@ -46,7 +46,7 @@ public OnPluginStart()
|
|||||||
|
|
||||||
public Action:Command_Play(client, args)
|
public Action:Command_Play(client, args)
|
||||||
{
|
{
|
||||||
if(args < 2)
|
if (args < 2)
|
||||||
{
|
{
|
||||||
ReplyToCommand(client, "[SM] Usage: sm_play <#userid|name> <filename>");
|
ReplyToCommand(client, "[SM] Usage: sm_play <#userid|name> <filename>");
|
||||||
}
|
}
|
||||||
@ -64,19 +64,19 @@ public Action:Command_Play(client, args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure it does not go out of bound by doing "sm_play user "*/
|
/* Make sure it does not go out of bound by doing "sm_play user "*/
|
||||||
if(len == -1)
|
if (len == -1)
|
||||||
{
|
{
|
||||||
ReplyToCommand(client, "[SM] Usage: sm_play <#userid|name> <filename>");
|
ReplyToCommand(client, "[SM] Usage: sm_play <#userid|name> <filename>");
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Incase they put quotes and white spaces after the quotes */
|
/* Incase they put quotes and white spaces after the quotes */
|
||||||
if(Arguments[len] == '"')
|
if (Arguments[len] == '"')
|
||||||
{
|
{
|
||||||
len++;
|
len++;
|
||||||
new FileLen = TrimString(Arguments[len]) + len;
|
new FileLen = TrimString(Arguments[len]) + len;
|
||||||
|
|
||||||
if(Arguments[FileLen - 1] == '"')
|
if (Arguments[FileLen - 1] == '"')
|
||||||
{
|
{
|
||||||
Arguments[FileLen - 1] = '\0';
|
Arguments[FileLen - 1] = '\0';
|
||||||
}
|
}
|
||||||
@ -102,8 +102,21 @@ public Action:Command_Burn(client, args)
|
|||||||
decl String:arg[65];
|
decl String:arg[65];
|
||||||
GetCmdArg(1, arg, sizeof(arg));
|
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)
|
if (args > 1)
|
||||||
{
|
{
|
||||||
decl String:time[20];
|
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);
|
ShowActivity(client, "%t", "Ignited player", arg);
|
||||||
LogMessage("\"%L\" ignited \"%L\" (seconds \"%f\")", client, target, seconds);
|
LogMessage("\"%L\" ignited \"%L\" (seconds \"%f\")", client, target, seconds);
|
||||||
IgniteEntity(target, seconds);
|
IgniteEntity(target, seconds);
|
||||||
@ -141,8 +146,21 @@ public Action:Command_Slap(client, args)
|
|||||||
decl String:arg[65];
|
decl String:arg[65];
|
||||||
GetCmdArg(1, arg, sizeof(arg));
|
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)
|
if (args > 1)
|
||||||
{
|
{
|
||||||
decl String:arg2[20];
|
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);
|
ShowActivity(client, "%t", "Slapped player", arg);
|
||||||
LogMessage("\"%L\" slapped \"%L\" (damage \"%d\")", client, target, damage);
|
LogMessage("\"%L\" slapped \"%L\" (damage \"%d\")", client, target, damage);
|
||||||
SlapPlayer(target, damage, true);
|
SlapPlayer(target, damage, true);
|
||||||
@ -188,6 +198,12 @@ public Action:Command_Slay(client, args)
|
|||||||
|
|
||||||
GetClientName(target, arg, sizeof(arg));
|
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);
|
ShowActivity(client, "%t", "Slayed player", arg);
|
||||||
LogMessage("\"%L\" slayed \"%L\"", client, target);
|
LogMessage("\"%L\" slayed \"%L\"", client, target);
|
||||||
ForcePlayerSuicide(target);
|
ForcePlayerSuicide(target);
|
||||||
|
@ -157,4 +157,10 @@
|
|||||||
{
|
{
|
||||||
"en" "Invalid amount specified"
|
"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