Help, anyone ?
#1

Sloved
Reply
#2

You dont need ";" for switch..
Reply
#3

When i remove it it show that...
Код:
Server\gamemodes\zma.pwn(518) : warning 219: local variable "Admin" shadows a variable at a preceding level
Server\gamemodes\zma.pwn(519) : warning 219: local variable "reason3" shadows a variable at a preceding level
Server\gamemodes\zma.pwn(520) : error 035: argument type mismatch (argument 2)
Server\gamemodes\zma.pwn(527) : warning 219: local variable "Admin" shadows a variable at a preceding level
Server\gamemodes\zma.pwn(528) : warning 219: local variable "reason3" shadows a variable at a preceding level
Server\gamemodes\zma.pwn(529) : error 035: argument type mismatch (argument 2)
Server\gamemodes\zma.pwn(1140) : warning 219: local variable "Admin" shadows a variable at a preceding level
Server\gamemodes\zma.pwn(1141) : warning 219: local variable "reason3" shadows a variable at a preceding level
Server\gamemodes\zma.pwn(1142) : error 035: argument type mismatch (argument 2)
Server\gamemodes\zma.pwn(1209) : error 001: expected token: "-string end-", but found "-identifier-"
Server\gamemodes\zma.pwn(1209) : warning 215: expression has no effect
Server\gamemodes\zma.pwn(1209) : error 001: expected token: ";", but found ")"
Server\gamemodes\zma.pwn(1209) : error 029: invalid expression, assumed zero
Server\gamemodes\zma.pwn(1209) : fatal error 107: too many error messages on one line
Reply
#4

Well you have some errors and warnings.. for example the frist one means that you have aleady a variabile named Admin defined as global or in another script so check the code in line 518 and try maybe change your var to another name.

Then navigate so other error lines and see if there are some typo errors or maybe you don't add a param to a function.
Reply
#5

Lines from 508 to 573
PHP код:
function OnServerUpdate()
{
    foreach(
Playeri)
    {
           if(
GetPlayerMoney(i) >= 1) return ResetPlayerMoney(i);
        
SetPlayerScore(i,pInfo[i][pXP]);
        
UpdateXPTextdraw(i);
        if(
GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK)
        {
            new 
Admin[24] = "Anti-cheat";
            new 
reason3[128] = "Jetpack";
            
BanPlayer(i,reason3,Admin);
        }
        new 
Float:armor;
        
GetPlayerArmour(i,armor);
        if(
armor >= 96)
        {
            new 
Admin[24] = "Anti-cheat";
            new 
reason3[128] = "Armour Hack (Exceeded over 96f)";
            
BanPlayer(i,reason3,Admin);
        }
        if(
team[i] == TEAM_ZOMBIE)
        {
             switch(
GetPlayerWeapon(i))
            {
                case 
2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,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:
                {
                    
ResetPlayerWeapons(i);
                    
GivePlayerWeapon(i,9,1);
                }
            }
          }
        if(
team[i] == TEAM_ZOMBIE)
        {
            if(
armor 0.0)
            {
                
SetPlayerArmour(i,0.0);
            }
        }
        if(
IsPlayerInAnyVehicle(i))
        {
            if(
pInfo[i][pAdminLevel] == 0)
            {
                
Kick(i);
            }
        }
        if(
pInfo[i][pVipFlash] == 1)
          {
            switch(
random(2))
               {
                case 
0SetPlayerColor(i,COLOR_YELLOW);
                case 
1SetPlayerColor(i,COLOR_RED);
            }
        }
        
DoctorShield();
        
UpdateAliveInfo();
    }
    return 
1;

And this from 1136 to 1144
PHP код:
if(killerid != INVALID_PLAYER_ID)
    {
        if(!
PlayerShotPlayer[killerid][playerid])
        {
            new 
Admin[24] = "Anti-cheat";
            new 
reason3[128] = "Fake Killing";
            
BanPlayer(playerid,reason3,Admin);
        }
    } 
Can you help me ?
Reply
#6

Well i can't know where errors are if you post me the whole code from a line to a line.. i will get from line 1..

anyway try this.. and explain me why you are defining a variabile like this

pawn Код:
new Something[2] = "Hi";
Function(Something);
instead of
pawn Код:
Function("Hi");
pawn Код:
function OnServerUpdate()
{
    foreach(Player, i)
    {
        if(GetPlayerMoney(i) >= 1) return ResetPlayerMoney(i);
        SetPlayerScore(i,pInfo[i][pXP]);
        UpdateXPTextdraw(i);

        if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK)
        {
            BanPlayer(i,"Jetpack","Anti-cheat");
        }
        new Float:armor;
        GetPlayerArmour(i,armor);
        if(armor >= 96)
        {
            BanPlayer(i,"Armour Hack (Exceeded over 96f)","Anti-cheat");
        }
        if(team[i] == TEAM_ZOMBIE)
        {
            switch(GetPlayerWeapon(i))
            {
                case 2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,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:
                {
                    ResetPlayerWeapons(i);
                    GivePlayerWeapon(i,9,1);
                }
            }
        }

        if(team[i] == TEAM_ZOMBIE)
        {
            if(armor > 0.0)
            {
                SetPlayerArmour(i,0.0);
            }
        }

        if(IsPlayerInAnyVehicle(i))
        {
            if(pInfo[i][pAdminLevel] == 0)
            {
                Kick(i);
            }
        }

        if(pInfo[i][pVipFlash] == 1)
        {
            switch(random(2))
            {
                case 0: SetPlayerColor(i,COLOR_YELLOW);
                case 1: SetPlayerColor(i,COLOR_RED);
            }
        }
        DoctorShield();
        UpdateAliveInfo();
    }
    return 1;
}

pawn Код:
if(killerid != INVALID_PLAYER_ID)
{
    if(!PlayerShotPlayer[killerid][playerid])
    {
        BanPlayer(playerid,"Fake Killing","Anti-cheat");
    }
}
Reply
#7

Hmmm, its not my script i am editing it to fit my server...

and btw. When i used your codes i got more errors/warnnings...
Код:
Server\gamemodes\zma.pwn(518) : warning 202: number of arguments does not match definition
Server\gamemodes\zma.pwn(518) : warning 202: number of arguments does not match definition
Server\gamemodes\zma.pwn(524) : warning 202: number of arguments does not match definition
Server\gamemodes\zma.pwn(524) : warning 202: number of arguments does not match definition
Server\gamemodes\zma.pwn(1133) : warning 202: number of arguments does not match definition
Server\gamemodes\zma.pwn(1133) : warning 202: number of arguments does not match definition
Server\gamemodes\zma.pwn(1200) : error 001: expected token: "-string end-", but found "-identifier-"
Server\gamemodes\zma.pwn(1200) : warning 215: expression has no effect
Server\gamemodes\zma.pwn(1200) : error 001: expected token: ";", but found ")"
Server\gamemodes\zma.pwn(1200) : error 029: invalid expression, assumed zero
Server\gamemodes\zma.pwn(1200) : fatal error 107: too many error messages on one line
Reply
#8

Here you go, I also indent your code, because the indentation wasn't that good, also make sure on your BanPlayer stock or callback you have something like this

pawn Код:
//If stock
stock BanPlayer(playerid, reason[], adminame[])
//if callback
forward BanPlayer(playerid, reason[], adminame[]);
public BanPlayer(playerid, reason[], adminame[])
Lines from 508 to 573
pawn Код:
function OnServerUpdate()
{

    new Float:armor, GetPlayerArmour(i, armor);

    foreach(Player, i)
    {
        if(GetPlayerMoney(i) >= 1)
            return ResetPlayerMoney(i);

        SetPlayerScore( i, pInfo[i][pXP] );
        UpdateXPTextdraw( i );

        if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK)
            return BanPlayer(i, "Jetpack Hack", "Anti-Cheat");

        if(armor >= 96)
            return BanPlayer(i, "Armour Hack", "Anti-Cheat");
       
        if(team[i] == TEAM_ZOMBIE && armor > 0.0))
            return SetPlayerArmour(i, 0.0);


        if(IsPlayerInAnyVehicle(i) && pInfo[i][pAdminLevel] == 0))
            return Kick(i);

        if(team[i] == TEAM_ZOMBIE)
        {
            switch(GetPlayerWeapon(i))
            {
                case 2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,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:
                {
                    ResetPlayerWeapons(i);
                    GivePlayerWeapon(i, 9, 1);
                }
            }
        }

        if(pInfo[i][pVipFlash] == 1)
        {
            switch(random(2))
            {
                case 0: SetPlayerColor(i,COLOR_YELLOW);
                case 1: SetPlayerColor(i,COLOR_RED);
            }
        }
        DoctorShield();
        UpdateAliveInfo();
    }
    return 1;
}
Lines from 1136 to 1144
pawn Код:
if(killerid != INVALID_PLAYER_ID)
{
    if(!PlayerShotPlayer[killerid][playerid])
        return BanPlayer(playerid, "Fake Killng", "Anti-Cheat");
}
Reply
#9

My BanPlayer stock is
PHP код:
stock BanPlayer(playerid,reason[],admin[])
{
    new 
str[128];
    
BanEx(playerid,reason);
    
format(str,sizeof(str),"You have been currently banned from this server.\nUser: %s\nReason: %s\nAdmin %s\n",PlayerName(playerid),reason,admin);
    
ShowPlayerDialog(playerid,DIALOG_BANNED,DIALOG_STYLE_MSGBOX,"You have been banned!",str,"Leave","");
    return 
1;

I still didn't tried your code but now will do...
Reply
#10

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Here you go, I also indent your code, because the indentation wasn't that good, also make sure on your BanPlayer stock or callback you have something like this

pawn Код:
//If stock
stock BanPlayer(playerid, reason[], adminame[])
//if callback
forward BanPlayer(playerid, reason[], adminame[]);
public BanPlayer(playerid, reason[], adminame[])
Lines from 508 to 573
pawn Код:
function OnServerUpdate()
{

    new Float:armor, GetPlayerArmour(i, armor);

    foreach(Player, i)
    {
        if(GetPlayerMoney(i) >= 1)
            return ResetPlayerMoney(i);

        SetPlayerScore( i, pInfo[i][pXP] );
        UpdateXPTextdraw( i );

        if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK)
            return BanPlayer(i, "Jetpack Hack", "Anti-Cheat");

        if(armor >= 96)
            return BanPlayer(i, "Armour Hack", "Anti-Cheat");
       
        if(team[i] == TEAM_ZOMBIE && armor > 0.0))
            return SetPlayerArmour(i, 0.0);


        if(IsPlayerInAnyVehicle(i) && pInfo[i][pAdminLevel] == 0))
            return Kick(i);

        if(team[i] == TEAM_ZOMBIE)
        {
            switch(GetPlayerWeapon(i))
            {
                case 2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,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:
                {
                    ResetPlayerWeapons(i);
                    GivePlayerWeapon(i, 9, 1);
                }
            }
        }

        if(pInfo[i][pVipFlash] == 1)
        {
            switch(random(2))
            {
                case 0: SetPlayerColor(i,COLOR_YELLOW);
                case 1: SetPlayerColor(i,COLOR_RED);
            }
        }
        DoctorShield();
        UpdateAliveInfo();
    }
    return 1;
}
Lines from 1136 to 1144
pawn Код:
if(killerid != INVALID_PLAYER_ID)
{
    if(!PlayerShotPlayer[killerid][playerid])
        return BanPlayer(playerid, "Fake Killng", "Anti-Cheat");
}
Oh thank you works fine now
+rep to you all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)