dcmd_accban(playerid,params[])
{
new string[128];
new ID;
new time;
new reason;
if(sscanf(params,"uis[100]",ID,time,reason))
{
SendClientMessage(playerid,COLOR_ERROR,"USAGE: /accban (Player Name/ID) (Days) (Reason)");
return 1;
}
if(!IsPlayerConnected(ID))
{
format(string,sizeof(string),"[ERROR] The player ID (%d) is not connected to the server. You cannot ban them.",ID);
SendClientMessage(playerid,COLOR_ERROR,string);
return 1;
}
new string1[128];
format(string1,sizeof(string1),"[ADMIN] Administrator has banned %s(%d) from the server. Reason: %s. Time : %i days.",PlayerName(ID),ID,reason,time);
SendClientMessageToAll(COLOR_ADMIN,string1);
jBan(ID,playerid,reason,time);
LogTo("AccountBans",string1);
format(string,sizeof(string),"9[ADMIN] Administrator has banned %s(%d) from the server. Reason: %s. Ban Time : %i days.",PlayerName(ID),ID,reason,time);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}
stock jBan(player_banned, player_banner, reason[], time = 0)
{
new TempQuery[500];
new IP[14];
GetPlayerIp(player_banned,IP,sizeof(IP));
format(TempQuery, sizeof(TempQuery), "INSERT INTO `"Bans_Table"` (user_banned, user_banned_ip, user_banner, ban_reason, ban_timestamp, ban_time) VALUES ('%s', '%s', '%s', '%s', CURRENT_TIMESTAMP, %d)", PlayerName(player_banned), IP, PlayerName(player_banner), reason, time);
mysql_query(TempQuery);
jBanCheck(player_banned);
Kick(player_banned);
return 1;
}
format(TempQuery, sizeof(TempQuery), "INSERT INTO Bans_Table (user_banned, user_banned_ip, user_banner, ban_reason, ban_timestamp, ban_time) VALUES ('%s', '%s', '%s', '%s', CURRENT_TIMESTAMP, %d)", PlayerName(player_banned), IP, PlayerName(player_banner), reason, time);
Hm?
pawn Код:
|
C:\Users\Matt\Desktop\Started\Gamemode\robbing.pwn(7005) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
jBan(ID,playerid,reason,time);
new string[128];
new ID;
new time;
new reason[64];// 64 or more.. it depends on you but it means maximum of string length...new reason[5] = 12345;
if(sscanf(params,"uis[100]",ID,time,reason))// parameter u scans id/nick. parameter i scans integer, and s is for string