I need help
#1

Can one of you help me to make a little thing ??
I need a Score System, where a player gets +1 level every 30 minutes. In DOF2.
I am not able to do :/
Can you help me?

And gives a message to player:

| UP | Level ( x )
Reply
#2

pawn Код:
public OnPlayerConnect
SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
pawn Код:
SetTimer("GiveScore",1800000,1);
pawn Код:
forward GiveScore(playerid);
public GiveScore(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
    SendClientMessage...
    return 1;
}
Reply
#3

And how can i put, Ex: | UP | Congratulations ! Level ( x ) ?
Reply
#4

pawn Код:
// Put this under OnGameModeInit
SetTimer("GiveScore",1800000,true); // 1 sec = 1000 millisecond 1800000 = 30 mins.
// These two anywhere incase you ask.
forward GiveScore();
public GiveScore()
{
    for(new i = 0; i < sizeof(MAX_PLAYERS); i ++)
    {
        SetPlayerScore(i, GetPlayerScore(playerid)+1);
        new string[25]; format(string,sizeof(string,"Level up ~N~ ~>~ You're now level %d ~<~",GetPlayerScore(playerid);
        GameTextForPlayer(i,string,5000,6);
    }
    return 1;
}
Be sure to read wiki.sa-mp.com for such basic coding.

Read:
GameTextForPlayer.
How to set a timer and use it.
Formatting messages.
Reply
#5

pawn Код:
(3399) : error 020: invalid symbol name ""
(3388) : error 029: invalid expression, assumed zero
(3388) : warning 215: expression has no effect
(3388) : error 017: undefined symbol "i"
(3388) : fatal error 107: too many error messages on one line
?? '-'
Reply
#6

SirRafa, I did already told you, Use SendClientMessage.
pawn Код:
public GiveScore(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
    SendClientMessage(playerid, COLOR_RED,"You leveled up");
    return 1;
}
Reply
#7

Quote:
Originally Posted by Clad
Посмотреть сообщение
SirRafa, I did already told you, Use SendClientMessage.
pawn Код:
public GiveScore(playerid)
{
    SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
    SendClientMessage(playerid, COLOR_RED,"You leveled up");
    return 1;
}
But i want to put this: '| UP | Level UP ! ( Level Now ) ' -> Do u understand ?
Reply
#8

Код:
public GiveScore(playerid)
{
    new message[16];
    SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
    format(message,sizeof(message),"UP| LEVEL UP (%d)",GetPlayerScore(playerid));
    SendClientMessage(playerid,COLOR_GREEN,message);
    return 1;
}
If it will fail try raising new message[16] to more, for example message[20] and on..
Reply
#9

pawn Код:
public GiveScore(playerid)
{
    new blah[256];
    SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
    format(blah,sizeof(blah),"UP| LEVEL UP (Your level:%d",GetPlayerScore(playerid));
    SendClientMessage(playerid,COLOR_GREEN,blah);
    return 1;
}
Reply
#10

Quote:
Originally Posted by Clad
Посмотреть сообщение
pawn Код:
public GiveScore(playerid)
{
    new blah[256];
    SetPlayerScore(playerid, GetPlayerScore(playerid) +1);
    format(blah,sizeof(blah),"UP| LEVEL UP (Your level:%d",GetPlayerScore(playerid));
    SendClientMessage(playerid,COLOR_GREEN,blah);
    return 1;
}
AAAAAAAAAaaaaah dat feel when you quote me before I edit
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)