Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×

Question

Posted

Salut, am aceste probleme.

C:\Wing RPG\gamemodes\Wing.pwn(3208) : error 028: invalid subscript (not an array or too many subscripts): "inputtext"
C:\Wing RPG\gamemodes\Wing.pwn(3208) : warning 215: expression has no effect
C:\Wing RPG\gamemodes\Wing.pwn(3208) : error 001: expected token: ";", but found "]"
C:\Wing RPG\gamemodes\Wing.pwn(3208) : error 029: invalid expression, assumed zero
C:\Wing RPG\gamemodes\Wing.pwn(3208) : fatal error 107: too many error messages on one line

if(isnull(inputtext)) return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:", "Select", "Close");

+

C:\Wing RPG\gamemodes\Wing.pwn(3211) : error 035: argument type mismatch (argument 1)

if(sscanf(inputtext, "u", userid)) return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:", "Select", "Close");

6 answers to this question

Recommended Posts

  • 0
Posted
Dialog:DIALOG_REPORT_CHEATER(playerid, response, listitem, inputtext[]) {
    if(!response)
        return true;

    if(Iter_Count(Reports) >= MAX_REPORTS) return SCM(playerid, COLOR_LGREEN, "There are too many reports in queue. Please wait...");
    if(Iter_Contains(ServerAdmins, playerid)) return SCM(playerid, COLOR_WHITE, "YOu are an admin, you can't use this command.");
    if(!Iter_Count(ServerAdmins)) return SCM(playerid, COLOR_GREY, "There are no admins connected.");
    if(PlayerInfo[playerid][pReportMute] > gettime()) return SCMF(playerid, COLOR_LGREEN, "You need to wait %d seconds before using this command again.", (PlayerInfo[playerid][pReportMute] - gettime()));

    if(isnull(inputtext)) return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:", "Select", "Close");

    new userid = INVALID_PLAYER_ID;
    if(!IsPlayerLogged(userid)) 
        return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:\n{AFAFAF}* Jucatorul nu este conectat.", "Select", "Close");

    if(userid == playerid) 
        return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:\n{AFAFAF}* Nu poti sa iti dai singur report.", "Select", "Close");

    if(Iter_Contains(ServerAdmins, userid)) 
        return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:\n{AFAFAF}* Nu poti sa raportezi un admin.", "Select", "Close");

    new id = (Iter_Count(Reports) + 1);

    ReportInfo[id][reportID] = playerid;
    ReportInfo[id][reportPlayer] = userid;
    ReportInfo[id][reportType] = REPORT_TYPE_CHEATER;
    ReportInfo[id][reportTimer] = defer ExpirationReport(id);
    format(ReportInfo[id][reportText], 128, "%s is maybe using cheats.", GetName(userid));
    Iter_Add(Reports, id);

    SCM(playerid, COLOR_YELLOW, "Jucatorul a fost raportat cu succes catre admini! Daca se suspecteaza ca foloseste cheats, o sa fie sanctionat in cel mai scurt timp posibil!");
    SendAdmin(COLOR_DARKNICERED, "Report by %s (ID: %d, Level: %d): %s", GetName(playerid), playerid, PlayerInfo[playerid][pLevel], ReportInfo[id][reportText]);
    PlayerInfo[playerid][pReportMute] = (gettime() + 120);  

    return true;
}

Ai uitat să pui cele două paranteze pătrate in header-ul „Dialog:”.

 

P.S.: Data viitoare pune codul in code-block, te rog.

  • Upvote 1
  • 0
Posted
if(sscanf(params, "u", userid)) return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:", "Select", "Close");

 

  • 0
Posted

Dialog:DIALOG_REPORT_CHEATER(playerid, response, listitem, inputtext)
{
    if(!response) return true;

    if(Iter_Count(Reports) >= MAX_REPORTS) return SCM(playerid, COLOR_LGREEN, "There are too many reports in queue. Please wait!");

    if(Iter_Contains(ServerAdmins, playerid)) return SCM(playerid, COLOR_WHITE, "You are admin! You can't use this command.");

    if(!Iter_Count(ServerAdmins)) return SCM(playerid, COLOR_GREY, "There are no admins connected.");

    if(PlayerInfo[playerid][pReportMute] > gettime()) return SCMF(playerid, COLOR_LGREEN, "You need to wait %d seconds before using this command again.", (PlayerInfo[playerid][pReportMute] - gettime()));

    //if(isnull(inputtext)) return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:", "Select", "Close");
    
    new userid = INVALID_PLAYER_ID;
    //if(sscanf(params, "u", userid)) return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:", "Select", "Close");

    if(!IsPlayerLogged(userid)) return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:\n{AFAFAF}* Jucatorul nu este conectat.", "Select", "Close");

    if(userid == playerid) return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:\n{AFAFAF}* Nu poti sa iti dai singur report.", "Select", "Close");

    if(Iter_Contains(ServerAdmins, userid)) return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:\n{AFAFAF}* Nu poti sa raportezi un admin.", "Select", "Close");

    new id = (Iter_Count(Reports) + 1);
    
    ReportInfo[id][reportID] = playerid;
    ReportInfo[id][reportPlayer] = userid;
    ReportInfo[id][reportType] = REPORT_TYPE_CHEATER;
    ReportInfo[id][reportTimer] = defer ExpirationReport(id);
    format(ReportInfo[id][reportText], 128, "%s is maybe using cheats.", GetName(userid));
    Iter_Add(Reports, id);

    SCM(playerid, COLOR_YELLOW, "Jucatorul a fost raportat cu succes catre admini! Daca se suspecteaza ca foloseste cheats, o sa fie sanctionat in cel mai scurt timp posibil!");
    SendAdmin(COLOR_DARKNICERED, "Report by %s (ID: %d, Level: %d): %s", GetName(playerid), playerid, PlayerInfo[playerid][pLevel], ReportInfo[id][reportText]);
    PlayerInfo[playerid][pReportMute] = (gettime() + 120);        
    return true;
}

 

liniile cu // sunt cu erori

  • 0
Posted (edited)
On 3/17/2021 at 11:12 PM, Raduq said:

error 017: undefined symbol "params"

if(sscanf(inputtext, "u", userid)) return Dialog_Show(playerid, DIALOG_REPORT_CHEATER, DIALOG_STYLE_INPUT, "Report type: Cheater", "Scrie mai jos numele sau id-ul jucatorului care foloseste cheats:", "Select", "Close");
Edited by Ghost.

spacer.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.