Roleplay command help
#6

Quote:
Originally Posted by Strier
Посмотреть сообщение
pawn Код:
CMD:me(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /me [action]"); //This would be detecting, if the player types nothing, it will return him the ClientMessage stated above.
    new str[500], pName[MAX_PLAYER_NAME]; //The text the player will type, and the player name..
    GetPlayerName(playerid, pName, sizeof(pName)); //This gets the player name...
    format(str, sizeof(str), " * %s %s", pName, params); //This format gets what the player types
    SendClientMessageToAll(-1, str); // and here it sends the string
    return 1;
}
No need of all that ..
This^^ will send the message to all the players and if you want the cmd for nearby players use this.

pawn Код:
CMD:me(playerid, params[])
{
    if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /me [action]"); //This would be detecting, if the player types nothing, it will return him the ClientMessage stated above.
    new str[500], pName[MAX_PLAYER_NAME]; //The text the player will type, and the player name..
    GetPlayerName(playerid, pName, sizeof(pName)); //This gets the player name...
    format(str, sizeof(str), " * %s %s", pName, params); //This format gets what the player types
    SendNearbyMessage(playerid, 15, str, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);// and here it sends the string
    return 1;
}
here is the /b cmd for local ooc chat
pawn Код:
CMD:b(playerid, params[])
{
    new string[128];
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /b [text] (Local OOC Chat)");
        GetPlayerName(playerid, pName, sizeof(pName)); //This gets the player name...
    format(string, sizeof(string), "%s: (( %s ))", pName, params); //This format gets what the player types
    SendNearbyMessage(playerid, 10, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 1;
}
didn't tested the /b cmd.
Reply


Messages In This Thread
Roleplay command help - by lramos15 - 24.02.2013, 03:09
Re: Roleplay command help - by @Riichard - 24.02.2013, 03:11
Re: Roleplay command help - by NathNathii - 24.02.2013, 03:11
Re: Roleplay command help - by lramos15 - 24.02.2013, 03:51
Respuesta: Roleplay command help - by Strier - 24.02.2013, 04:58
Re: Respuesta: Roleplay command help - by Marven - 24.02.2013, 07:45
Re: Roleplay command help - by lramos15 - 24.02.2013, 14:44
Re: Roleplay command help - by erminpr0 - 24.02.2013, 16:03
Re: Roleplay command help - by lramos15 - 24.02.2013, 18:13
Re: Roleplay command help - by lramos15 - 24.02.2013, 18:15

Forum Jump:


Users browsing this thread: 1 Guest(s)