2 strings in 1 command.
#1

Howdy, I'd like to know if it is possible doing 2 strings in one command. If you don't know what I'm talkin' about, this is what I mean:

/command [id] [string1] [string2]

Then it would pop out like this for the other player (2 different lines):

[string1]
[string2]

If anyone knows, please help me out, Thanks!
Reply
#2

pawn Код:
CMD:bla(playerid, params[])
{
    new id, string1[128],string2[128];
    if(PlayerInfo [playerid][pAdmin] < 1)return SendClientMessage(playerid, COLOR_WHITE, "You need to be an admin lvl 3 to use that command!");
    else if(sscanf(params, "uss", id, string1,string2))SendClientMessage(playerid, COLOR_WHITE, "Usage: /bla [id/name][string1][string2]");
    else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,COLOR_WHITE,"Error: Player is not connected!");
    else {
        SendClientMessage(id,-1, string1);
        SendClientMessage(id,-1, string2);
    }
    return 1;
}
not tested, probably works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)