IRCCMD:sethealth(botid, channel[], user[], host[], params[]) { if (IRC_IsVoice(botid, channel, user)) { new tmp[64], playerid, amount; //Line 477 if (sscanf(params, "dS(Insert Amount)[64]", playerid, amount)) { return 1; } if (IsPlayerConnected(playerid)) { new msg[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(msg, sizeof(msg), "%s has set %s health to %s", user, name, amount); IRC_GroupSay(groupID, channel, msg); format(msg,sizeof(msg), "%s has set %s health to %s", user, name, amount); SendClientMessageToAll(0xDDDD2357, msg); SetPlayerHealth(playerid, amount); //Maybe Correct EDIT: Not working } } return 1; } IRCCMD:getinfo(botid, channel[], user[], host[], params[]) { if (IRC_IsVoice(botid, channel, user)) { new msg[128], playerid ; if (sscanf(params, "d", playerid)) return 1; if (!IsPlayerConnected(playerid)) return 1; format(msg, sizeof(msg), "Name: %s | IP: %s | Score: %d | Ping: %i | Health: %i | Armour: %i ", GetPlayerName(playerid), GetPlayerIp(playerid), //Line 508 GetPlayerScore(playerid), GetPlayerPing(playerid), GetPlayerHealth(playerid), GetPlayerArmour(playerid)); IRC_GroupSay(groupID, channel, msg); } return 1; } IRCCMD:force(botid, channel[], user[], host[], params[]) { if (IRC_IsVoice(botid, channel, user)) { new tmp[64], playerid, reason; if (!IsPlayerConnected(playerid) { new msg[128]; format(msg, sizeof(msg), "%s has been forced to go into class selection screen by admin %s | Reason: %s" playerid, user, reason); //Line 521 IRC_GroupSay(groupID, channel, msg); SendClientMessageToAll(0xDDDD2357, msg); ForceClassSelection(playerid); } } return 1; }
E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(477) : warning 204: symbol is assigned a value that is never used: "tmp" E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(508) : warning 202: number of arguments does not match definition E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(508) : warning 202: number of arguments does not match definition E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(508) : warning 202: number of arguments does not match definition E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(508) : warning 202: number of arguments does not match definition E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(508 -- 509) : warning 202: number of arguments does not match definition E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(508 -- 509) : warning 202: number of arguments does not match definition E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(520) : error 001: expected token: ")", but found "{" E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(522) : error 001: expected token: "-string end-", but found "-identifier-" E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(522) : warning 215: expression has no effect E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(522) : warning 215: expression has no effect E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(522) : warning 215: expression has no effect E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(522) : error 001: expected token: ";", but found ")" E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(522) : error 029: invalid expression, assumed zero E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(522) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors.
IRCCMD:sethealth(botid, channel[], user[], host[], params[]) { if (IRC_IsVoice(botid, channel, user)) { new playerid, Float:amount; //Line 477 if (sscanf(params, "uf", playerid, amount)) return 1; if (IsPlayerConnected(playerid)) { new msg[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(msg, sizeof(msg), "%s has set %s health to %.2f", user, name, amount); IRC_GroupSay(groupID, channel, msg); format(msg,sizeof(msg), "%s has set %s health to %.2f", user, name, amount); SendClientMessageToAll(0xDDDD2357, msg); SetPlayerHealth(playerid, amount); //Maybe Correct EDIT: Not working } } return 1; }
Код:
IRCCMD:sethealth(botid, channel[], user[], host[], params[]) { if (IRC_IsVoice(botid, channel, user)) { new playerid, Float:amount; //Line 477 if (sscanf(params, "uf", playerid, amount)) return 1; if (IsPlayerConnected(playerid)) { new msg[128], name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); format(msg, sizeof(msg), "%s has set %s health to %.2f", user, name, amount); IRC_GroupSay(groupID, channel, msg); format(msg,sizeof(msg), "%s has set %s health to %.2f", user, name, amount); SendClientMessageToAll(0xDDDD2357, msg); SetPlayerHealth(playerid, amount); //Maybe Correct EDIT: Not working } } return 1; } Also changed the d inside the sscanf to a 'u', which allows to select playerids by either their id or part of their name. |
Worked, btw, what does the "u" inside the sscanf means? i thought that was only a message when they didn't put a reason or amount.....
Thanks for your help ![]() |
stock GetName(playerid)
{
new name[64];
GetPlayerName(playerid, name, sizeof(name));
return name;
}
IRCCMD:getinfo(botid, channel[], user[], host[], params[])
{
if (IRC_IsVoice(botid, channel, user))
{
new msg[256], playerid;
if(sscanf(params, "u", playerid)) return 1;
if(!IsPlayerConnected(playerid)) return 1;
format(msg, sizeof(msg), "Name: %s | IP: %s | Score: %d | Ping: %i | Health: %.2f | Armour: %.2f ", GetPlayerName(playerid), GetPlayerIp(playerid),
GetPlayerScore(playerid), GetPlayerPing(playerid), GetPlayerHealth(playerid), GetPlayerArmour(playerid));
IRC_GroupSay(groupID, channel, msg);
}
return 1;
}
IRCCMD:force(botid, channel[], user[], host[], params[])
{
if (IRC_IsVoice(botid, channel, user))
{
new msg[128], reason[128],playerid;
if(sscanf(params, "us[128]", playerid,reason)) return 1;
if(!IsPlayerConnected(playerid) return 1;
format(msg, sizeof(msg), "%s has been forced to go into class selection screen by admin %s | Reason: %s" GetName(playerid), user, reason);
IRC_GroupSay(groupID, channel, msg), SendClientMessageToAll(0xDDDD2357, msg);
ForceClassSelection(playerid);
}
return 1;
}
pawn Код:
|
IRCCMD:getinfo(botid, channel[], user[], host[], params[])
{
if (IRC_IsVoice(botid, channel, user))
{
new
msg[128],
playerid,
name[MAX_PLAYER_NAME],
Float:health,
Float:armour,
ip[16],
score,
;
if (sscanf(params, "u", playerid)) return 1;
if (!IsPlayerConnected(playerid)) return 1;
GetPlayerName(playerid , name , sizeof(name));
GetPlayerIP(playerid, ip, sizeof(ip));
GetPlayerHealth(playerid, health);
GetPlayerArmour(playerid, armour);
format(msg, sizeof(msg), "Name: %s | IP: %s | Score: %d | Ping: %i | Health: %i | Armour: %i ",name, ip, GetPlayerScore(playerid), GetPlayerPing(playerid),ping, health, armour); //Line 508
IRC_GroupSay(groupID, channel, msg);
}
return 1;
}
IRCCMD:force(botid, channel[], user[], host[], params[])
{
if (IRC_IsVoice(botid, channel, user))
{
new msg[128], reason[128],playerid;
if(sscanf(params, "us[128]", playerid,reason)) return 1;
if(!IsPlayerConnected(playerid)) return 1;
format(msg, sizeof(msg), "%s has been forced to go into class selection screen by admin %s | Reason: %s" GetName(playerid), user, reason);
IRC_GroupSay(groupID, channel, msg), SendClientMessageToAll(0xDDDD2357, msg);
ForceClassSelection(playerid);
}
return 1;
}
wrong this will show errors as you are missing a braket
pawn Код:
|
E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(477) : warning 204: symbol is assigned a value that is never used: "tmp" E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(507) : warning 202: number of arguments does not match definition E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(521) : warning 202: number of arguments does not match definition E:\Samp Server\SAMP SERVER\filterscripts\irc.pwn(521) : warning 202: number of arguments does not match definition Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Warnings.