SA-MP Forums Archive
ajail command problem - 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: ajail command problem (/showthread.php?tid=647821)



ajail command problem - BugsBunny - 11.01.2018

I don't know why but my command don't stamp the SendClientMessageToAll, i don't see any problem (i tried to print with printf and it works on terminal but not in game)

pawn Код:
CMD:ajail(playerid, params[])
{
    new target, time, string[500], reason[500];

    if(pInfo[playerid][Admin] < 1) return SendClientMessage(playerid, -1, ""RED"[!] "WHITE"Non sei autorizzato ad utilizzare questo comando.");
    if(sscanf(params, "uds[500]", target, time, reason)) return SendClientMessage(playerid, -1, ""LBLUE"[!] "WHITE"Uso: "LBLUE"/ajail "WHITE"[ID/Nome] [minuti] [motivo]");
    if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, ""RED"[!] "WHITE"Questo giocatore non e' online.");

    format(string, sizeof(string), ""GREEN"[!] "YELLOW"%s "WHITE"e' stato jailato da "LBLUE"%s "YELLOW"%s "WHITE"per "LBLUE"%d "WHITE"minuti. "RED"Motivo"WHITE": %s", GetName(target), AdminLevel(playerid), GetName(playerid), time, reason);
    SendClientMessageToAll(-1, string);

    SetPlayerPos(target, 2525.1736, -1673.8074, 14.8601);
    SetPlayerVirtualWorld(target, 0);
    SetPlayerHealth(target, 5000.0);
    ResetPlayerWeapons(playerid);

    Jailed[target] = 1;
    InJailTime[target] = time*60;
    return 1;
}



Re: ajail command problem - Beckett - 11.01.2018

Your message line is too long, remove the colors and it will work. You have too many of them.

Quote:

If a message is longer than 144 characters, it will not be sent. Truncation can be used to prevent this. Displaying a message on multiple lines will also solve this issue.