127.0.0.1 [03/04/16 | 10:36:52] justjamie - (null)
127.0.0.1 [03/04/16 | 10:39:50] NONE - IP BAN
COMMAND:banip(playerid, params[])
{
new eReason [ 64 ], iReason[ 128 ], tmp[ 64 ], string[ 128 ];
if(sscanf(params, "ss", eReason, iReason)) return SCP(playerid, "[IP Range][Reason]");
format(tmp, sizeof(tmp), "banip %s", eReason);
SendRconCommand(tmp);
SendRconCommand("reloadbans");
format(string, MAX_STRING, "4[ IPBAN ] IP address %s has been banned. Reason: %s", eReason, iReason);
iEcho(string);
return 1;
}
if(sscanf(params, "s[64]s[128]", eReason, iReason))
You need to add the string's size next to the specifiers in sscanf.
PHP код:
|
COMMAND:banip(playerid, params[]) { new eReason [ 64 ], iReason[ 128 ], tmp[ 64 ], string[ 128 ]; if(sscanf(params, "s[64]s[128]", eReason, iReason)) return SCP(playerid, "[IP Range][Reason]"); format(tmp, sizeof(tmp), "banip %s", eReason); SendRconCommand(tmp); SendRconCommand("reloadbans"); format(string, MAX_STRING, "4[ IPBAN ] IP address %s has been banned. Reason: %s", eReason, iReason); iEcho(string); return 1; }
Код:
COMMAND:banip(playerid, params[]) { new eReason [ 64 ], iReason[ 128 ], tmp[ 64 ], string[ 128 ]; if(sscanf(params, "s[64]s[128]", eReason, iReason)) return SCP(playerid, "[IP Range][Reason]"); format(tmp, sizeof(tmp), "banip %s", eReason); SendRconCommand(tmp); SendRconCommand("reloadbans"); format(string, MAX_STRING, "4[ IPBAN ] IP address %s has been banned. Reason: %s", eReason, iReason); iEcho(string); return 1; } |
COMMAND:banip(playerid, params[])
{
new eReason [ 64 ], iReason[ 128 ], tmp[ 64 ], string[ 128 ];
if(sscanf(params, "ss", eReason, iReason)) return SendClientMessage(playerid, -1,"[IP Range][Reason]");
format(tmp, sizeof(tmp), "banip %s", eReason);
SendRconCommand(tmp);
SendRconCommand("reloadbans");
format(string, sizeof(string), "4[ IPBAN ] IP address %s has been banned. Reason: %s", eReason, iReason);
iEcho(string);
return 1;
}
PHP код:
|