How can i make this function on score board?
#1

pawn Код:
forward ExpTimer();
pawn Код:
public OnGameModeInit()
{
    SetTimer("ExpTimer", 60000, true); // Repeating timer set when the server starts up
}
at end of script
pawn Код:
public ExpTimer()  // The timer callback
{
    for(new i = 0; i != MAX_PLAYERS; i++)
    { // Loop
        if(IsPlayerConnected(i) && !IsPlayerNPC(i)) // Checks if player is connected + NPC's don't need experience
        {
            GivePlayerExp(i, 15, ""); // Every connected player receives 1 EXP
        }
    }
    return 1;
}
So this is EXP... How can i make EXP amount displayed in score board? And it will be saved maybe?
Reply
#2

Why do you use GivePlayerExp()? Use this:
pawn Код:
SetPlayerScore(i,GetPlayerScore(i)+15);
Reply
#3

https://sampwiki.blast.hk/wiki/SetPlayerScore

Quote:
Originally Posted by sabretur
Посмотреть сообщение
Why do you use GivePlayerExp()? Use this:
pawn Код:
SetPlayerScore(i,GetPlayerScore(i)+15);
probably he/she wants to save the EXP value somewhere.
Best wa is to get the value from the EXP and use SetPlayerScore.
Reply
#4

He might has stock.
pawn Код:
// Example:
stock GivePlayerScore(playerid, score)
{
    return SetPlayerScore(playerid, GetPlayerScore(playerid) + score);
}
Reply
#5

Quote:
Originally Posted by Dwane
Посмотреть сообщение
He might has stock.
pawn Код:
// Example:
stock GivePlayerScore(playerid, score)
{
    return SetPlayerScore(playerid, GetPlayerScore(playerid) + score);
}
I mean something like that:

pawn Код:
if(GivePlayerExp(i, 15, "") && GetPlayerScore(playerid) + 15);
Reply
#6

help plz
Reply
#7

pawn Код:
public ExpTimer()  // The timer callback
{
    for(new i = 0; i != MAX_PLAYERS; i++)
    { // Loop
        if(IsPlayerConnected(i) && !IsPlayerNPC(i)) // Checks if player is connected + NPC's don't need experience
        {
            SetPlayerScore(i,GetPlayerScore(i)+15);
        }
    }
    return 1;
}
Reply
#8

Quote:
Originally Posted by sabretur
Посмотреть сообщение
pawn Код:
public ExpTimer()  // The timer callback
{
    for(new i = 0; i != MAX_PLAYERS; i++)
    { // Loop
        if(IsPlayerConnected(i) && !IsPlayerNPC(i)) // Checks if player is connected + NPC's don't need experience
        {
            SetPlayerScore(i,GetPlayerScore(i)+15);
        }
    }
    return 1;
}
duok skype parodysiu visa scripta ...
Reply
#9

I mean something like that people:

pawn Код:
if(GivePlayerExp(i, 15, "") && GetPlayerScore(playerid) + 15);
help me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)