What did i do wrong
#1

PHP код:
public OnRconLoginAttempt(ip[], password[], success)
{
 if(!
success)
 {
   
printf("Failed rcon by IP %s used password %s"ip,password);
   new 
pip[16]
   new 
pname[+1MAX_PLAYER_PLAYER], string[+256MAX_PLAYER_NAME];//<<<|This line
   
GetPlayerName(playerid,name,sizeof(name));
   
format(string,sizeof(string), "{FF0000}[SERVER]{FFFFFF}: {FF0000}%s Has been banned for rcon login attempt",pname");
   SendClientMessageToAll(0xFFFFFFF, string);
   for(new i=0; i<MAX_PLAYERS; i++)
   {
        GetPlayerIp(i, pip,sizeof(pip));
        if(!strcmp(ip,pip, true))
        {
        ShowPlayerDialog(playerid, 431, DIALOG_STYLE_MSGBOX, "
Banned", "You have been banned for rcon login attempt\r\nIf you wanna be unbanned make a ban appeal at www.lscnr-samp.tk");
        Ban(i);
        }
       }
    }
    return 1;

Код:
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(624) : error 001: expected token: ";", but found "new"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(624) : error 029: invalid expression, assumed zero
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(624) : error 029: invalid expression, assumed zero
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(624) : fatal error 107: too many error messages on one line

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


4 Errors.
Reply
#2

pawn Код:
new pname[MAX_PLAYER_PLAYER], string[MAX_PLAYER_NAME];
Max player name is enough for getting the max name, No need to add +1 or anything else
Reply
#3

PHP код:
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(624) : error 001expected token";"but found "new"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(624) : error 017undefined symbol "MAX_PLAYER_PLAYER"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(624) : error 029invalid expressionassumed zero
C
:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(624) : fatal error 107too many error messages on one line

Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


4 Errors

Reply
#4

Copy much? Don't copy something, Atleast copy all what a script needs

pawn Код:
#define MAX_PLAYER_NAME 24
Reply
#5

PHP код:
C:\Users\yan\Desktop\Cops And Robbers\pawno\include\a_samp.inc(29) : warning 201redefinition of constant/macro (symbol "MAX_PLAYER_NAME")
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(625) : error 001expected token";"but found "new"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(625) : error 017undefined symbol "MAX_PLAYER_PLAYER"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(625) : error 029invalid expressionassumed zero
C
:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(625) : fatal error 107too many error messages on one line

Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


4 Errors

lol.
Reply
#6

pawn Код:
stock GetName(playerid);
{
    new szName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, szName, sizeof(szName));
    return szName;
}
Anywhere, Not in a callback

and replace this with ur code
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
 if(!success)
 {
   printf("Failed rcon by IP %s used password %s", ip,password);
   new pip[16]
   new pname[24], string[128];//<<<|This line
   format(string,sizeof(string), "{FF0000}[SERVER]{FFFFFF}: {FF0000}%s Has been banned for rcon login attempt",GetName(pname));
   SendClientMessageToAll(0xFFFFFFF, string);
   for(new i=0; i<MAX_PLAYERS; i++)
   {
        GetPlayerIp(i, pip,sizeof(pip));
        if(!strcmp(ip,pip, true))
        {
        ShowPlayerDialog(playerid, 431, DIALOG_STYLE_MSGBOX, "Banned", "You have been banned for rcon login attempt\r\nIf you wanna be unbanned make a ban appeal at www.lscnr-samp.tk");
        Ban(i);
        }
       }
    }
    return 1;
}
Edit: I've edited the code
Reply
#7

PHP код:
C:\Users\yan\Desktop\Cops And Robbers\pawno\include\a_samp.inc(29) : warning 201redefinition of constant/macro (symbol "MAX_PLAYER_NAME")
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(625) : error 001expected token";"but found "new"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(626) : error 004: function "GetName" is not implemented
C
:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(626) : warning 215expression has no effect
C
:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(626) : error 001expected token";"but found ")"
C:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(626) : error 029invalid expressionassumed zero
C
:\Users\yan\Desktop\Cops And Robbers\gamemodes\LSCNR.pwn(626) : fatal error 107too many error messages on one line

Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase


5 Errors

Reply
#8

Quote:

C:\Users\yan\Desktop\Cops And Robbers\pawno\include\a_samp.inc(29) : warning 201: redefinition of constant/macro (symbol "MAX_PLAYER_NAME")

Gointo your a_samp.inc and remove "MAX_PLAYER_NAME"

or just do this

/*
code.
....
.
.
.
.
.
..
return 1;
}*/
Reply
#9

Didn't work.

Anyone else?
Reply
#10

Change this

new pip[16]

To this

new pip[16];

Just a missing semicolon
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)