04.06.2013, 17:55
Can you send a command from offline....
"say i have /heal [playerid]"
is there a way to send that cmd from offline
"say i have /heal [playerid]"
is there a way to send that cmd from offline
IRCCMD:heal(botid, channel[], user[], host[], params[])
{
// Check if the user is at least a halfop in the channel
if (IRC_IsOp(botid, channel, user))
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
// Check if the user at least entered a player ID
if(!strlen(tmp) || !strlen(tmp2) || !IsNumeric(tmp2))
{
return IRC_GroupSay(groupID, channel,"usage: !heal [id] [ammout]");
}
new playerid = strval(tmp);
new amount = strval(tmp2);
new str[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if(IsPlayerConnected(playerid) && playerid != INVALID_PLAYER_ID)
{
if(amount < 0 || amount > 100) return IRC_GroupSay(groupID, channel,"Error: health ammount must be greater than -1 and less that 101");
format(str, sizeof(str), "IRC %s Setted health of %s to %d",user,playername, amount);
SendClientMessageToAll(COLOR_RED, str);
IRC_GroupSay(groupID, channel, str);
}
}
else return IRC_GroupSay(groupID, channel,"Server: Player not found");
}
return 1;
}