SA-MP Forums Archive
little help REP+ - 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: little help REP+ (/showthread.php?tid=579946)



little help REP+ - JakeHunter1 - 01.07.2015

Can somone give me /me /do like this

* JakeHunter1 some action and if there isn't anyuff space for the words it continue in other line as /do ..

https://www.youtube.com/watch?v=JpdTNVp7b24 Like this ..


Re: little help REP+ - Dragony92 - 01.07.2015

Use strlen to get length of string, if string length is higher than 144 you need to cut it in smaller peaces, and at the end send message to client...


https://sampwiki.blast.hk/wiki/Strlen
https://sampwiki.blast.hk/wiki/Strmid
https://sampwiki.blast.hk/wiki/SendClientMessage


Re: little help REP+ - Youssef221 - 01.07.2015

For /do Command:

pawn Код:
CMD:do(playerid, params[]) {
    if(!isnull(params)) {
        new
            sString[128],
            pUser[MAX_PLAYER_NAME];

            GetPlayerName(playerid, pUser, MAX_PLAYER_NAME);

            format(sString, sizeof(sString), "* %s (( %s )) ", params, pUser);
            SendClientMessageToAll(COLOR_RED, sString);
        }
        else {
            return SendClientMessage(playerid, COLOR_WHITE, "Usage: /do <text>");
        }
    }
    return 1;
}
For /me command:

pawn Код:
COMMAND:me(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFFF, "/me [text]");
    new
        string[128],
        pNamer[MAX_PLAYER_NAME]
    ;
    GetPlayerName(playerid, pNamer, MAX_PLAYER_NAME);
    format(string, sizeof(string), "* %s (%d) %s *", pNamer, playerid, params);
    return SendClientMessageToAll(0xFFFFFFFF, string);
}