+1 score +1 deaths
#1

Hello everyone,

I have a question, I have an admin system. But how can I make something like, Example: Player 1 killed player 2, player 2 got died, and have 1+ deaths in his death list, and player1 got one more kills by his kills, and his score go +1 up.

I already have Score, Kills, Deaths in my server. But now it only needs what I said above. How can I make something like that?

Thank you
Reply
#2

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
    {
        Kills[killerid] ++;
        SetPlayerScore(killerid, GetPlayerScore(killerid)+1);
    }
    Deaths[playerid] ++;
    return 1;
}
Something like that, you just need to change variable names
Reply
#3

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PlayerInfo[playerid][pDeaths]++; // Replace with your variables
    PlayerInfo[killerid][pKills]++; //Also Replace with your variables
    SendDeathMessage(killerid, playerid, reason); //Sending the deaTH message to all
    SetPlayerScore(killerid, GetPlayerScore(killerid, +1); //Setting the killers score
    return 1;
}
EDIT: Ahh someone was faster..
Reply
#4

What admin system are you using?
Reply
#5

I get this errors when I have added it:

pawn Код:
D:\Pl0.3x [Euro] Server 8\pawno\systemadmin.pwn(103) : warning 201: redefinition of constant/macro (symbol "pInfo")
D:\Pl0.3x [Euro] Server 8\pawno\systemadmin.pwn(841) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
D:\Pl0.3x [Euro] Server 8\pawno\systemadmin.pwn(841) : warning 215: expression has no effect
D:\Pl0.3x [Euro] Server 8\pawno\systemadmin.pwn(841) : error 001: expected token: ";", but found "]"
D:\Pl0.3x [Euro] Server 8\pawno\systemadmin.pwn(841) : error 029: invalid expression, assumed zero
D:\Pl0.3x [Euro] Server 8\pawno\systemadmin.pwn(841) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    pInfo[playerid][pDeaths]++;
    pInfo[killerid][pKills]++;
    SendDeathMessage(killerid, playerid, reason);
    SetPlayerScore(killerid, GetPlayerScore(killerid, +1);
    Deaths[playerid] ++;
    InMinigame[playerid] = 0;
    SendDeathMessage(killerid, playerid, reason);
    return 1;
}
Line 841 =
pawn Код:
pInfo[playerid][pDeaths]++; // Replace with your variables
Reply
#6

You have defined pInfo variable twice, that's why you get these errors
Reply
#7

I tried to make the two pInfo, by one. But I still got the same errors
Reply
#8

show me how you make it
Reply
#9

pawn Код:
enum pInfo
{
    ReadPms,
    MaxPing,
    ReadCmds,
    ConnectMsg,
    AutoLog,
    sLocked,
    sPass[129],
    ScoreSaving,
    ReporterName[MAX_PLAYER_NAME],
    TargetName[MAX_PLAYER_NAME],
    Reason[128],
    H,
    M,
    S,
};
pawn Код:
enum pInfo
{
    Pass[129],
    Ip[16],
    Log,
    TrustedPlayer,
    Admin,
    Hide,
    Jail,
    Freeze,
    Mute,
    MuteTime,
    Pm,
    hours,
    minuteit,
    secs,
    TotalTime,
    ConnectTime,
    cage,
    BlockPM,
    Invisible,
    AdminWhoBanIt[MAX_PLAYER_NAME],
    Banned,
    Float:X,
    Float:Y,
    Float:Z,
    Float:Ang,
    Int,
    World,
    SaveSkin,
    SaveColor,
    Question[129],
    Answer[129],
    UseSkin,
    UseColor,
    GainPoints,
    God,
    Warn,
    Score,
    Money,
    Kills,
    Deaths
};
Reply
#10

Quote:
Originally Posted by mickos
Посмотреть сообщение
pawn Код:
enum pInfo
{
    ReadPms,
    MaxPing,
    ReadCmds,
    ConnectMsg,
    AutoLog,
    sLocked,
    sPass[129],
    ScoreSaving,
    ReporterName[MAX_PLAYER_NAME],
    TargetName[MAX_PLAYER_NAME],
    Reason[128],
    H,
    M,
    S,
};
pawn Код:
enum pInfo
{
    Pass[129],
    Ip[16],
    Log,
    TrustedPlayer,
    Admin,
    Hide,
    Jail,
    Freeze,
    Mute,
    MuteTime,
    Pm,
    hours,
    minuteit,
    secs,
    TotalTime,
    ConnectTime,
    cage,
    BlockPM,
    Invisible,
    AdminWhoBanIt[MAX_PLAYER_NAME],
    Banned,
    Float:X,
    Float:Y,
    Float:Z,
    Float:Ang,
    Int,
    World,
    SaveSkin,
    SaveColor,
    Question[129],
    Answer[129],
    UseSkin,
    UseColor,
    GainPoints,
    God,
    Warn,
    Score,
    Money,
    Kills,
    Deaths
};
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    SendDeathMessage(killerid, playerid, reason);
    if(killerid != INVALID_PLAYER_ID)
    {
        SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
        GameTextForPlayer(killerid,"~w~+1 Score~R~~N~+1 kill~N~ ~g~+1000$", 5000, 1);
        GivePlayerMoney(killerid, 1000);
        SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
     }
        return 1;
}
_________________
xXx Stunt Paradise Awesome

Server IP: Click Here!

Hosted Tab Game-MP for 10 Euro / per month
Hosted Tab + Server host 50 slots + Control Panel for 15 Euro
Skype: MahdiAsali
Ђ10 Euro for Hosted List
Reply
#11

How do you have 900+ posts and still ask a questio that should be asked by a beginner?
Reply
#12

Quote:
Originally Posted by Shetch
Посмотреть сообщение
How do you have 900+ posts and still ask a questio that should be asked by a beginner?
This post must be removed , if you wont help calm down.. ~~


_________________
xXx Stunt Paradise Awesome

Server IP: Click Here!

Hosted Tab Game-MP for 10 Euro / per month
Hosted Tab + Server host 50 slots + Control Panel for 15 Euro
Skype: MahdiAsali
Ђ10 Euro for Hosted List
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)