Coprank problem
#1

Hello
i tried to forward the IncreaseCoprank variable and i couldnt make it work
i get the error that its not implented

pawn Код:
forward IncreaseCoprank(playerid, value);
pawn Код:
if(gTeam[killerid] == Team_Cop)
    {
        if(gTeam[playerid] == Team_Cop)
        {
            DecreaseScore(killerid, 1);
            return 1;
        }
        if(gTeam[playerid] == Team_Civi)
        {
            new pwl = GetPlayerWantedLevel(playerid);
            if(pwl == 0)
            {
                IncreaseScore(killerid, 1);
                return 1;
            }
            if(pwl == 1 || pwl == 2)
            {
                IncreaseScore(killerid, 1);
                return 1;
            }
            if(pwl == 3 || pwl == 4 || pwl == 5)
            {
                IncreaseScore(killerid, 1);
                IncreaseCoprank(killerid, 1);
                GivePlayerMoney(killerid, 5000);
                return 1;
            }
            if(pwl == 6)
            {
                IncreaseScore(killerid, 2);
                IncreaseCoprank(killerid, 2);
                GivePlayerMoney(killerid, 10000);
                return 1;
            }
            return 1;
        }
    }
Errors:
Код:
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CnR.pwn(627) : error 004: function "IncreaseCoprank" is not implemented
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CnR.pwn(634) : error 004: function "IncreaseCoprank" is not implemented
Reply
#2

forwarding is used for public functions.

Used like this:
pawn Код:
forward IncreaseCoprank(playerid, value);
public IncreaseCoprank(playerid, value)
{
   //code here that will increase the cops rank. For example:
   PlayerInfo[playerid][pCopRank] += value;

   return 1;
}
Though if you only want to increase the cops rank by 1 everytime, you would do this:
pawn Код:
forward IncreaseCoprank(playerid);
public IncreaseCoprank(playerid)
{
   //code here that will increase the cops rank. For example:
   PlayerInfo[playerid][pCopRank] += 1;

   return 1;
}

//and use it in a command/function like this:
    IncreaseCoprank(playerid);
Reply
#3

Thanks it worked
Reply
#4

Np
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)