PDA

View Full Version : My score did not increase with killing players


Healian
09/08/2012, 12:01 AM
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

damiantof71
09/08/2012, 12:04 AM
public OnPlayerDeath(playerid, killerid, reason)
{
// Add 1 to this killer's score.
if(killerid != INVALID_PLAYER_ID) SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
return 1;
}

Healian
09/08/2012, 12:17 AM
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 !

damiantof71
09/08/2012, 01:00 AM
Add this line in the admin script:

#define SAVE_SCORE true

Eminem 2ka9
09/08/2012, 01:39 AM
Here

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