[Help] error 025: function heading differs from prototype
#1

I get error when i compile my script - What's wrong with this line?

Quote:

error 025: function heading differs from prototype

Quote:

public OnQueryFinish( query[], resultid, extraid, connectionHandle ) {

Reply
#2

You have to have the same parameters when you forward that function.
Reply
#3

Change that line to:
pawn Код:
public OnQueryFinish(query[], index, extraid, connectionHandle) {
The public retained a different variable ('index' was missing and 'resultid' was added to replace it, you need to stick to the defaults from the include, or change the include/plugin).
Reply
#4

First of all, thanks for answering!

When i add this i get one error more:

Quote:

error 025: function heading differs from prototype
error 017: undefined symbol "resultid"

The whole stuff is this

Quote:

public OnQueryFinish(query[], index, extraid, connectionHandle) {
switch(resultid) {
case MYSQL_SAVE_VEHICLES: {

}
case MYSQL_SAVE_USERS: {

}
case MYSQL_LOAD_OOC_ROOMS: {
mysql_store_result();
if(mysql_num_rows() == 0) {
print("No chatrooms in the database! Creating OOC Rooms!");
for(new i = 0; i < TOTAL_OOCROOMS; i ++ ) {
mysql_query("INSERT INTO OOCRooms (Owned, Locked, Owner, Password, Owner) VALUES(0,0,'None','None', 'None')");
printf("Created OOC room %i | Data: Owned: False, Locked: False, Owner: None, Password: None", i);
}
}

Reply
#5

Change switch(resultid) to switch(index)
Reply
#6

Now I can start over

Quote:

025: function heading differs from prototype

On the same line

Quote:

public OnQueryFinish(query[], index, extraid, connectionHandle) {

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)