SQLite Errors
#1

fixed
Reply
#2

Try this:
pawn Код:
public OnPlayerConnect(playerid)
{
    new
        Query[ 1300 ],
        Queryban[1300],
        DBResult: rBan,
        DBResult: Result,
        banname[MAX_PLAYER_NAME],
        name[ MAX_PLAYER_NAME ]
    ;
    GetPlayerName(playerid, name, sizeof(name));

    Bit1_Set(g_PlayerLogged, playerid, false);
    format(Queryban, sizeof(Queryban), "SELECT `BENNED` FROM `USERS` WHERE `BANNED` = '%d'", DB_Escape(banname));
    rBan = db_query(Database, Queryban);
   
    if(Bit1_Get(g_PlayerBanned, playerid)) return Ban(playerid);

    format(Query, sizeof(Query), "SELECT `NAME` FROM `USERS` WHERE `NAME` = '%s'", DB_Escape(name));
   
    Result = db_query(Database, Query);

    if(db_num_rows(Result))
    {

        format(Query, sizeof(Query), "{FFFFFF}Welcome %s(%d){FFFFFF} to the server, you're registered\n\nPlease log in by typing your password.", name, playerid);

        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_PASSWORD, "{FFFFFF}Server", Query, "Login", "Leave");
    }
    else
    {
       
        format(Query, sizeof(Query), "{FFFFFF}Welcome %s(%d){FFFFFF} to the server, you're not{FFFFFF} registered\n\nPlease log in by typing your password.", name, playerid);
   
        ShowPlayerDialog(playerid, 0, DIALOG_STYLE_PASSWORD, "{FFFFFF}Server", Query, "Register", "Leave");
    }
    db_free_result(Result);

    return 1;
}
Reply
#3

When i try to use that i get errors in sscanf.
that is on line 120..heres the code
pawn Код:
CMD:ban(playerid, paramsp[])
{
    new id,reason[128],name[MAX_PLAYER_NAME];
    if(Bit16_Get(g_AdminLevel, playerid) > 1)
    {
        if(sscanf(params, "us[128]", id, reason); return SCM(playerid, COL_RED, "Usage: /ban <Playerid/Part of Name> <Reason>");
        else
        {
            if(IsPlayerConnected(id))
            {
                new string;
                format(string, sizeof(string), "%s has been banned from the server", GetPlayerName(id, name, sizeof(name)));
                SendClientMessageToAll(COL_RED, string);
                Bit1_Set(g_PlayerBanned, id, 1);
                Kick(id);
            }
            else
            {
                Bit1_Set(g_PlayerBanned, id, 1);
            }
        }
    }
    else
    {
        SCM(playerid, COL_RED, "You need to be an admin to use this command!");
    }
    return 1;
}
errors
Код:
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(58) : warning 204: symbol is assigned a value that is never used: "rBan"
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(120) : error 017: undefined symbol "params"
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(120) : error 001: expected token: ")", but found ";"
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(120) : error 036: empty statement
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(120) : fatal error 107: too many error messages on one line

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


4 Errors.
Line 120
pawn Код:
if(sscanf(params, "us[128]", id, reason); return SCM(playerid, COL_RED, "Usage: /ban <Playerid/Part of Name> <Reason>");
Reply
#4

You had a ; :
pawn Код:
CMD:ban(playerid, paramsp[])
{
    new id,reason[128],name[MAX_PLAYER_NAME];
    if(Bit16_Get(g_AdminLevel, playerid) > 1)
    {
        if(sscanf(params, "us", id, reason) return SCM(playerid, COL_RED, "Usage: /ban <Playerid/Part of Name> <Reason>");

        if(IsPlayerConnected(id))
        {
            new string;
            format(string, sizeof(string), "%s has been banned from the server", GetPlayerName(id, name, sizeof(name)));
            SendClientMessageToAll(COL_RED, string);
            Bit1_Set(g_PlayerBanned, id, 1);
            Kick(id);
        }
        else
        {
            Bit1_Set(g_PlayerBanned, id, 1);
        }
    }
    else SCM(playerid, COL_RED, "You need to be an admin to use this command!");
    return 1;
}
Reply
#5

fixed
Reply
#6

I have fixed the error with pasting the sscanf stock
Reply
#7

heres my whole script..please fix it..
http://pastebin.com/390UYw8t
Reply
#8

Change this:
pawn Код:
CMD:ban(playerid, paramsp[])
To this:
pawn Код:
CMD:ban(playerid, params[])
Reply
#9

now i have these errors...i error is fixed
Код:
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(58) : warning 204: symbol is assigned a value that is never used: "rBan"
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(120) : error 001: expected token: ")", but found "return"
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(125) : error 035: argument type mismatch (argument 1)
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(125) : error 035: argument type mismatch (argument 1)
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(126) : error 035: argument type mismatch (argument 2)
I:\All\Desktop Folders\My Things\Servers\Team Deathmatch\gamemodes\TDM.pwn(124) : warning 203: symbol is never used: "string"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#10

help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)