CMD:ojail(playerid, params[])
{
if(IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 4)
{
new playerb[32], string[128], file[32], time[6];
if(sscanf(params, "s[32]i[6]s[128]", playerb, time, params)) return SendClientMessage(playerid, error, "Usage: /ojail [playername] [time] [reason]");
if(idCheck(playerb) != INVALID_PLAYER_ID) return SendClientMessage(playerid, error, "Player is connected to the server, use /ajail instead.");
if (!fexist(file)) return SendClientMessage(playerid,error,"Error: This player doesn't have an account.");
new INI:ACCOUNT = INI_Open(file);
INI_SetTag(ACCOUNT,"data");
INI_WriteInt(ACCOUNT, "Jailed", 2);
INI_WriteInt(ACCOUNT, "JailedTime", time);
INI_Close(ACCOUNT);
format(string, sizeof(string), "[AdmCmd]: {FF6347}An Administrator has been jailed %s. [Reason: %s]", playerb, params);
SendClientMessageToAll(red, string);
format(string, sizeof(string), "[OJAIL] %s has offline jailed %s . [Reason: %s]", GetName(playerid), playerb, params);
WriteToLog(string,"oJail");
}
else return ShowMessage(playerid, error, 1);
return 1;
}
//But i keep getting an argument type mismatch at this line
INI_WriteInt(ACCOUNT, "JailedTime", time);
new unixtime, x, y, z; unixtime=gettime(x,y,z); new INI:ACCOUNT = INI_Open(file); INI_SetTag(ACCOUNT,"data"); INI_WriteInt(ACCOUNT, "Jailed", 2); INI_WriteInt(ACCOUNT, "JailedUntil", unixtime+JAIL_TIME_IN_SECONDS); INI_Close(ACCOUNT);
if(sscanf(params, "uds[128]", playerb, time, params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ojail [playername] [time] [reason]");
Код:
if(sscanf(params, "uds[128]", playerb, time, params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ojail [playername] [time] [reason]"); |
Because you used time as a string and saving the time as Integer
|
time[6];
time;
if(sscanf(params, "s[32]i[6]s[128]"
if(sscanf(params, "s[32]ds[128]"