You used playerid in sscanf but for commands player1 o.O just remove playerid and put player1 in sscanf like the below
PHP код:
IRCCMD:ban(botid, channel[], user[], host[], params[])
{
// Check if the user is at least an op in the channel
if (IRC_IsOp(botid, channel, user))
{
new player1,reason[64];
// Check if the user at least entered a player ID
if (sscanf(params, "dS(No reason)[64]", player1, reason))
{
return 1;
}
// Check if the player is connected
if (IsPlayerConnected(player1))
{
// Echo the formatted message
new msg[128], name[MAX_PLAYER_NAME];
GetPlayerName(player1, name, sizeof(name));
format(msg, sizeof(msg), "02*** %s has been banned by %s on IRC. (%s)", name, user, reason);
IRC_GroupSay(groupID, channel, msg);
format(msg, sizeof(msg), "*** %s has been banned by %s on IRC. (%s)", name, user, reason);
SendClientMessageToAll(0x0000FFFF, msg);
// Ban the player
BanEx(player1, reason);
}
}
return 1;
}
IRCCMD:slap(botid, channel[], user[], host[], params[])
{
new player1, reason[64];
//Playerid
if (sscanf(params, "dS(No reason.)[64]", player1, reason))
{
return 1;
}
if (IRC_IsVoice(botid, channel, user))
{
if(IsPlayerConnected(player1))
{
new msg[128], pname[MAX_PLAYER_NAME];
GetPlayerName(player1, pname, sizeof(pname));
format(msg, sizeof(msg), "*** %s has been slapped by Staff Member %s on IRC for reason: %s", pname, user, reason);
IRC_GroupSay(groupID, channel, msg);
format(msg, sizeof(msg), "*** %s has been slapped by Staff Member %s on IRC for reason: %s", pname, user, reason);
SendClientMessageToAll(0xFF0000C8, msg);
new Float:Health;
new Float:x, Float:y, Float:z;
GetPlayerHealth(player1,Health);
SetPlayerHealth(player1,Health-25);
GetPlayerPos(player1,x,y,z);
SetPlayerPos(player1,x,y,z+7);
PlayerPlaySound(player1,1190,0.0,0.0,0.0);
}
}
return 1;
}