Get/Set Score
#1

I am using this Duel System https://sampforum.blast.hk/showthread.php?tid=254032

How do I get the score everytime I win in every single duel?



For example: Playeryou vs Playerme then I won in 1 duel then my Duel score should be 1.

I know I should add Duel in

pawn Код:
enum PlayerData
{
    AdminLevel,
    Kills,
    Reps,
    Deaths,
    Hours,
    Minutes,
    Seconds,
    TotalTime,
        Duel, <---------
    ConnectTime
Reply
#2

use this setplayerscore + getplayerscore for the winner.
Reply
#3

You could create a variable when player enters the duel and when he dies, give score to the killer.
Example:
pawn Код:
new InDuel[MAX_PLAYERS];
CMD:duel(playerid,params[])
{
   InDuel[playerid]=1;
   return 1;
}

public OnPlayerDeath(playerid,killerid,reason)
{
   if(InDuel[killerid] == 1) //Checking whether the killer is in duel.
   {
      SetPlayerScore(killerid)(GetPlayerScore(killerid)+1; //Gives +1 score.
   }
   if(InDuel[playerid] == 0)
   {
     SendClientMessage(playerid, 0xFF0000, "You Lost!");
   }
   return 1;
}
Reply
#4

Quote:
Originally Posted by [xB]Lordz
Посмотреть сообщение
You could create a variable when player enters the duel and when he dies, give score to the killer.
Example:
pawn Код:
new InDuel[MAX_PLAYERS];
CMD:duel(playerid,params[])
{
   InDuel[playerid]=1;
   return 1;
}

public OnPlayerDeath(playerid,killerid,reason)
{
   if(InDuel[killerid] == 1) //Checking whether the killer is in duel.
   {
      SetPlayerScore(killerid)(GetPlayerScore(killerid)+1; //Gives +1 score.
   }
   if(InDuel[playerid] == 0)
   {
     SendClientMessage(playerid, 0xFF0000, "You Lost!");
   }
   return 1;
}
MEGA EDIT: Just a simple question. Is it correct that this
pawn Код:
PlayerInfo[killerid][Duels]++;
will add + 1 to my duel scoring?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)