Jump to content
  • 0

Eroare la compilare


_K3NT_

Question

public function lacks forward declaration (symbol "CancelVote")

AM incercat sa implemenentez u nsistem de /vote

public CancelVote()
{
    if(OnVote == 0) return 0;
    new str[128], str2[128];
    foreach(new i : Player) Voted = -1;
    format(str, sizeof(str), "Vote: %s is OVER!", Voting[Vote]);
    format(str2, sizeof(str2), "Yes: %d No: %d", Voting[VoteY], Voting[VoteN]);
    SendClientMessageToAll(COLOR_GREEN, str);
    SendClientMessageToAll(COLOR_GREEN, str2);
    OnVote = 0;
    Voting[VoteY] = 0;
    Voting[VoteN] = 0;
    return 1;
}

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Acum 3 ore, _K3NT_ a spus:

public function lacks forward declaration (symbol "CancelVote")

AM incercat sa implemenentez u nsistem de /vote

public CancelVote()
{
    if(OnVote == 0) return 0;
    new str[128], str2[128];
    foreach(new i : Player) Voted = -1;
    format(str, sizeof(str), "Vote: %s is OVER!", Voting[Vote]);
    format(str2, sizeof(str2), "Yes: %d No: %d", Voting[VoteY], Voting[VoteN]);
    SendClientMessageToAll(COLOR_GREEN, str);
    SendClientMessageToAll(COLOR_GREEN, str2);
    OnVote = 0;
    Voting[VoteY] = 0;
    Voting[VoteN] = 0;
    return 1;
}

 

Adauga forward CancelVote();

 

Acum 3 ore, AlexBo$$ a spus:

Adauga:

forward CancelVote(playerid);
Cu placere.

Asa nu o sa mearga, trebuie sa modifice si publicul daca pune playerid

Link to comment
Share on other sites

  • 0

Așa cum au spus și cei de mai sus, adaugă forward CancelVote();

Pentru a îți fi mai ușor (fără să mai adaugi și forward și public), mai jos ai un define:

#define     function:%0(%1)            forward %0(%1); public %0(%1)

Poți folosi această scurtătură pentru a nu mai adauga forward și public de fiecare dată când faci o funcție nouă.
 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.