My score did not increase with killing players
#1

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
Reply
#2

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    // Add 1 to this killer's score.
    if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
    return 1;
}
Reply
#3

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 !
Reply
#4

Add this line in the admin script:

Код:
#define SAVE_SCORE true
Reply
#5

Here

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!");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)