04.10.2013, 17:07
Здравствуйте форумчане, снова я. Забыл кинуть в ту тему, получается так!
У меня фракции на Mysql.
Я поменял с 12 рангов до 18, все названия организаций были на английском языке, я поменял на Русский.
И при запуске у меня получилось переполнение sscanf
Вот логи:
Вот загрузка и сохранение.
У меня фракции на Mysql.
Я поменял с 12 рангов до 18, все названия организаций были на английском языке, я поменял на Русский.
И при запуске у меня получилось переполнение sscanf
Вот логи:
Код:
---------- Loaded log file: "server_log.txt". ---------- SA-MP Dedicated Server ---------------------- v0.3x, ©2005-2013 SA-MP Team [20:25:13] [20:25:13] Server Plugins [20:25:13] -------------- [20:25:13] Loading plugin: sscanf [20:25:13] [20:25:13] =============================== [20:25:13] sscanf plugin loaded. [20:25:13] © 2009 Alex "******" Cole [20:25:13] 0.3d-R2 500 Players "dnee" [20:25:13] =============================== [20:25:13] Loaded. [20:25:13] Loading plugin: mysql [20:25:13] > MySQL plugin R7-2 successfully loaded. [20:25:13] Loaded. [20:25:13] Loading plugin: streamer [20:25:13] *** Streamer Plugin v2.6.1 by Incognito loaded *** [20:25:13] Loaded. [20:25:13] Loading plugin: crashdetect [20:25:13] Loaded. [20:25:13] Loading plugin: iTD [20:25:13] * iTD Plugin loaded. (Support for textdraw editor mouse/keyboard) [20:25:13] Loaded. [20:25:13] Loaded 5 plugins. [20:25:13] [20:25:13] Filterscripts [20:25:13] --------------- [20:25:13] Loading filterscript 'yom_buttons.amx'... [20:25:13] [crashdetect]: Cannot identify file name [20:25:13] Loading filterscript 'iTDe.amx'... [20:25:13] [crashdetect]: Cannot identify file name [20:25:13] iPLEOMAX's TextDraw Editor loaded successfully! Version: 1.16 Stable (13/10/2012) [20:25:13] Loading filterscript 'Gangzone.amx'... [20:25:13] [crashdetect]: Cannot identify file name [20:25:13] --------------------------------------- [20:25:13] GangZone Creator by RyDeR - Loaded - [20:25:13] --------------------------------------- [20:25:13] Loaded 3 filterscripts. [20:25:13] *** Streamer Plugin: Include file version (0x26105) does not match plugin version (0x26104) (script needs to be recompiled with the latest include file) [20:25:13] [crashdetect]: Cannot identify file name [20:25:13] OnGameo [20:25:13] ---------------------------------- [20:25:13] MySQL connection: OK. [20:25:13] ---------------------------------- [20:25:13] Number of vehicle models: 0 [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] sscanf warning: Format specifier does not match parameter count. [20:25:14] Система Фракций: Загружено 18 [20:25:14] Система ФракАвто: Загружено 22 [20:25:14] Система Личных Авто: Загружено 0 [20:25:14] Система Домов: Загружено 2 [20:25:14] Система Бизнесов: Загружено 3 [20:25:14] Система пикапов: Загружено 58 [20:25:14] Other загружено!
PHP код:
forward LoadFractions ( );
public LoadFractions ( )
{
new rows, fields, temp [ 512 ], data [ 512 ];
cache_get_data ( rows, fields ) ;
fraction_count = rows;
if ( rows )
{
for ( new i = 0; i < rows; i++ )
{
cache_get_field_content ( i, "id", temp ), FRACTION [ i ] [ fID ] = strval ( temp ) ;
cache_get_field_content ( i, "name", temp ), sscanf ( temp, "s[56]", FRACTION [ i ] [ fName ] ) ;
cache_get_field_content ( i, "bank", temp ), FRACTION [ i ] [ fBank ] = strval ( temp ) ;
cache_get_field_content ( i, "color", temp ), sscanf ( temp, "h", FRACTION [ i ] [ fColor ] ) ;
cache_get_field_content ( i, "materials", temp ), FRACTION [ i ] [ fMaterials ] = strval ( temp ) ;
cache_get_field_content ( i, "narko", temp ), FRACTION [ i ] [ fNarko ] = strval ( temp ) ;
cache_get_field_content ( i, "check", temp ), FRACTION [ i ] [ fCheck ] = strval ( temp ) ;
cache_get_field_content ( i, "girlskin", temp ), FRACTION [ i ] [ fGirlskin ] = strval ( temp ) ;
cache_get_field_content ( i, "ranks", data ), sscanf ( data,
"p<|>s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]s[30]",
FRACRANG [ i ] [ 0 ], FRACRANG [ i ] [ 1 ], FRACRANG [ i ] [ 2 ], FRACRANG [ i ] [ 3 ],
FRACRANG [ i ] [ 4 ], FRACRANG [ i ] [ 5 ], FRACRANG [ i ] [ 6 ], FRACRANG [ i ] [ 7 ],
FRACRANG [ i ] [ 8 ], FRACRANG [ i ] [ 9 ], FRACRANG [ i ] [ 10 ], FRACRANG [ i ] [ 11 ] ) ;
cache_get_field_content ( i, "skins", data ), sscanf ( data,
"p<|>dddddddddddd",
FRACTION [ i ] [ fSkins ] [ 0 ], FRACTION [ i ] [ fSkins ] [ 1 ], FRACTION [ i ] [ fSkins ] [ 2 ], FRACTION [ i ] [ fSkins ] [ 3 ],
FRACTION [ i ] [ fSkins ] [ 4 ], FRACTION [ i ] [ fSkins ] [ 5 ], FRACTION [ i ] [ fSkins ] [ 6 ], FRACTION [ i ] [ fSkins ] [ 7 ],
FRACTION [ i ] [ fSkins ] [ 8 ], FRACTION [ i ] [ fSkins ] [ 9 ], FRACTION [ i ] [ fSkins ] [ 10 ], FRACTION [ i ] [ fSkins ] [ 11 ] ) ;
cache_get_field_content ( i, "spawn", data ), sscanf ( data,
"p<|>ffffdd",
FRACTION [ i ] [ fSpawn ] [ 0 ], FRACTION [ i ] [ fSpawn ] [ 1 ], FRACTION [ i ] [ fSpawn ] [ 2 ], FRACTION [ i ] [ fSpawn ] [ 3 ],
FRACTION [ i ] [ fSpawnInt ], FRACTION [ i ] [ fSpawnVirt ] ) ;
}
}
printf ( "Система Фракций: Загружено %d", fraction_count ) ;
return 1;
}
stock SaveFractions ( ) {
new sql_query [ 512 ];
for ( new h = 0; h < fraction_count; h++ )
{
if ( !FRACTION [ h ][ fID ] ) continue;
format ( sql_query, sizeof ( sql_query ), "UPDATE `fractions` SET \
`name` = '%s', \
`spawn` = '%f|%f|%f|%f|%d|%d', \
`bank` = '%d', \
`materials`= '%d', \
`narko`= '%d', \
`check`= '%d', \
`ranks` = '%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s', \
`skins` = '%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d' \
WHERE `id` = '%d' LIMIT 1",
FRACTION [ h ][ fName ],
FRACTION [ h ][ fSpawn ] [ 0 ], FRACTION [ h ][ fSpawn ] [ 1 ], FRACTION [ h ][ fSpawn ] [ 2 ], FRACTION [ h ][ fSpawn ] [ 3 ],
FRACTION [ h ][ fSpawnInt ], FRACTION [ h ][ fSpawnVirt ],
FRACTION [ h ][ fBank ],
FRACTION [ h ][ fMaterials ],
FRACTION [ h ][ fNarko ],
FRACTION [ h ][ fCheck ],
FRACRANG [ h ] [ 0 ], FRACRANG [ h ] [ 1 ], FRACRANG [ h ] [ 2 ], FRACRANG [ h ] [ 3 ],
FRACRANG [ h ] [ 4 ], FRACRANG [ h ] [ 5 ], FRACRANG [ h ] [ 6 ], FRACRANG [ h ] [ 7 ],
FRACRANG [ h ] [ 8 ], FRACRANG [ h ] [ 9 ], FRACRANG [ h ] [ 10 ], FRACRANG [ h ] [ 11 ],
FRACTION [ h ] [ fSkins ] [ 0 ], FRACTION [ h ] [ fSkins ] [ 1 ], FRACTION [ h ] [ fSkins ] [ 2 ], FRACTION [ h ] [ fSkins ] [ 3 ],
FRACTION [ h ] [ fSkins ] [ 4 ], FRACTION [ h ] [ fSkins ] [ 5 ], FRACTION [ h ] [ fSkins ] [ 6 ], FRACTION [ h ] [ fSkins ] [ 7 ],
FRACTION [ h ] [ fSkins ] [ 8 ], FRACTION [ h ] [ fSkins ] [ 9 ], FRACTION [ h ] [ fSkins ] [ 10 ], FRACTION [ h ] [ fSkins ] [ 11 ],
FRACTION [ h ][ fID ] ) ;
mysql_function_query ( dbHandle, sql_query, false, "", "" ) ;
}
return 1;
}