20.08.2018, 05:35
You're passing integer parameter to sscanf and expecting a string...
PHP код:
COMMAND:ojail(playerid, params[])
{
if(!PlayerInfo[playerid][power]) return SendClientError(playerid, CANT_USE_CMD);
new iPlayer[ 40 ], iTime, iReason[ 128 ], string[ 164 ];
if( sscanf ( params, "s[40]ds", iPlayer,iTime,iReason)) return SCP(playerid, "[Exact_Name] [jailtime (MINUTES)] [reason]");
//if(GetPlayerId(iPlayer) != INVALID_PLAYER_ID) return SendClientError(playerid, "That player is connected! Use /ajail!");
iTime = (iTime * 60);
if(!AccountExist(iPlayer))
{
new iQuery[228];
mysql_format(sqldb, iQuery, sizeof(iQuery), "UPDATE `PlayerInfo` SET `Jail` = 1, `JailTime` = %d, `bail` = 777, JailReason = '%e' WHERE `PlayerName` = '%e'", iTime, iReason, iPlayer);
mysql_tquery(sqldb, iQuery);
format(string,sizeof(string),"[Admin] %s has jailed %s for %d minutes: %s",RPName(playerid),iPlayer,iTime,iReason);
SendMessageToAll(COLOR_RED,string);
}
else SendClientError(playerid, "Account not found!");
return 1;
}