Help "bug" -
Edw - 06.04.2015
Do not save any kill anything ..
I noticed that no kill list but does not appear if you put all those with mysql ultimu kill list goes .. can you tell me from what?
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
new string[256];
format(string, 256, "UPDATE users SET `Kills`='%d', `Deaths`='%d', `Score`='%d' WHERE `Username`='%s'", PlayerInfo[ playerid ][ pKills ], PlayerInfo[ playerid ][ pDeaths ], PlayerInfo[ playerid ][ pScore ], GetName( playerid ) );
mysql_query(mysql, string);
format(string, 256, "UPDATE users SET `Kills`='%d', `Deaths`='%d', `Score`='%d', `Money`='%d' WHERE `Username`='%s'", PlayerInfo[ killerid ][ pKills ], PlayerInfo[ killerid ][ pDeaths ], PlayerInfo[ killerid ][ pScore ], PlayerInfo[ killerid ][ pMoney ], GetName( killerid ) );
mysql_query(mysql, string);
SetPlayerScore( killerid, PlayerInfo[ killerid ][ pScore ] );
if( headshotBonus[ playerid ] == 0 ) return GameTextForPlayer(killerid, "~g~+300$", 2000, 1), GivePlayerMoney( killerid, 300 );
headshotBonus[ playerid ] = 0;
playerDeath[ playerid ] = 1;
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[ playerid ][ pDeaths ] ++;
PlayerInfo[ killerid ][ pKills ] ++;
PlayerInfo[ killerid ][ pScore ] ++;
return 1;
}
// edit:
Check here .. not saved language
xampp say that we have opened the database made.
PHP код:
if( dialogid == DIALOG_LANGUAGE ) {
if(response) return PlayerInfo[ playerid ][ pLanguage ] = 1;
if(!response) return PlayerInfo[ playerid ][ pLanguage ] = 2;
format( szQuery, sizeof( szQuery ), "UPDATE users SET `Language`='%s' WHERE `Username`='%s'", PlayerInfo[ playerid ][ pLanguage ], GetName( playerid ) ); mysql_query( mysql, szQuery );
TogglePlayerSpectating(playerid, 1);
LoadTDs( playerid );
SetTimerEx("RespawnPlayer", 2000, false, "i", playerid);
return 1; }
AW: Help "bug" -
Mencent - 06.04.2015
Hello!
You can update the things in the databank if the player disconnected.
PHP код:
public OnPlayerDeath(playerid, killerid, reason)
{
if(headshotBonus[ playerid ] == 0)return GameTextForPlayer(killerid, "~g~+300$", 2000, 1), GivePlayerMoney( killerid, 300 );
headshotBonus[ playerid ] = 0;
playerDeath[ playerid ] = 1;
SendDeathMessage(killerid, playerid, reason);
PlayerInfo[ playerid ][ pDeaths ] ++;
PlayerInfo[ killerid ][ pKills ] ++;
PlayerInfo[ killerid ][ pScore ] ++;
SetPlayerScore( killerid, PlayerInfo[ killerid ][ pScore ] );
return 1;
}
Well, write the code so.
Mencent
Re: Help "bug" -
Edw - 06.04.2015
can you explain what exactly is not saved from what? Especially if the language
AW: Help "bug" -
Mencent - 06.04.2015
Because of the language, write it so:
PHP код:
if( dialogid == DIALOG_LANGUAGE ) {
if(response)PlayerInfo[ playerid ][ pLanguage ] = 1;
if(!response)PlayerInfo[ playerid ][ pLanguage ] = 2;
format( szQuery, sizeof( szQuery ), "UPDATE users SET `Language`='%s' WHERE `Username`='%s'", PlayerInfo[ playerid ][ pLanguage ], GetName( playerid ) ), mysql_query( mysql, szQuery );
TogglePlayerSpectating(playerid, 1);
LoadTDs( playerid );
SetTimerEx("RespawnPlayer", 2000, false, "i", playerid);
return 1; }
Because the kills and deaths. They won't updat because they are the same how in the databank.
After the mysql query you are putting kills only one higher.
Mencent