#1

pawn Код:
CMD:glogin(playerid,params[])
{
    if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: You are already logged in.");
    if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Account doesn't exist, please use '/gregister [password]'.");
    if (strlen(params)==0) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Correct usage: '/glogin [password]'")
    if  (udb_CheckLogin(PlayerName2(playerid),params))
{
        new file[256], tmp3[100], string[128], lname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,lname,sizeof(lname));
        format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(lname));
        GetPlayerIp(playerid,tmp3,100);
        dini_Set(file,"ip",tmp3);
        LoginPlayer(playerid);
        LoadPlayer(playerid);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        if(PlayerInfo[playerid][Level] > 0) {
            format(string,sizeof(string),"ACCOUNT: Successfully Logged In. (Level %d)", PlayerInfo[playerid][Level] );
            return SendClientMessage(playerid,green,string);
        } else return SendClientMessage(playerid,green,"ACCOUNT: Successfully Logged In");
    }
    return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Login failed! Incorrect Password");
}

pawn Код:
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17003) : warning 202: number of arguments does not match definition
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17083) : error 001: expected token: ";", but found "if"
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17083) : error 029: invalid expression, assumed zero
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17083) : error 001: expected token: ";", but found ")"
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17083) : fatal error 107: too many error messages on one line
Reply
#2

Fixed:

pawn Код:
CMD:glogin(playerid,params[])
{
    if (PlayerInfo[playerid][LoggedIn] == 1) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: You are already logged in.");
    if (!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Account doesn't exist, please use '/gregister [password]'.");
    if (strlen(params)==0) return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Correct usage: '/glogin [password]'");
    if  (udb_CheckLogin(PlayerName2(playerid),params))
{
        new file[256], tmp3[100], string[128], lname[MAX_PLAYER_NAME];
        GetPlayerName(playerid,lname,sizeof(lname));
        format(file,sizeof(file),"/ladmin/users/%s.sav",udb_encode(lname));
        GetPlayerIp(playerid,tmp3,100);
        dini_Set(file,"ip",tmp3);
        LoginPlayer(playerid);
        LoadPlayer(playerid);
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        if(PlayerInfo[playerid][Level] > 0) {
            format(string,sizeof(string),"ACCOUNT: Successfully Logged In. (Level %d)", PlayerInfo[playerid][Level] );
            return SendClientMessage(playerid,green,string);
        } else return SendClientMessage(playerid,green,"ACCOUNT: Successfully Logged In");
    }
    return SendClientMessage(playerid,COLOR_RED,"ACCOUNT: Login failed! Incorrect Password");
}
pawn Код:
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17083) : error 001: expected token: ";", but found "if"
I'm pretty sure that this error message speaks for itself though. You missed a ';' at the end of the third if statement.
Reply
#3

Wich Line 17083? Copy This
Reply
#4

Quote:
Originally Posted by Ramin
Посмотреть сообщение
Wich Line 17083? Copy This
pawn Код:
line is { What should I do?
Reply
#5

Just Copy 17083 In Your GameMode Not All Lines
Reply
#6

I gave you the fixed code. What's the problem now?
Reply
#7

Errors on 17082 now
pawn Код:
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17003) : warning 202: number of arguments does not match definition
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17082) : error 029: invalid expression, assumed zero
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17082) : error 001: expected token: ";", but found ")"
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17082) : error 029: invalid expression, assumed zero
C:\Users\Kimo Computer\Desktop\Theskiller\gamemodes\SX[V1].pwn(17082) : fatal error 107: too many error messages on one line
pawn Код:
if  (udb_CheckLogin(PlayerName2(playerid),params));
Reply
#8

pawn Код:
CMD:glogin(playerid, params[])
{
    if(PlayerInfo[playerid][LoggedIn]) return SendClientMessage(playerid, COLOR_RED, "ACCOUNT: You are already logged in.");
    if(!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid, COLOR_RED, "ACCOUNT: Account doesn't exist, please use '/gregister [password]'.");
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "ACCOUNT: Correct usage: '/glogin [password]'");
    if(!udb_CheckLogin(PlayerName2(playerid), params)) return SendClientMessage(playerid, COLOR_RED, "ACCOUNT: Login failed! Incorrect Password");
    new lname[MAX_PLAYER_NAME], file[50], tmp3[16];
    GetPlayerName(playerid, lname, sizeof(lname));
    format(file, sizeof(file), "/ladmin/users/%s.sav", udb_encode(lname));
    GetPlayerIp(playerid, tmp3, sizeof(tmp3));
    dini_Set(file, "ip", tmp3);
    LoginPlayer(playerid);
    LoadPlayer(playerid);
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
    if(PlayerInfo[playerid][Level]) format(file, sizeof(file), "ACCOUNT: Successfully Logged In. (Level %d)", PlayerInfo[playerid][Level]);
    SendClientMessage(playerid, green, (PlayerInfo[playerid][Level]) ? (file) : ("ACCOUNT: Successfully Logged In"));
    return 1;
}
Reply
#9

You In Your GameMode Used if

Try It You Typed if (udb_CheckLogin(PlayerName2(playerid),params));
Compile It if (udb_CheckLogin(PlayerName2(playerid),params))
Reply
#10

Quote:
Originally Posted by Threshold
Посмотреть сообщение
pawn Код:
CMD:glogin(playerid, params[])
{
    if(PlayerInfo[playerid][LoggedIn]) return SendClientMessage(playerid, COLOR_RED, "ACCOUNT: You are already logged in.");
    if(!udb_Exists(PlayerName2(playerid))) return SendClientMessage(playerid, COLOR_RED, "ACCOUNT: Account doesn't exist, please use '/gregister [password]'.");
    if(!strlen(params)) return SendClientMessage(playerid, COLOR_RED, "ACCOUNT: Correct usage: '/glogin [password]'");
    if(!udb_CheckLogin(PlayerName2(playerid), params)) return SendClientMessage(playerid, COLOR_RED, "ACCOUNT: Login failed! Incorrect Password");
    new lname[MAX_PLAYER_NAME], file[50], tmp3[16];
    GetPlayerName(playerid, lname, sizeof(lname));
    format(file, sizeof(file), "/ladmin/users/%s.sav", udb_encode(lname));
    GetPlayerIp(playerid, tmp3, sizeof(tmp3));
    dini_Set(file, "ip", tmp3);
    LoginPlayer(playerid);
    LoadPlayer(playerid);
    PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
    if(PlayerInfo[playerid][Level]) format(file, sizeof(file), "ACCOUNT: Successfully Logged In. (Level %d)", PlayerInfo[playerid][Level]);
    SendClientMessage(playerid, green, (PlayerInfo[playerid][Level]) ? (file) : ("ACCOUNT: Successfully Logged In"));
    return 1;
}
No Changes it same error
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)