SA-MP Forums Archive
Coprank problem - 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: Coprank problem (/showthread.php?tid=467737)



Coprank problem - efrim123 - 04.10.2013

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



Re: Coprank problem - EiresJason - 04.10.2013

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



Re: Coprank problem - efrim123 - 04.10.2013

Thanks it worked


Re: Coprank problem - EiresJason - 04.10.2013

Np