Anti Weapon hack
#1

Hello,When I compiling I am getting erros.

my anti weapon script:
Code:
// On the top
new minigun[MAX_PLAYERS];
forward WeaponCheck( );

// Then in weapon check
public WeaponCheck( )
{
   for(new i=0; i<MAX_PLAYERS; i++){
     if(GetPlayerWeapon(i) == 38 && minigun[playerid]=0)
     {
       new pname[200];
       new string[200];
       GetPlayerName(i, pname, sizeof(pname));
       format(string, sizeof(string), "-Server- %s has been banned from this server(Reason: Minigun hack)", pname);
       SendClientMessageToAll(COLOR_RED,string);
       Ban(i);
     }
   }
}
// Then if player gets some where minigun in script I additing "minigun[playerid]=1" .
And I am getting these errors:
Code:
C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(780) : error 017: undefined symbol "playerid"
C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(780) : warning 215: expression has no effect
C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(780) : error 001: expected token: ";", but found ")"
C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(780) : error 029: invalid expression, assumed zero
C:\Users\bendra\Desktop\Samp Serveriai\Serv\gamemodes\LSTW2v2.pwn(780) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Any help?
Reply
#2

minigun[i]==0
Reply
#3

pawn Code:
#include <a_samp>

public WeaponCheck() {
    for(new i = 0; i < MAX_PLAYERS; i++) { // Neater loop
        if(GetPlayerWeapon(i) == 38 && minigun[playerid] == 0) { // You need to use two equal operators.
            new
                pname[MAX_PLAYER_NAME], // You only need ~24 cells!
                string[91]; // You only need ~91 cells!

            GetPlayerName(i, pname, sizeof(pname)); // Get the name
            format(string, sizeof(string), "-Server- %s has been banned from this server (Reason: Minigun hack)", pname); // Format the string
            SendClientMessageToAll(COLOR_RED,string); // Message everyone
            Ban(i); // Ban that player
        }
    }
   
    return 1;
}
EDIT: Beaten to it by dice7.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)