SA-MP Forums Archive
I need help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: I need help (/showthread.php?tid=528752)



I need help - Nenzittow - 29.07.2014

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 )


Re: I need help - Clad - 29.07.2014

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;
}



Re: I need help - Nenzittow - 29.07.2014

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


Re: I need help - Beckett - 29.07.2014

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.


Re: I need help - Nenzittow - 29.07.2014

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
?? '-'


Re: I need help - Clad - 29.07.2014

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;
}



Re: I need help - Nenzittow - 29.07.2014

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 ?


Re: I need help - Burning - 29.07.2014

Код:
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..


Re: I need help - Clad - 29.07.2014

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;
}



Re: I need help - Burning - 29.07.2014

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