hi guys,
i very very searched on forum and google but i can not solve.
i sended post to:
https://forums.alliedmods.net/showpo...postcount=5108
but nobody any helped
. i need this plugin but have errors .
plugin gungame no supported by creator so i sended problem.
download and used:
https://github.com/altexdim/sourcemod-plugin-gungame
error1:
PHP Code:
//// gungame_stats.sp
//
// gungame_stats/sql.sp(403) : warning 219: local variable "File" shadows a variable at a preceding level
// Code size: 30224 bytes
// Data size: 10064 bytes
// Stack/heap size: 16384 bytes
// Total requirements: 56672 bytes
//
// 1 Warning.
//
// Compilation Time: 0.37 sec
// ----------------------------------------
PHP Code:
// non-threaded
public Action:_CmdImportDb(client, args)
{
decl String:File[PLATFORM_MAX_PATH]; // Line 403
BuildPath(Path_SM, File, sizeof(File), "data/gungame/playerdata.txt");
if ( !FileExists(File) )
{
ReplyToCommand(client, "[GunGame] playerdata.txt does not exists to be imported.");
return Plugin_Handled;
}
new Handle:KvGunGame = CreateKeyValues("gg_PlayerData", BLANK, BLANK);
FileToKeyValues(KvGunGame, File);
/* Go to first SubKey */
if ( !KvGotoFirstSubKey(KvGunGame) )
{
ReplyToCommand(client, "[GunGame] You have no player data to import.");
return Plugin_Handled;
}
decl String:query[1024], String:error[255];
decl Wins, String:Name[64];
decl ImportedWins, String:Auth[64];
new bufferLen = sizeof(Name) * 2 + 1;
decl String:nameQuoted[bufferLen];
do
{
KvGetSectionName(KvGunGame, Auth, sizeof(Auth));
ImportedWins = KvGetNum(KvGunGame, "Wins");
if ( !ImportedWins || Auth[0] != 'S' )
{
continue;
}
// Load player data
SQL_LockDatabase(g_DbConnection);
Format(query, sizeof(query), g_sql_getPlayerByAuth, Auth);
#if defined SQL_DEBUG
LogError("[DEBUG-SQL] %s", query);
#endif
new Handle:result = SQL_Query(g_DbConnection, query);
if ( result == INVALID_HANDLE )
{
SQL_GetError(g_DbConnection, error, sizeof(error));
LogError("Failed to get player (error: %s)", error);
SQL_UnlockDatabase(g_DbConnection);
ReplyToCommand(client, "[GunGame] Import finished with sql error");
CloseHandle(KvGunGame);
return Plugin_Handled;
}
SQL_UnlockDatabase(g_DbConnection);
if ( SQL_FetchRow(result) )
{
Wins = SQL_FetchInt(result, 1);
SQL_FetchString(result, 2, Name, sizeof(Name));
}
else
{
Wins = 0;
}
CloseHandle(result);
if ( Wins ) {
SQL_EscapeString(g_DbConnection, Name, nameQuoted, bufferLen);
Format(query, sizeof(query), g_sql_updatePlayerByAuth, Wins + ImportedWins, nameQuoted, Auth);
} else {
KvGetString(KvGunGame, "Name", Name, sizeof(Name));
SQL_EscapeString(g_DbConnection, Name, nameQuoted, bufferLen);
Format(query, sizeof(query), g_sql_insertPlayer, ImportedWins, nameQuoted, Auth);
}
// SavePlayerData
SQL_LockDatabase(g_DbConnection);
#if defined SQL_DEBUG
LogError("[DEBUG-SQL] %s", query);
#endif
if ( !SQL_FastQuery(g_DbConnection, query) )
{
SQL_GetError(g_DbConnection, error, sizeof(error));
LogError("Could not save player (error: %s)", error);
SQL_UnlockDatabase(g_DbConnection);
ReplyToCommand(client, "[GunGame] Import finished with sql error");
CloseHandle(KvGunGame);
return Plugin_Handled;
}
SQL_UnlockDatabase(g_DbConnection);
}
while(KvGotoNextKey(KvGunGame));
CloseHandle(KvGunGame);
/* Reload the players wins in memory */
for ( new i = 1; i <= MaxClients; i++ )
{
if ( IsClientAuthorized(i) )
{
GetClientAuthId(i, AuthId_Steam2, Auth, sizeof(Auth));
RetrieveKeyValues(i, Auth);
}
}
ReplyToCommand(client, "[GunGame] Import of player data completed. Please run gg_rebuild to update the top rank.");
return Plugin_Handled;
}
error2:
PHP Code:
//// gungame.sp
//
// gungame/util.sp(1272) : warning 213: tag mismatch
// Code size: 117808 bytes
// Data size: 34204 bytes
// Stack/heap size: 16384 bytes
// Total requirements: 168396 bytes
//
// 1 Warning.
//
// Compilation Time: 1.09 sec
// ----------------------------------------
PHP Code:
public Action:UTIL_Timer_ShowHintText(Handle:timer, any:data)
{
new client, String:textHint[512], times;
ResetPack(data);
times = ReadPackCell(data);
client = ReadPackCell(data);
ReadPackString(data, textHint, sizeof(textHint));
if ( !IsClientInGame(client) )
{
CloseHandle(data);
return Plugin_Stop;
}
PrintHintText(client, textHint);
if ( --times <= 0 )
{
CloseHandle(data);
return Plugin_Stop;
}
else
{
SetPackPosition(data, 0); //Line 1272
WritePackCell(data, times);
return Plugin_Continue;
}
}
thank you for any help.