cmd convertion -
Tomix - 19.10.2013
Hello can anyone convert this command:
Код:
irccmd_sethealth(conn, channel[], user[], message[])
{
new tmp[256], tmp2[256], Float:health;
tmp = zcmd(1, message);
tmp2 = zcmd(2, message);
if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /sethealth [ID] [HEALTH]");
if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /sethealth [ID] [HEALTH]");
health = strval(tmp2);
SetPlayerHealth(strval(tmp), health);
new oname[MAX_PLAYER_NAME];
GetPlayerName(strval(tmp), oname, sizeof(oname));
new string[256];
format(string, sizeof(string), "\"%s\" has had his health set to \"%0.0f\" by IRC admin \"%s\"", oname, health, user);
SendClientMessageToAll(yellow, string);
ircSay(conn, channel, string);
return 1;
}
Into this kind of form of a cmd please?
Код:
IRCCMD:kick(botid, channel[], user[], host[], params[])
{
if (IRC_IsOp(botid, channel, user))
{
new playerid, reason[64];
if (sscanf(params, "dS(No reason)[64]", playerid, reason))
{
return 1;
}
if (IsPlayerConnected(playerid))
{
new msg[128], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(msg, sizeof(msg), "02*** %s has been kicked by %s on IRC. (%s)", name, user, reason);
IRC_GroupSay(groupID, channel, msg);
format(msg, sizeof(msg), "*** %s has been kicked by %s on IRC. (%s)", name, user, reason);
SendClientMessageToAll(0x0000FFFF, msg);
Kick(playerid);
}
}
return 1;
}
Re: cmd convertion -
Voxel - 19.10.2013
not sure if this helps but i dont think u can change a irc command :\
Re: cmd convertion -
rickisme - 19.10.2013
pawn Код:
IRCCMD:sethealth(botid, channel[], user[], host[], params[])
{
if (!IRC_IsOp(botid, channel, user)) return IRC_Say(botid, channel, "Unknow command !");
new target, health;
if(sscanf(params, "ud", target, health))
{
IRC_Say(botid, channel, "USAGE: /sethealth [player] [health]");
return 1;
}
if (IsPlayerConnected(target))
{
new msg[256], oname[MAX_PLAYER_NAME];
GetPlayerName(target, oname, sizeof(oname));
format(msg, sizeof(msg), "*** %s has had his health set to %d by IRC admin %s", oname, health, user);
SendClientMessageToAll(yellow, msg);
SetPlayerHealth(target, health);
}
else
{
IRC_Say(botid, channel, "That person does not connect");
}
return 1;
}
Re: cmd convertion -
Tomix - 19.10.2013
Can you also help me convert this command?
Код:
irccmd_setname(conn, channel[], user[], message[])
{
new tmp[256], tmp2[256];
tmp = zcmd(1, message);
tmp2 = zcmd(2, message);
if(ircIsOp(conn, channel, user) == 0) return ircSay(conn, channel, "You are not a channel admin");
if(strlen(tmp) == 0) return ircSay(conn, channel, "Use: /setname [ID] [NAME]");
if(IsPlayerConnected(strval(tmp)) == 0) return ircSay(conn, channel, "That player is not connected");
if(strlen(tmp2) == 0) return ircSay(conn, channel, "Use: /setname [ID] [NAME]");
new oname[MAX_PLAYER_NAME];
GetPlayerName(strval(tmp), oname, sizeof(oname));
new string[256];
format(string, sizeof(string), "\"%s\"'s score has had his name set to \"%s\" by IRC admin \"%s\"", oname, tmp2, user);
SetPlayerName(strval(tmp), tmp2);
SendClientMessageToAll(yellow, string);
ircSay(conn, channel, string);
return 1;
}
Re: cmd convertion -
Tomix - 19.10.2013
Anyone?
Re: cmd convertion -
rickisme - 19.10.2013
pawn Код:
IRCCMD:setname(botid, channel[], user[], host[], params[])
{
if (!IRC_IsOp(botid, channel, user)) return IRC_Say(botid, channel, "Unknow command !");
new target, newname[MAX_PLAYER_NAME];
if(sscanf(params, "us[32]", target, newname))
{
IRC_Say(botid, channel, "USAGE: /setname [player] [new name]");
return 1;
}
if (IsPlayerConnected(target))
{
new msg[256], oname[MAX_PLAYER_NAME];
GetPlayerName(target, oname, sizeof(oname));
format(msg, sizeof(msg), "*** %s score has had his name set to %s by IRC admin %s", oname, newname, user);
SendClientMessageToAll(yellow, msg);
SetPlayerName(target, newname);
}
else
{
IRC_Say(botid, channel, "That person does not connect");
}
return 1;
}