Forwarding Problem.
#1

Hello
i have a problem i forwarded something the implended it and it shows that its not implented

forwards:
pawn Код:
forward IncreaseWantedLevel(playerid, value);
forward IncreaseScore(playerid, value);
forward IncreaseCoprank(playerid, value);
pawn Код:
if ( killerid != INVALID_PLAYER_ID )
    {
        if ( GetPlayerTeam( killerid ) == GetPlayerTeam( playerid ) )//if the killerid is the same team as the victim,
        { //then
            IncreaseScore(playerid, 1);
            GivePlayerMoney(playerid, 1000);
            SendClientMessage( killerid, 0xFF2A29, "You are not allowed to kill players of your own team. As a punishment you loose $1000." );//message to the killerid.
            IncreaseWantedLevel(playerid, 4);
        }
        else
        {
            SendClientMessage( killerid, 0xFFFFFF, "{FFC800}You have killed a player and received {4EFF4E}$1000 and 1 score{FFC800}!" );//message to the killerid
            GivePlayerMoney(killerid, 1000);//Give the killer $1000
            if(killerid != INVALID_PLAYER_ID)SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);//Give the player 1 score.

        }

    }
    SendDeathMessage(killerid, playerid, reason );

and i get those errors
Код:
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CnR.pwn(422) : error 004: function "IncreaseScore" is not implemented
C:\Program Files (x86)\Microsoft Power\GTA San Andreas\TeamDeathMatch\gamemodes\CnR.pwn(425) : error 004: function "IncreaseWantedLevel" is not implemented
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#2

No you did it wrong. What is the purpose of those functions, implement them!

pawn Код:
stock IncreaseScore(playerid, value)
{
   SetPlayerScore(playerid, GetPlayerScore(playerid) + value);
}

stock IncreaseWantedLevel(playerid, value)
{
   SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + value);
}
No need to forward it.
Reply
#3

Thanks it work 1+ Rep for you
Reply
#4

You also need to make pubilc yourfunctionname to get rid of these errors..
Reply
#5

Quote:
Originally Posted by PrinceKumar
Посмотреть сообщение
You also need to make pubilc yourfunctionname to get rid of these errors..
I've used stock, no need to use public and forward.

It can be also used as a macro

pawn Код:
#define IncreaseScore(%1, %2)  SetPlayerScore(%1, GetPlayerScore(%1) + %2)
#define IncreaseWantedLevel(%1, %2)  SetPlayerWantedLevel(%1, GetPlayerWantedLevel(%1) + %2)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)