Offline CMD... - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Offline CMD... (
/showthread.php?tid=441875)
Offline CMD... -
Glad2BeHere - 04.06.2013
Can you send a command from offline....
"say i have /heal [playerid]"
is there a way to send that cmd from offline
Re: Offline CMD... -
AoWDarkAge - 04.06.2013
hmm you can i only know the irc plugin import it then script this:
something like that you mean?
Код:
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;
}
Re: Offline CMD... -
Glad2BeHere - 04.06.2013
Won't i need a IRC host......is it possible to set this up locally :/ cause i don't wanna have to get irc host.....
Re: Offline CMD... -
Kirollos - 04.06.2013
Two good methods:
1) making socket server isn't a bad idea.
2) creating custom RCON command with OnRconCommand(cmd[]) and you can use any RCON tool to execute it like !heal [id]
Re: Offline CMD... -
Glad2BeHere - 04.06.2013
Thank You lolz Skipped my head....