Hide kills
#1

How can I do so a player doesn't get -1 score when he is in a dm arena?

I also want to hide the kills from the deathlist and I don't want to show the kill in the mainchat ("%s) (%d) killed (%s) (%d) with a %s.")
Reply
#2

don't minus the score while their in the DM arena and don't add to the kill list or send a client message to all that they kill someone if they're in the dm arena
Reply
#3

This is what I have, what is wrong?

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) -1);
    SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
    KillingSpree[killerid] ++;
    KillingSpree[playerid] = 0;
    if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
    {
    new WeapName[32], Name[MAX_PLAYER_NAME], KillerName[MAX_PLAYER_NAME];
    GetWeaponName(reason, WeapName, sizeof(WeapName));
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
    GetPlayerName(killerid, KillerName, MAX_PLAYER_NAME);
    format(string, sizeof(string),"%s (%d) Has Killed %s (%d) With A %s. ", KillerName, playerid, Name, pID, WeapName);
    TextDrawSetString(RandomText2, string);
    TextDrawShowForAll(RandomText2);
    if(InDM[playerid] == 1)
    {
        new Random = random(sizeof(RandomDMSpawns));
        SendDeathMessage(killerid, playerid, reason);
        SetPlayerPos(playerid, RandomDMSpawns[Random][0], RandomDMSpawns[Random][1], RandomDMSpawns[Random][2]);
        SetPlayerFacingAngle(playerid, RandomDMSpawns[Random][3]);
        SetTimer("DMSTimer", 3000, false);
    }
Reply
#4

Bump
Reply
#5

Bump
Reply
#6

change this

pawn Код:
SetPlayerScore(playerid, GetPlayerScore(playerid) -1);
to

pawn Код:
if( GetPlayerScore( playerid ) > 0 ) SetPlayerScore(playerid, GetPlayerScore(playerid) -1);
Reply
#7

If you don't want the score go below 0 then check if it's 0 if it is then don't minus.
Reply
#8

Still the same.....
Reply
#9

Cessil already explained you what to do.

Check if the player is in the arena, if he is, don't run the SetPlayerScore and the SendDeathMessage code and format your own string to send to everyone.

You could just give the player a point if he is in the DM arena so it would not be affected by the -1
Reply
#10

Try this one

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerScore(playerid) <= 0)
    {
    SetPlayerScore(playerid, GetPlayerScore(playerid) -1);
    }
    SetPlayerScore(killerid, GetPlayerScore(killerid) +1);
    KillingSpree[killerid] ++;
    KillingSpree[playerid] = 0;
    if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
    {
    new WeapName[32], Name[MAX_PLAYER_NAME], KillerName[MAX_PLAYER_NAME];
    GetWeaponName(reason, WeapName, sizeof(WeapName));
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
    GetPlayerName(killerid, KillerName, MAX_PLAYER_NAME);
    format(string, sizeof(string),"%s (%d) Has Killed %s (%d) With A %s. ", KillerName, playerid, Name, pID, WeapName);
    TextDrawSetString(RandomText2, string);
    TextDrawShowForAll(RandomText2);
    if(InDM[playerid] == 1)
    {
        new Random = random(sizeof(RandomDMSpawns));
        SendDeathMessage(killerid, playerid, reason);
        SetPlayerPos(playerid, RandomDMSpawns[Random][0], RandomDMSpawns[Random][1], RandomDMSpawns[Random][2]);
        SetPlayerFacingAngle(playerid, RandomDMSpawns[Random][3]);
        SetTimer("DMSTimer", 3000, false);
    }
And delete

pawn Код:
SendDeathMessage(killerid, playerid, reason);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)