Advirtise
#1

Hello people, Im wondering how to make a /adv command I never made such things before and I Have no idea in how to make it, please help.

-Thank you.
Reply
#2

pawn Код:
COMMAND:adv(playerid, params[])
{
    new message[128], string[128], name[MAX_PLAYER_NAME];
    if(sscanf(params, "s[128]", message)) return SendClientMessage(playerid, WHITE, "USAGE: /adv [message]);
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "
Advertisement by %s: %s.", name, message);
    SendClientMessageToAll(GREEN, string);
    return 1;
}
here you go.
Reply
#3

PHP код:
YCMD:adv(playeridparams[], help)
{
    if(
help) { SendClientMessage(playerid, -1"This command is used to place advertisements."); }
    else
    {
        new 
string[128], name[MAX_PLAYER_NAME];
           
GetPlayerName(playeridnamesizeof(name))
        if(
sscanf(params"s[128]"params)) return SendClientMessage(playeridCOLOR_GREY"USAGE: (/adv)ertise [message]");
        
format(stringsizeof(string), "(( %s - Advertisment by: %s))"paramsname);
        
SendClientMessageToAll(-1string);
    }
    return 
1;

Heres a simple one done in YCMD.
Reply
#4

You don't need to use sscanf.
pawn Код:
if(isnull(params))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)