Hi, sorry how bad this was.
I've created a team and the table is also is AI mode. There are multiples team in the query but whenever server restart or player quit, then create team, it always started at 0 again.
I've created a team and the table is also is AI mode. There are multiples team in the query but whenever server restart or player quit, then create team, it always started at 0 again.
PHP Code:
forward TeamCreated(b);
public TeamCreated(b)
{
? ? TeamInfo[b][TeamID] = cache_insert_id();
? ? teamidd;
? ? printf("New Group is created: [%d]", teamidd );
}
PHP Code:
if(strcmp(usage, "create", false) == 0)
{
? ? if(!strlen(usage1)) return SCP(playerid, "create <teamname>");
? ? if(strlen(usage1) < 5 || strlen(usage1) > 30) return SendClientError(playerid, "Your team name is too short or too long! (Min 5, Max 30 chars)");
? ? new tmID = teamidd;
? ? if(PlayerInfo[playerid][tplayerteam] != -1) return SendClientError(playerid, "You are already in a team. /team leave");
? ? TeamInfo[tmID][TeamID] = tmID;
? ? PlayerInfo[playerid][tplayerteam] = tmID;
? ? PlayerInfo[playerid][tranklvl] = 0;
? ? myStrcpy(PlayerInfo[playerid][TPTeamName],usage1);
? ? myStrcpy(PlayerInfo[playerid][trankname],"Children");
? ? TeamInfo[tmID][TActive]=true;
new sQuery[528];
mysql_format(sqldb, sQuery, sizeof sQuery, "INSERT INTO `TeamInfo` (`TeamID`, `TeamName`, `StartRank`) VALUES (%d,'%e', 'Children')",tmID,usage1);
mysql_tquery(sqldb, sQuery, "TeamCreated", "i",tmID);
}
else
{
SCP(playerid, "<create> <input>");
}
return 1;
}