[HELP] Warnings
#1

Hey currently creating some of my anti cheat but i get really annoying warnings:

pawn Код:
new pMoney[MAX_PLAYERS];

new ForbiddenWeapons[][] = {
38, //Minigun
35, //RPG
36 //Heatseeking RPG
};
pawn Код:
public OnPlayerUpdate(playerid)
{
        new pName[MAX_PLAYER_NAME], string[128];
        if(GetPlayerMoney(playerid) > pMoney[playerid])
        {
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Money Hack", pName);
        SendClientMessageToAll(COLOR_RED, string);
        BanEx(playerid, "Money Hack");
        }
        new w = 0;
        while(w < (sizeof(ForbiddenWeapons))){
        if(GetPlayerWeapon(playerid) == w){
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Weapon Hack", pName);
        SendClientMessageToAll(COLOR_RED, string);
        BanEx(playerid, "Weapon Hacks");
        }
        return 1;
    }
}
Код:
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\diftV1.pwn(98) : warning 209: function "OnPlayerUpdate" should return a value
C:\Users\Admin\Desktop\SAMP\Fas FreeRoam\gamemodes\diftV1.pwn(1306) : warning 203: symbol is never used: "ForbiddenWeapons"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.
i mean i know the wont affect anything but i like to have my gamemodes perfectly compiled so could anyone help please?
Reply
#2

pawn Код:
warning 209: function "OnPlayerUpdate" should return a value

// ^ as straight forward as it says, add return 1; under onplayerupdate

warning 203: symbol is never used: "ForbiddenWeapons"

// ^ means ForbiddenWeapons is created, but never used
Reply
#3

pawn Код:
public OnPlayerUpdate(playerid)
{
    new pName[MAX_PLAYER_NAME], string[128];
    if(GetPlayerMoney(playerid) > pMoney[playerid])
    {
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Money Hack", pName);
        SendClientMessageToAll(COLOR_RED, string);
        BanEx(playerid, "Money Hack");
        return 1;
    }
    new w = 0;
    while(w < (sizeof(ForbiddenWeapons)))
    {
        if(GetPlayerWeapon(playerid) == w)
        {
            GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
            format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Weapon Hack", pName);
            SendClientMessageToAll(COLOR_RED, string);
            BanEx(playerid, "Weapon Hacks");
            return 1;
        }
    }  
    return 0;
}
pawn Код:
symbol is never used: "ForbiddenWeapons"
simply means that you defined "ForbiddenWeapons" but never used it.
Reply
#4

pawn Код:
public OnPlayerUpdate(playerid)
{
    new pName[MAX_PLAYER_NAME], string[128];
    if(GetPlayerMoney(playerid) > pMoney[playerid])
    {
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Money Hack", pName);
        SendClientMessageToAll(COLOR_RED, string);
        BanEx(playerid, "Money Hack");
        return 1;
    }
    new w = 0;
    while(w < (sizeof(ForbiddenWeapons))){
    if(GetPlayerWeapon(playerid) == w)
    {
        GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
        format(string, sizeof(string), "[SERVER]: %s has been banned, Reason: Weapon Hack", pName);
        SendClientMessageToAll(COLOR_RED, string);
        BanEx(playerid, "Weapon Hacks");
        return 1;
        }
    return 1;
    }
   
}
Still the same warnings but when i dont include the return 1; i get non XD
Reply
#5

Copy the one I made and try this.
Reply
#6

put return 1; over the last braked ( } )
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)