SA-MP Forums Archive
[HELP] Bug In Command - 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: [HELP] Bug In Command (/showthread.php?tid=361339)



[HELP] Bug In Command - Anters14 - 20.07.2012

Okay So I Have This Command For LEO's In My Server. But If They Don't Enter An ID When Typing The Command Everyone Else In The Server Gets The Message :S. For Example /rights [1] Would Send The Message To ID 1 but If They Type /rights Then Click Enter Everyone In The Server But Them Gets It.

Here's The Command;
pawn Код:
CMD:rights(playerid, params[])
{
    new id = strval(params);
    if(IsACop(playerid))
    if(!IsPlayerConnected(id))SendClientMessage(playerid, 0xFF0000FF, "Invalid Player ID");
    else
    {
        SendClientMessage(id, COLOR_RED, "You Have The Right To Remain Silent.");
        SendClientMessage(id, COLOR_RED, "Anything You Say Can Be Used Against You In a Court Of Law.");
        SendClientMessage(id, COLOR_RED, "You Have The Right To An Attorney Present Now And During Any Further Questioning");
        SendClientMessage(id, COLOR_RED, "If You Can Not Afford An Attorney, One Will Be Appointed To You Free Of Charge If You Wish");
        SendClientMessage(id, COLOR_RED, "Do You Understand Your Rights As They Have Been Read To You?((Say Yes Or No To The Officer))");
    }
    return 1;
}



Re: [HELP] Bug In Command - L.Hudson - 20.07.2012

try this

pawn Код:
CMD:rights(playerid, params[])
{
    new id;
    if(IsACop(playerid))
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "Usage: /rights [id]");
    else
    {
        SendClientMessage(id, COLOR_RED, "You Have The Right To Remain Silent.");
        SendClientMessage(id, COLOR_RED, "Anything You Say Can Be Used Against You In a Court Of Law.");
        SendClientMessage(id, COLOR_RED, "You Have The Right To An Attorney Present Now And During Any Further Questioning");
        SendClientMessage(id, COLOR_RED, "If You Can Not Afford An Attorney, One Will Be Appointed To You Free Of Charge If You Wish");
        SendClientMessage(id, COLOR_RED, "Do You Understand Your Rights As They Have Been Read To You?((Say Yes Or No To The Officer))");
    }
    return 1;
}



Re: [HELP] Bug In Command - Rudy_ - 20.07.2012

use
pawn Код:
if(isnull(params)) return SendClientMessage(playerid,-1,"Usage /Rights [id]");
Edit: Late -.-


Re: [HELP] Bug In Command - L.Hudson - 20.07.2012

Yeah I was always hating the 120 seconds wait too