invalid function or declaration - Problem
#1

Код:
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/DSRP.pwn(42766) : warning 217: loose indentation
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/DSRP.pwn(42769) : warning 217: loose indentation
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/DSRP.pwn(42776) : warning 217: loose indentation
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/DSRP.pwn(45128) : warning 209: function "cmd_accept" should return a value
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/DSRP.pwn(45129) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Код:
							}
							else
							{
								PlayerInfo[RefillOffer[playerid]][pMechSkill] += 1;
								PlayerInfo[RefillOffer[playerid]][pXP] += PlayerInfo[RefillOffer[playerid]][pLevel] * XP_RATE;
							}

                            if(RefillPrice[playerid] >= 30000 && (PlayerInfo[playerid][pLevel] <= 3 || PlayerInfo[RefillOffer[playerid]][pLevel] <= 3)) {
                                format(szMessage, sizeof(szMessage), "%s (IP:%s) has refueled %s (IP:%s) $%d in this session.", GetPlayerNameEx(playerid), ip, GetPlayerNameEx(RefillOffer[playerid]), ipex, RefillPrice[playerid]);
                                //Log("logs/pay.log", szMessage);
                                ABroadCast(COLOR_YELLOW, szMessage, 2);
                            }

                            RefillOffer[playerid] = INVALID_PLAYER_ID;
                            RefillPrice[playerid] = 0;
                            return 1;
                        }
                        return 1;
                    }
                    return 1;
                }
                else {
                    SendClientMessageEx(playerid, COLOR_GREY, "   You can't afford the refill!");
                    return 1;
                }
            }
            else {
                SendClientMessageEx(playerid, COLOR_GREY, "   No-one offered you to refill your Car!");
                return 1;
            }
        }
        else { return 1; }
	}

	return 1;
}
This is a big code I can't copy everything here.
The error is from the last return 1;
I have also warnings on this code.

Код:
        }

        if(strcmp(params, "death", true) == 0) {
            if(GetPVarInt(playerid, "Injured") == 1) {
            for(new i; i < MAX_PLAYERS; i++) { // GetPlayerPool() or foreach is highly recommended!
                if(IsAMedic(i))
                    return SendClientMessage(playerid, COLOR_GREY, "There are FD Members Online!, (/service ems)");
                    break;
                }
            }
                SendClientMessageEx(playerid, COLOR_WHITE, "You gave up hope and fell unconscious, you were immediately sent to the hospital.");
                KillEMSQueue(playerid);
                ResetPlayerWeaponsEx(playerid);
                SpawnPlayer(playerid);
            }
            else {  SendClientMessageEx(playerid, COLOR_GREY, "   You are not injured, you can't do this right now !"); }
        }
Can someone help?
Reply
#2

Try this and let me know, please:

pawn Код:
}
                            else
                            {
                                PlayerInfo[RefillOffer[playerid]][pMechSkill] += 1;
                                PlayerInfo[RefillOffer[playerid]][pXP] += PlayerInfo[RefillOffer[playerid]][pLevel] * XP_RATE;
                            }

                            if(RefillPrice[playerid] >= 30000 && (PlayerInfo[playerid][pLevel] <= 3 || PlayerInfo[RefillOffer[playerid]][pLevel] <= 3)) {
                                format(szMessage, sizeof(szMessage), "%s (IP:%s) has refueled %s (IP:%s) $%d in this session.", GetPlayerNameEx(playerid), ip, GetPlayerNameEx(RefillOffer[playerid]), ipex, RefillPrice[playerid]);
                                //Log("logs/pay.log", szMessage);
                                ABroadCast(COLOR_YELLOW, szMessage, 2);
                            }

                            RefillOffer[playerid] = INVALID_PLAYER_ID;
                            RefillPrice[playerid] = 0;
                        }
                    }
                }
                else {
                    SendClientMessageEx(playerid, COLOR_GREY, "   You can't afford the refill!");
                    return 1;
                }
            }
            else {
                SendClientMessageEx(playerid, COLOR_GREY, "   No-one offered you to refill your Car!");
                return 1;
            }
        }
        else { return 1; }
    }

    return 1;
}
You used "return 1;" in multiple open places, making the last one un-reachable.

Also, please can you state the warning(s) you are getting from the last part? Is it the loose indentation?

EDIT:

If it is loose indentation, here is an attempted fix:

pawn Код:
if(strcmp(params, "death", true) == 0) {
            if(GetPVarInt(playerid, "Injured") == 1) {
                for(new i; i < MAX_PLAYERS; i++) { // GetPlayerPool() or foreach is highly recommended!
                    if(IsAMedic(i))
                        return SendClientMessage(playerid, COLOR_GREY, "There are FD Members Online!, (/service ems)");
                        break;
                    }
                }
                SendClientMessageEx(playerid, COLOR_WHITE, "You gave up hope and fell unconscious, you were immediately sent to the hospital.");
                KillEMSQueue(playerid);
                ResetPlayerWeaponsEx(playerid);
                SpawnPlayer(playerid);
            }
            else {  SendClientMessageEx(playerid, COLOR_GREY, "   You are not injured, you can't do this right now !"); }
        }
Reply
#3

Quote:
Originally Posted by RedCounty
Посмотреть сообщение
Try this and let me know, please:

pawn Код:
}
                            else
                            {
                                PlayerInfo[RefillOffer[playerid]][pMechSkill] += 1;
                                PlayerInfo[RefillOffer[playerid]][pXP] += PlayerInfo[RefillOffer[playerid]][pLevel] * XP_RATE;
                            }

                            if(RefillPrice[playerid] >= 30000 && (PlayerInfo[playerid][pLevel] <= 3 || PlayerInfo[RefillOffer[playerid]][pLevel] <= 3)) {
                                format(szMessage, sizeof(szMessage), "%s (IP:%s) has refueled %s (IP:%s) $%d in this session.", GetPlayerNameEx(playerid), ip, GetPlayerNameEx(RefillOffer[playerid]), ipex, RefillPrice[playerid]);
                                //Log("logs/pay.log", szMessage);
                                ABroadCast(COLOR_YELLOW, szMessage, 2);
                            }

                            RefillOffer[playerid] = INVALID_PLAYER_ID;
                            RefillPrice[playerid] = 0;
                        }
                    }
                }
                else {
                    SendClientMessageEx(playerid, COLOR_GREY, "   You can't afford the refill!");
                    return 1;
                }
            }
            else {
                SendClientMessageEx(playerid, COLOR_GREY, "   No-one offered you to refill your Car!");
                return 1;
            }
        }
        else { return 1; }
    }

    return 1;
}
You used "return 1;" in multiple open places, making the last one un-reachable.

Also, please can you state the warning(s) you are getting from the last part? Is it the loose indentation?

EDIT:

If it is loose indentation, here is an attempted fix:

pawn Код:
if(strcmp(params, "death", true) == 0) {
            if(GetPVarInt(playerid, "Injured") == 1) {
                for(new i; i < MAX_PLAYERS; i++) { // GetPlayerPool() or foreach is highly recommended!
                    if(IsAMedic(i))
                        return SendClientMessage(playerid, COLOR_GREY, "There are FD Members Online!, (/service ems)");
                        break;
                    }
                }
                SendClientMessageEx(playerid, COLOR_WHITE, "You gave up hope and fell unconscious, you were immediately sent to the hospital.");
                KillEMSQueue(playerid);
                ResetPlayerWeaponsEx(playerid);
                SpawnPlayer(playerid);
            }
            else {  SendClientMessageEx(playerid, COLOR_GREY, "   You are not injured, you can't do this right now !"); }
        }
The warnings are on params, "death" the last code I posted at the first post.
Reply
#4

Quote:
Originally Posted by RedCounty
Посмотреть сообщение
Try this and let me know, please:

pawn Код:
}
                            else
                            {
                                PlayerInfo[RefillOffer[playerid]][pMechSkill] += 1;
                                PlayerInfo[RefillOffer[playerid]][pXP] += PlayerInfo[RefillOffer[playerid]][pLevel] * XP_RATE;
                            }

                            if(RefillPrice[playerid] >= 30000 && (PlayerInfo[playerid][pLevel] <= 3 || PlayerInfo[RefillOffer[playerid]][pLevel] <= 3)) {
                                format(szMessage, sizeof(szMessage), "%s (IP:%s) has refueled %s (IP:%s) $%d in this session.", GetPlayerNameEx(playerid), ip, GetPlayerNameEx(RefillOffer[playerid]), ipex, RefillPrice[playerid]);
                                //Log("logs/pay.log", szMessage);
                                ABroadCast(COLOR_YELLOW, szMessage, 2);
                            }

                            RefillOffer[playerid] = INVALID_PLAYER_ID;
                            RefillPrice[playerid] = 0;
                        }
                    }
                }
                else {
                    SendClientMessageEx(playerid, COLOR_GREY, "   You can't afford the refill!");
                    return 1;
                }
            }
            else {
                SendClientMessageEx(playerid, COLOR_GREY, "   No-one offered you to refill your Car!");
                return 1;
            }
        }
        else { return 1; }
    }

    return 1;
}
You used "return 1;" in multiple open places, making the last one un-reachable.

Also, please can you state the warning(s) you are getting from the last part? Is it the loose indentation?

EDIT:

If it is loose indentation, here is an attempted fix:

pawn Код:
if(strcmp(params, "death", true) == 0) {
            if(GetPVarInt(playerid, "Injured") == 1) {
                for(new i; i < MAX_PLAYERS; i++) { // GetPlayerPool() or foreach is highly recommended!
                    if(IsAMedic(i))
                        return SendClientMessage(playerid, COLOR_GREY, "There are FD Members Online!, (/service ems)");
                        break;
                    }
                }
                SendClientMessageEx(playerid, COLOR_WHITE, "You gave up hope and fell unconscious, you were immediately sent to the hospital.");
                KillEMSQueue(playerid);
                ResetPlayerWeaponsEx(playerid);
                SpawnPlayer(playerid);
            }
            else {  SendClientMessageEx(playerid, COLOR_GREY, "   You are not injured, you can't do this right now !"); }
        }
Код:
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/DSRP.pwn(42766) : warning 217: loose indentation
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/DSRP.pwn(42769) : warning 217: loose indentation
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/DSRP.pwn(42776) : warning 217: loose indentation
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/DSRP.pwn(45125) : warning 209: function "cmd_accept" should return a value
C:\Users\Ron\Desktop\Insanity Gaming RP\gamemodes\/../gamemodes/includes/DSRP.pwn(45127) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)