Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Eroare la compilare


Question

Posted

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

 

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

Adauga:

forward CancelVote(playerid);
Cu placere.

Edited by AlexBo$$

g4JGBJX.gif.31953391ab64171df562293ad37a0875.gif.9d26b39cd3270634d9cf89dcb43fba87.gif

 

 

  • 0
Posted
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

  • 0
Posted

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.