My score did not increase with killing players

I am creating a gamemode but i am facing a shit problem i kill my friend's player in the game but my score did not increase

public OnPlayerDeath(playerid, killerid, reason)
    // Add 1 to this killer's score.
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    return 1;

ok its working now but LuxAdmin is supposed to load the saved data on player connect but when i logoff and log on again i find my score reset !

Add this line in the admin script:

#define SAVE_SCORE true


pawn Код:
public OnPlayerDeath( playerid, killerid, reason )
    SendDeathMessage( killerid, playerid, reason );
    SetPlayerScore( killerid,GetPlayerScore(killerid)+2);
    for(new i=0; i<19; i++) TextDrawHideForPlayer(playerid,HealthBar[i]);
    GivePlayerMoney(killerid, 3500);
    new szName[ MAX_PLAYER_NAME ], szStr[ 60 ];
    GetPlayerName( playerid, szName, sizeof( szName ) );
    format( szStr, sizeof( szStr ), "You got +2 score and $3500 for killing %s", szName ); // change this message to your own
    SendClientMessage( killerid, COLOR_BLUE, szStr );
    SendClientMessage(playerid, COLOR_BRIGHTRED, "You just got killed!");

Forum Jump:

Users browsing this thread: 1 Guest(s)