How would I use, Auto Increment? here's the current register code:
pawn Код:
new Query[400], AccQuery[256];
new salt[32],saltstring[156], salt1[33];
randomString(salt,sizeof(salt));
format(salt1, sizeof(salt1), "%s", salt);
format(saltstring,sizeof(saltstring), "%s%s", salt, inputtext);
new ip[128], nextaccid;
GetPlayerIp(playerid, ip, 128);
format(AccQuery, sizeof(AccQuery), "SELECT `accid` FROM `playerinfo` WHERE `accid` > '-1'");
mysql_query(AccQuery);
mysql_store_result();
nextaccid = mysql_num_rows();
format(Query, sizeof(Query), "INSERT INTO `playerinfo` (`accid`, `registeringip`, `dateregistered`, `lastloginip`, `lastlogindate`, `username`, `psalt`, `ppassword`) VALUES ('%d', '%s', UTC_TIMESTAMP(), '%s', UTC_TIMESTAMP(), '%s', '%s', md5('%s'))",nextaccid, ip, ip, pName(playerid), salt1, saltstring);
mysql_query(Query);
print(Query);
// Player has registered
SendClientMessage(playerid, 0xFFFFFFFF, "You are now registered!");
StopAudioStreamForPlayer(playerid);
StartCutsceneForPlayer(playerid, 1, 1);
//SetPlayerPos(playerid, 0, 0, 100000);
GivePlayerCash(playerid, 500);
TogglePlayerControllable(playerid, 0);
SavePVar(playerid);
//loggedin[playerid] = 1;