31.08.2014, 20:22
(
Последний раз редактировалось freeze98; 31.03.2015 в 13:28.
)
<remove>
CMD:fakecmd(playerid,params[]) { if(PlayerInfo[playerid][Level] >= 5) { new tmp[128], tmp2[128], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); if(isnull(tmp) || isnull(tmp2)) return SendClientMessage(playerid, red, "USAGE: /fakecmd [playerid] [command]"); new player1 = strval(tmp); if(PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel] && PlayerInfo[playerid][Level] != ServerInfo[MaxAdminLevel]) return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin"); if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID) { CallRemoteFunction("OnPlayerCommandPerformed", "is", player1, tmp2); return SendClientMessage(playerid,blue,"Fake command sent"); } else return SendClientMessage(playerid,red,"ERROR: Player is not connected"); } else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command"); } #endif |
CMD:forcecmd(playerid, params[])
{
if(PInfo[playerid][Admin] < 1336) return SCM(playerid, grey,AdmError);
else
{
#if !defined isnull
#define isnull(%1) \
((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
new Target;
new cmdParams[50];
new cmdToForce[50];
sscanf(params, "us[50]s[50]", Target, cmdToForce, cmdParams);
if(isnull(cmdToForce)) SCM(playerid,comandos,"Use < /forcecmd [id/name] [command] [parameters] >");
else
{
if(!IsPlayerConnected(Target)) SCM(playerid,grey," Invalid ID/Name!");
else
{
format(cmdToForce, sizeof(cmdToForce), "cmd_%s", cmdToForce);
if(funcidx(cmdToForce) != -1)
{
if(isnull(cmdParams)) CallLocalFunction(cmdToForce, "i", Target);
else CallLocalFunction(cmdToForce, "is", Target, cmdParams);
SCM(playerid,greenseco,"# Command forced");
}
else SCM(playerid,grey," Invalid Command/Parameter!");
}
}
}
return 1;
}