mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-09 11:28:26 +00:00
allow targeting in sm_rank
This commit is contained in:
parent
cf4d528c72
commit
fedde68ac3
@ -98,6 +98,9 @@ public void OnPluginStart()
|
|||||||
// admin commands
|
// admin commands
|
||||||
RegAdminCmd("sm_setpoints", Command_SetPoints, ADMFLAG_ROOT, "Set points for a defined ideal time. sm_setpoints <time in seconds> <points>");
|
RegAdminCmd("sm_setpoints", Command_SetPoints, ADMFLAG_ROOT, "Set points for a defined ideal time. sm_setpoints <time in seconds> <points>");
|
||||||
|
|
||||||
|
// translations
|
||||||
|
LoadTranslations("common.phrases");
|
||||||
|
|
||||||
#if defined DEBUG
|
#if defined DEBUG
|
||||||
// debug
|
// debug
|
||||||
RegServerCmd("sm_calc", Command_Calc);
|
RegServerCmd("sm_calc", Command_Calc);
|
||||||
@ -251,14 +254,29 @@ public Action Command_Rank(int client, int args)
|
|||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gI_PlayerRank[client] <= 0 || gF_PlayerPoints[client] <= 0.0)
|
int target = client;
|
||||||
|
|
||||||
|
if(args > 0)
|
||||||
{
|
{
|
||||||
Shavit_PrintToChat(client, "You are unranked.");
|
char[] sTarget = new char[MAX_TARGET_LENGTH];
|
||||||
|
GetCmdArgString(sTarget, MAX_TARGET_LENGTH);
|
||||||
|
|
||||||
|
target = FindTarget(client, sTarget, true, false);
|
||||||
|
|
||||||
|
if(target == -1)
|
||||||
|
{
|
||||||
|
return Plugin_Handled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(gI_PlayerRank[target] <= 0 || gF_PlayerPoints[target] <= 0.0)
|
||||||
|
{
|
||||||
|
Shavit_PrintToChat(client, "\x03%N\x01 is unranked.", target);
|
||||||
|
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
Shavit_PrintToChat(client, "You are ranked \x03%d\x01 with \x05%.02f points\x01.", gI_PlayerRank[client], gF_PlayerPoints[client]);
|
Shavit_PrintToChat(client, "\x03%N\x01 is ranked \x03#%d\x01 with \x05%.02f points\x01.", target, gI_PlayerRank[target], gF_PlayerPoints[target]);
|
||||||
|
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user