Noob question, Levelup
#1

Alright, so i got this function that checks the players kills, and if the kills are a certain ammount, they level up. and proccess continues, so i made it, made a little command that raises the kills, It works for the first level, then it wont continue.

pawn Код:
public Levelup(playerid)
{
    if(soldier[playerid] == 1)
    {
        if(PlayerInfo[playerid][Soldierlv] == 1)
        {
            if(PlayerInfo[playerid][Kills] == 1)
            {
                PlayerInfo[playerid][Soldierlv]++;
                PlayerInfo[playerid][Level]++;
                SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
            }
            if(soldier[playerid] == 1)
            {
                if(PlayerInfo[playerid][Soldierlv] == 2)
                {
                    if(PlayerInfo[playerid][Kills] == 5)
                    {
                        PlayerInfo[playerid][Soldierlv]++;
                        PlayerInfo[playerid][Level]++;
                        SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
                    }
                }
            }
        }
    }
}
I'm thinking it needs to return 1, but not sure. Anyone got an opinion? or a fix?
EDIT: returned with 1, Still nothing.
Reply
#2

Check this out:
pawn Код:
public Levelup(playerid)
{
    if(soldier[playerid] == 1)
    {
        if(PlayerInfo[playerid][Soldierlv] == 1)
        {
            if(PlayerInfo[playerid][Kills] == 1)
            {
                PlayerInfo[playerid][Soldierlv]++;
                PlayerInfo[playerid][Level]++;
                SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
            }
        }
        else if(PlayerInfo[playerid][Soldierlv] == 2)
                {
                    if(PlayerInfo[playerid][Kills] == 5)
                    {
                        PlayerInfo[playerid][Soldierlv]++;
                        PlayerInfo[playerid][Level]++;
                        SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
                    }
                }
    }
 return 1;
}
Reply
#3

Still same problem, But thanks for the suggestion buddy.
Reply
#4

pawn Код:
public Levelup(playerid)
{
    if(soldier[playerid] == 1)
    {
        if(PlayerInfo[playerid][Soldierlv] == 1)
        {
            if(PlayerInfo[playerid][Kills] == 1)
            {
                PlayerInfo[playerid][Soldierlv]++;
                PlayerInfo[playerid][Level]++;
                SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
            }
        }
    }
    if(soldier[playerid] == 1)
            {
                if(PlayerInfo[playerid][Soldierlv] == 2)
                {
                    if(PlayerInfo[playerid][Kills] == 5)
                    {
                        PlayerInfo[playerid][Soldierlv]++;
                        PlayerInfo[playerid][Level]++;
                        SendClientMessage(playerid, COLOR_GREEN, "You have leveled up! Congradulations!");
                    }
                }
            }
}
return 1;
Reply
#5

Right, Firecats worked, Apriciated it. Rep+
Reply
#6

Quote:
Originally Posted by -Rebel Son-
Посмотреть сообщение
Right, Firecats worked, Apriciated it. Rep+
It's firecat!
Reply
#7

mybad Firecat!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)