Weapon Hack Problem
#1

I'm making a weapon hack system now i'm working on it on playerupdate
i made a stock in my include now the problem is i get this warning

Код:
D:\GTA San Andreas\SAMP Server\pawno\include\XSI.inc(153) : warning 209: function "GetPlayerHackWeapon" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
Heres my code

pawn Код:
public OnPlayerUpdate(playerid)
{
    new string[128],hackername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, hackername, MAX_PLAYER_NAME);
    if(GetPlayerHackWeapon(playerid) && WeaponCheck[playerid] != 1)
    {
       format(string, sizeof(string),"ANTICHEAT: %s has been banned <Reason: Weapon Hack>", hackername);
       SendClientMessageToAll(COLOR_RED, string);
       BanEx(playerid,"Weapon Hack");
    }
    return 1;
}

stock GetPlayerHackWeapon(playerid)
{
    if(GetPlayerWeapon(playerid) == 1
    || 2 || 3 || 4 || 5 || 6 || 7 || 8
    || 9 || 10 || 11 || 12 || 13 || 14
    || 15 || 16 || 17 || 18 || 19 || 20
    || 21 || 22 || 23 || 24 || 25 || 26
    || 27 || 28 || 29 || 30 || 31 || 32
    || 33 || 34 || 35 || 36 || 37 || 38
    || 39 || 40 || 41 || 42 || 43 || 44
    || 45 || 46)
    return true;
}
Please help
Reply
#2

i forgot

pawn Код:
new WeaponCheck[MAX_PLAYERS];


CMD:god(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
      new string[128],adminname[MAX_PLAYER_NAME];
      GetPlayerName(playerid,adminname,sizeof(adminname));
      if(PlayerInfo[playerid][pGod] == 0)
      {
         PlayerInfo[playerid][pGod] = 1;
         GodTimer = SetTimer("God", 100, true);
         SetPlayerHealth(playerid,100000);
         SetPlayerArmour(playerid,100000);
         GivePlayerWeapon(playerid,16,50000);
         GivePlayerWeapon(playerid,8,1);
         GivePlayerWeapon(playerid,28,50000);
         GivePlayerWeapon(playerid,34,50000);
         GivePlayerWeapon(playerid,22,50000);
         WeaponCheck[playerid] = 1;
         PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
         GODMODE[playerid] = Create3DTextLabel("God Mode On",COLOR_GREEN, 30.0, 40.0, 50.0, 40.0, 0);
         Attach3DTextLabelToPlayer(GODMODE[playerid], playerid, 0.0, 0.0, 0.6);
         format(string,sizeof(string),"Administrator %s (ID: %d) has turn "green"on "red"his/her god mode",adminname,playerid);
         SendClientMessageToAll(COLOR_RED, string);
         SendClientMessage(playerid,COLOR_GREEN,"| - God Mode On - |");
      }
      else
      {
         PlayerInfo[playerid][pGod] = 0;
         KillTimer(GodTimer);
         Delete3DTextLabel(GODMODE[playerid]);
         format(string,sizeof(string),"Administrator %s (ID: %d) has turn off his/her god mode",adminname,playerid);
         SendClientMessageToAll(COLOR_RED, string);
         SendClientMessage(playerid,COLOR_RED,"| - God Mode Off - |");
         SetPlayerHealth(playerid, 100.0);
         SetPlayerArmour(playerid, 100.0);
         PlayerPlaySound(playerid,1085,0.0,0.0,0.0);
      }
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be Administrator Level 1 to use this command");
    return 1;
}
Reply
#3

pawn Код:
stock GetPlayerHackWeapon(playerid)
{
    switch(GetPlayerWeapon(playerid))
    {
        case 1..46: return true;
    }
    return false; //Not returning anything here would cause that error
}
Reply
#4

Dude it works but i have problem when i turn to /god i get ban actually the /god is from my admin system and onplayerupdate is from my gamemode my admin system and gamemode are not attach each other
Reply
#5

now when i replace my onplayerupdate on my admin system when i use /god it doesn't ban me, but when i use ****** (just test for only) it doesn't banned me either
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)