20.08.2018, 05:18
I don't know what i'm doing wrong here, im still new in mysql
when i do /ojail on someone, it appear like this
my code:
when i do /ojail on someone, it appear like this
Код:
[Admin] Server_Files has jailed я for 60 minutes: test
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, "uds", 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;
}