SA-MP Forums Archive
What is wrong? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What is wrong? (/showthread.php?tid=363167)



What is wrong? - MZ5 - 26.07.2012

Hey,

I'm trying to add this part to a /report command. But I'm having problems. Am I'm using the right code?

pawn Код:
if(strcmp(params, "Ammu", false, -1) || strcmp(params, "LSPD", false, -1) || strcmp(params, "Bank", false, -1))
    {
        SendClientMessageEx(playerid, COLOR_RED, "Administrators are not a taxi service.");
        return 1;
    }
Thanks,

Mike.


Re: What is wrong? - Jeffry - 26.07.2012

pawn Код:
if(!strcmp(params, "Ammu", false) || !strcmp(params, "LSPD", false) || !strcmp(params, "Bank", false))
    {
        SendClientMessageEx(playerid, COLOR_RED, "Administrators are not a taxi service.");
        return 1;
    }
Does this do what you want to achieve?


Re: What is wrong? - MZ5 - 26.07.2012

Nope, I can still /report.


Re: What is wrong? - Jeffry - 26.07.2012

Can you give me the complete /report command, and then explain me, when you do not want it to be used.


Re: What is wrong? - MZ5 - 26.07.2012

Sorry for such late response.

pawn Код:
CMD:report(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdmin] < 1338)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You can't submit reports as an administrator.");
        return 1;
    }
    if(PlayerInfo[playerid][pRMuted] != 0)
    {
        ShowPlayerDialog(playerid,7955,DIALOG_STYLE_MSGBOX,"Report blocked","You are blocked from submitting any reports!\n\nTips when reporting:\n- Report what you need, not who you need.\n- Be specific, report exactly what you need.\n- Do not make false reports.\n- Do not flame admins.\n- Report only for in-game items.\n- For shop orders use the /onlineshop command","Close", "");
        return 1;
    }
    if(JustReported[playerid] > 0)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "Wait 25 seconds before sending another report!");
        return 1;
    }
   
    if(strcmp(params, "ammu", false, strlen(params)) || strcmp(params, "lspd", false, strlen(params)) || strcmp(params, "sfpd", false, strlen(params)) || strcmp(params, "sasd", false, strlen(params)) || strcmp(params, "noose", false, strlen(params)) || strcmp(params, "bank", false, strlen(params)) || strcmp(params, "cityhall", false, strlen(params)) || strcmp(params, "tp", false, strlen(params)))
    {
        SendClientMessageEx(playerid, COLOR_RED, "Administrators are not a taxi service.");
        new szMessage[238];
        format(szMessage, sizeof(szMessage), "%s: %s", GetPlayerNameEx(playerid), params);
        Log("logs/FailedReport.log", szMessage);
        return 1;
    }

    if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /report [text]");

    JustReported[playerid]=25;
    SendReportToQue(playerid, params);
    SendClientMessageEx(playerid, COLOR_YELLOW, "Your report message was sent to the Admins On Duty, please wait patiently!");
    return 1;
}



Re: What is wrong? - Jeffry - 26.07.2012

pawn Код:
CMD:report(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdmin] < 1338)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "You can't submit reports as an administrator.");
        return 1;
    }
    if(PlayerInfo[playerid][pRMuted] != 0)
    {
        ShowPlayerDialog(playerid,7955,DIALOG_STYLE_MSGBOX,"Report blocked","You are blocked from submitting any reports!\n\nTips when reporting:\n- Report what you need, not who you need.\n- Be specific, report exactly what you need.\n- Do not make false reports.\n- Do not flame admins.\n- Report only for in-game items.\n- For shop orders use the /onlineshop command","Close", "");
        return 1;
    }
    if(JustReported[playerid] > 0)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "Wait 25 seconds before sending another report!");
        return 1;
    }
    if(isnull(params)) return SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /report [text]");
    if(!strcmp(params, "ammu", true) || !strcmp(params, "lspd", true) || !strcmp(params, "sfpd", true) || !strcmp(params, "sasd", true) || !strcmp(params, "noose", true) || !strcmp(params, "bank", true) || !strcmp(params, "cityhall", true) || !strcmp(params, "tp", true))
    {
        SendClientMessageEx(playerid, COLOR_RED, "Administrators are not a taxi service.");
        new szMessage[238];
        format(szMessage, sizeof(szMessage), "%s: %s", GetPlayerNameEx(playerid), params);
        Log("logs/FailedReport.log", szMessage);
        return 1;
    }
    JustReported[playerid]=25;
    SendReportToQue(playerid, params);
    SendClientMessageEx(playerid, COLOR_YELLOW, "Your report message was sent to the Admins On Duty, please wait patiently!");
    return 1;
}



Re: What is wrong? - MZ5 - 26.07.2012

Thanks very much, if I could rep you I would, so you're going to have to accept my verbal reputation<3


Re: What is wrong? - Jeffry - 27.07.2012

Quote:
Originally Posted by MZ5
Посмотреть сообщение
Thanks very much, if I could rep you I would, so you're going to have to accept my verbal reputation<3
That's totally fine. Glad I could help.