04.07.2014, 09:46
I have this problem with gpci. When a player connects / creates an account the server sees the gpci as it should. But when I use /ban and I try to insert the serial into the bans table it inserts a wrong serial. Look here :
Users : E8E048AD4F4D4F494488AE94D9E40CEA4DFA4DD4
Bans : 8004545A0844D408FF9C40EFDEA4444EC8DA889D
These 2 are from the same user. The table design is the same.
Ban command :
Table designs in mysql are the same. So there's no reason why it doesn't work... Anyone has any ideas?
pawn Код:
[02:15:24] [join] Jack_Saunders has joined the server (2:188.27.113.124)
[02:15:30] SELECT * FROM `bans` WHERE `playerSerial` = '4945DECED9CAE99DC5E9449E00898D8DCEAD5CD4' AND `playerIP` LIKE '188.27.' LIMIT 1
[02:15:40] INSERT INTO `bans` (name, reason, playerIP, playerSerial) VALUES ('Jack_Saunders', 'test', '188.27.113.124', '8004545A0844D408FF9C40EFDEA4444EC8DA889D')
Bans : 8004545A0844D408FF9C40EFDEA4444EC8DA889D
These 2 are from the same user. The table design is the same.
Ban command :
pawn Код:
CMD:ban(playerid, params[])
{
if(!CheckAdmin(playerid, ADMIN_LEVEL_1)) return NotAuthMSG(playerid);
new id, reason[128];
new playerserial[128];
gpci(playerid,playerserial,sizeof(playerserial));
if(sscanf(params,"us[128]",id,reason)) return SyntaxMSG(playerid, "/ban [playerid/PartOfName] [motiv]");
if(!PlayerIsOn(id)) return NotConnectedMSG(playerid);
format(msg, sizeof(msg), "AdmCmd: %s a fost banat de catre %s. Motiv: %s.", GetName(id), GetName(playerid), reason);
format(query, sizeof(query), "INSERT INTO `bans` (name, reason, playerIP, playerSerial) VALUES ('%s', '%s', '%s', '%s')", GetName(id),reason, GetPlayerIP(id), playerserial);
mysql_function_query(dbHandle, query, true, "BanWithMSGEx", "iss", id, msg, reason);
printf(query);
return 1;
}