I have a bug very big and i don't know what to do
When i put this system on host, i don't know why, but when is in Database 7 clans, and i can create 100 clan but they don't register on database, and i don't know why
Database in OnFilterScriptInit
Код:
new ClanString[ 1024 ];
strcat( ClanString, "CREATE TABLE IF NOT EXISTS `gangs`", 1024 );
strcat( ClanString, "(id INT PRIMARY KEY, name varchar(50), owner varchar(50), members INT, SpawnX FLOAT, SpawnY FlOAT, SpawnZ FLOAT, SpawnA FLOAT", 1024 );
strcat( ClanString, "Skin int DEFAULT 0, BossSkin INT DEFAULT 0, Weap1 INT DEFAULT 0, Weap2 INT DEFAULT 0, Weap3 INT DEFAULT 0,Weap4 INT DEFAULT 0,Weap5 INT DEFAULT 0,Weap6 INT DEFAULT 0, Kills INT DEFAULT 0, Deaths INT DEFAULT 0, Color INT DEFAULT 0);");
db:Query( gDB, ClanString );
db:Query("CREATE TABLE IF NOT EXISTS `players`(id INT PRIMARY KEY, name varchar(50), gang varchar(50), rank INT DEFAULT 0, kills INT DEFAULT 0, deaths INT DEFAULT 0);");
On player create a clan( insert dialog )
Код:
if ( dialogid == Dialog_CreateGang )
{
if ( !response ) return 1;
if ( sscanf( inputtext, "s[128]", inputtext[ 0 ] ) ) return ShowPlayerDialog( playerid, Dialog_CreateGang, 1, "Create an clan", "{FFFFFF}So you want to create a clan?\n\nWrite below the name of your clan:", "Next", "Exit" );
new DBResult:R;
register( playerid );
R = db:Query(xFM("SELECT `owner` FROM `gangs` WHERE `name`='%s'", inputtext[ 0 ] ) );
if ( db:num_rows( R ) )
{
db_get_field_assoc( R, "owner", str, sizeof( str ) );
format( str, sizeof( str ), "ERROR: Sorry, but that name is already token by {00FF00}%s", str );
SendClientMessage( playerid, 0xFF0000FF, str );
db:free_result( R );
}
else
{
format( str, sizeof( str ), "You successeful created your clan, with name: {00FF00}%s", inputtext[ 0 ] );
SendClientMessage( playerid, 0xFFFF00FF, str );
db:free_result( R );
new Float:X,Float:Y,Float:Z,Float:A;
GetPlayerPos( playerid, X, Y, Z );
GetPlayerFacingAngle( playerid, A );
gang[ playerid ][ spawnX ] = X;
gang[ playerid ][ spawnY ] = Y;
gang[ playerid ][ spawnZ ] = Z;
gang[ playerid ][ spawnA ] = A;
R=db:Query("SELECT * FROM `gangs`");
new id = db:num_rows( R )+1;
db:free_result( R );
db:Query(xFM("INSERT INTO `gangs`(id,name,owner,members,SpawnX,SpawnY,SpawnZ,SpawnA)VALUES(%d,'%s','%s','1','%.3f','%.3f','%.3f','%.3f');", id, inputtext[ 0 ], name, X, Y, Z, A ) );
R = db:Query(xFM("SELECT * FROM `gangs` WHERE `name`='%s'", inputtext[ 0 ] ) );
db_get_field_assoc( R, "id", str, sizeof( str ) );
gang[ playerid ][ ID ] = strval( str );
gang[ playerid ][ rank ] = 5;
SendClientMessage( playerid, 0xFF0000FF, xFM("ID:%d",gang[ playerid ][ ID ] ) );
db:free_result( R );
db:Query(xFM("UPDATE `players` SET `gang`='%s',`rank`='5' WHERE `name`='%s'", inputtext[ 0 ], name ) );
SetPVarInt( playerid, "CreatingGang", 1 );
cmd_clancolor( playerid, "" );
}
}
...
please guys help me, i told on this system all this day and i didin't make anythig , bug still exists...