thing wrong with OnPlayerDeath
#1

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new string[128];
        PlayerInfo[killerid][pScore] = (PlayerInfo[killerid][pScore] + 1);
        PlayerInfo[killerid][pCash] = PlayerInfo[killerid][pCash] + 1000;
        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 1000;
        PlayerInfo[killerid][pKills] ++;
        PlayerInfo[playerid][pDeaths] ++;
        // Most important part: Use the SAMP functions to give score and cash to a player.
        GivePlayerMoney(killerid, 1000);
        SetPlayerScore(killerid, PlayerInfo[killerid][pScore]);
        format(string, sizeof(string), "You killed %s and recieved $1,000!", Name(playerid));
        SendClientMessage(killerid, COLOR_CYAN, string);
        format(string, sizeof(string), "You've been killed by %s and lost $1,000!", Name(killerid));
        SendClientMessage(playerid, COLOR_CYAN, string);
     }
     return 1;
}
When a player dies, it takes away 100 instead 1000,

Also how do I add the killboard on the right hand side? ETC.. Player 1 has killed Player 2 (and the little Icon)
Reply
#2

Does your onplayerspawn give the player 900?

The last question is easy thats the following rule

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

How do you mean? Can you rewrite the code please?
Reply
#4

Here is the whole code.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new string[128];
        PlayerInfo[killerid][pScore] = (PlayerInfo[killerid][pScore] + 1);
        PlayerInfo[killerid][pCash] = PlayerInfo[killerid][pCash] + 1000;
        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 1000;
        PlayerInfo[killerid][pKills] ++;
        PlayerInfo[playerid][pDeaths] ++;
        // Most important part: Use the SAMP functions to give score and cash to a player.
        GivePlayerMoney(killerid, 1000);
        GivePlayerMoney(playerid, -1000);
        SetPlayerScore(killerid, PlayerInfo[killerid][pScore]);
        format(string, sizeof(string), "You killed %s and recieved $1,000!", Name(playerid));
        SendClientMessage(killerid, COLOR_CYAN, string);
        format(string, sizeof(string), "You've been killed by %s and lost $1,000!", Name(killerid));
        SendClientMessage(playerid, COLOR_CYAN, string);
        SendDeathMessage(killerid, playerid, reason);
     }
     return 1;
}
Reply
#5

Quote:
Originally Posted by [HK]Ryder[AN]
Посмотреть сообщение
Here is the whole code.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new string[128];
        PlayerInfo[killerid][pScore] = (PlayerInfo[killerid][pScore] + 1);
        PlayerInfo[killerid][pCash] = PlayerInfo[killerid][pCash] + 1000;
        PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] - 1000;
        PlayerInfo[killerid][pKills] ++;
        PlayerInfo[playerid][pDeaths] ++;
        // Most important part: Use the SAMP functions to give score and cash to a player.
        GivePlayerMoney(killerid, 1000);
        GivePlayerMoney(playerid, -1000);
        SetPlayerScore(killerid, PlayerInfo[killerid][pScore]);
        format(string, sizeof(string), "You killed %s and recieved $1,000!", Name(playerid));
        SendClientMessage(killerid, COLOR_CYAN, string);
        format(string, sizeof(string), "You've been killed by %s and lost $1,000!", Name(killerid));
        SendClientMessage(playerid, COLOR_CYAN, string);
        SendDeathMessage(killerid, playerid, reason);
     }
     return 1;
}
Still only takes 100 away.
Reply
#6

I hope this does:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        new string[128];
        PlayerInfo[killerid][pScore] = (PlayerInfo[killerid][pScore] + 1);
        PlayerInfo[killerid][pCash] = PlayerInfo[killerid][pCash] + 1000;
        PlayerInfo[playerid][pCash] -= 1000;                    
        PlayerInfo[killerid][pKills] ++;
        PlayerInfo[playerid][pDeaths] ++;
        // Most important part: Use the SAMP functions to give score and cash to a player.
        GivePlayerMoney(killerid, 1000);
        SetPlayerScore(killerid, PlayerInfo[killerid][pScore]);
        format(string, sizeof(string), "You killed %s and recieved $1,000!", Name(playerid));
        SendClientMessage(killerid, COLOR_CYAN, string);
        format(string, sizeof(string), "You've been killed by %s and lost $1,000!", Name(killerid));
        SendClientMessage(playerid, COLOR_CYAN, string);
     }
     return 1;
}
.
Reply
#7

Nope.. Still only 100.
Reply
#8

Show us your OnPlayerSpawn callback - as HireMe said, I suspect you're giving money on spawn.
Reply
#9

This has nothing to do if 100 dollars goes when you die other than 1,000.

But whatever
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(Police[playerid] == 1)
    {
        ServerWeapon(playerid, 24, 75);
        ServerWeapon(playerid, 25, 50);
        ServerWeapon(playerid, 31, 200);
    }
    else if(Terro[playerid] == 1)
    {
        ServerWeapon(playerid, 24, 75);
        ServerWeapon(playerid, 27, 65);
        ServerWeapon(playerid, 31, 200);
    }
    if(PlayerInfo[playerid][pVIP] == 1)
    {
        SetPlayerArmour(playerid, 100.0);
        return 1;
    }
    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
    SetPlayerHealth(playerid, 100.0);
    return 1;
}
Reply
#10

Quote:
Originally Posted by [MP]Ditch
Посмотреть сообщение
This has nothing to do if 100 dollars goes when you die other than 1,000.

But whatever
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(Police[playerid] == 1)
    {
        ServerWeapon(playerid, 24, 75);
        ServerWeapon(playerid, 25, 50);
        ServerWeapon(playerid, 31, 200);
    }
    else if(Terro[playerid] == 1)
    {
        ServerWeapon(playerid, 24, 75);
        ServerWeapon(playerid, 27, 65);
        ServerWeapon(playerid, 31, 200);
    }
    if(PlayerInfo[playerid][pVIP] == 1)
    {
        SetPlayerArmour(playerid, 100.0);
        return 1;
    }
    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
    SetPlayerHealth(playerid, 100.0);
    return 1;
}
I know you're helping but please stop posting on my thread.

And I still need this.

EDIT:

I can't find -100 ANYWHERE in the script.. I can show you via teamviewer if need be. Just PM me your skype.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)