SA-MP Forums Archive
Help "bug" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help "bug" (/showthread.php?tid=570250)



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(playeridkilleridreason)
{
    new 
string[256];
    
format(string256"UPDATE users SET `Kills`='%d', `Deaths`='%d', `Score`='%d' WHERE `Username`='%s'"PlayerInfoplayerid ][ pKills ], PlayerInfoplayerid ][ pDeaths ], PlayerInfoplayerid ][ pScore ], GetNameplayerid )  );
    
mysql_query(mysqlstring);
    
format(string256"UPDATE users SET `Kills`='%d', `Deaths`='%d', `Score`='%d', `Money`='%d' WHERE `Username`='%s'"PlayerInfokillerid ][ pKills ], PlayerInfokillerid ][ pDeaths ], PlayerInfokillerid ][ pScore ], PlayerInfokillerid ][ pMoney ], GetNamekillerid )  );
    
mysql_query(mysqlstring);
    
SetPlayerScorekilleridPlayerInfokillerid ][ pScore ] );
     if( 
headshotBonusplayerid ] == ) return GameTextForPlayer(killerid"~g~+300$"20001), GivePlayerMoneykillerid300 );
    
headshotBonusplayerid ] = 0;
    
playerDeathplayerid ] = 1;
     
SendDeathMessage(killeridplayeridreason);
    
PlayerInfoplayerid ][ pDeaths ] ++;
    
PlayerInfokillerid ][ pKills ] ++;
    
PlayerInfokillerid ][ 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 PlayerInfoplayerid ][ pLanguage ] = 1;
        if(!
response) return PlayerInfoplayerid ][ pLanguage ] = 2;
        
formatszQuerysizeofszQuery ), "UPDATE users SET `Language`='%s' WHERE `Username`='%s'"PlayerInfoplayerid ][ pLanguage ], GetNameplayerid ) ); mysql_querymysqlszQuery );
        
TogglePlayerSpectating(playerid1);
        
LoadTDsplayerid );
        
SetTimerEx("RespawnPlayer"2000false"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(playeridkilleridreason)
{
    if(
headshotBonusplayerid ] == 0)return GameTextForPlayer(killerid"~g~+300$"20001), GivePlayerMoneykillerid300 );
    
headshotBonusplayerid ] = 0;
    
playerDeathplayerid ] = 1;
    
SendDeathMessage(killeridplayeridreason);
    
PlayerInfoplayerid ][ pDeaths ] ++;
    
PlayerInfokillerid ][ pKills ] ++;
    
PlayerInfokillerid ][ pScore ] ++;
    
SetPlayerScorekilleridPlayerInfokillerid ][ 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)PlayerInfoplayerid ][ pLanguage ] = 1;
        if(!
response)PlayerInfoplayerid ][ pLanguage ] = 2;
        
formatszQuerysizeofszQuery ), "UPDATE users SET `Language`='%s' WHERE `Username`='%s'"PlayerInfoplayerid ][ pLanguage ], GetNameplayerid ) ), mysql_querymysqlszQuery );
        
TogglePlayerSpectating(playerid1);
        
LoadTDsplayerid );
        
SetTimerEx("RespawnPlayer"2000false"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