Help me !
#1

Код:
CMD:wb(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{0000FF}Welcome {FF0000}Back!");
}

CMD:hi(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{ff000b}H{33FFFC}ello!");
}

CMD:ty(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{9033FF}Thanks!");
}

CMD:bye(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{9033FF}Bye,{FF33CA}Bye!!");
}
Commands work,but it said, Try another command from /help that one doesnt exist
Reply
#2

Any warnings when compiling? And I think they should return 1;

Like this:
Код:
CMD:wb(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{0000FF}Welcome {FF0000}Back!");
    return 1;
}

CMD:hi(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{ff000b}H{33FFFC}ello!");
    return 1;
}

CMD:ty(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{9033FF}Thanks!");
    return 1;
}

CMD:bye(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{9033FF}Bye,{FF33CA}Bye!!");
    return 1;
}
Reply
#3

no warning,let me test this

Код:
CMD:wb(playerid,params[]) {
    SendPlayerMessageToAll(playerid, " {0000FF}Welcome {FF0000}Back!");
    return 1;
}

CMD:hi(playerid,params[]) {
    SendPlayerMessageToAll(playerid, " {ff000b}H{33FFFC}ello!");
    return 1;
}

CMD:ty(playerid,params[]) {
    SendPlayerMessageToAll(playerid, " {9033FF}Thanks!");
    return 1;
}

CMD:bye(playerid,params[]) {
    SendPlayerMessageToAll(playerid, " {9033FF}Bye,{FF33CA}Bye!!");
    return 1;
}
thanks it worked
Reply
#4

and this

Код:
CMD:wb(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{0000FF}Welcome {FF0000}Back!");
    return 1;
}

CMD:hi(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{ff000b}H{33FFFC}ello!");
    return 1;
}

CMD:ty(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{9033FF}Thanks!");
    return 1;
}

CMD:bye(playerid,params[]) {
    SendPlayerMessageToAll(playerid, "{9033FF}Bye,{FF33CA}Bye!!");
    return 1;
}
how can i put [0] Eman : Welcome back

on that message

Reply
#5

Код:
pName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name);
    return name;
}

public OnPlayerText(playerid, text[])
{
    new string[128];    
    format(string, sizeof string, "[%d] %s: %s", playerid, pName(playerid), text);
    SendClientMessageToAll(-1, string);
    return 0;
}
Haven't tested it, but it should work.

You wanted it to show the ID when player writes something, right?
Reply
#6

Quote:
Originally Posted by RageCraftLV
Посмотреть сообщение
Код:
pName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name);
    return name;
}

public OnPlayerText(playerid, text[])
{
    new string[128];    
    format(string, sizeof string, "[%d]%s: %s", playerid, pName(playerid), text);
    SendClientMessageToAll(-1, string);
    return 0;
}
can you make 1 with this cmd

Код:
CMD:wb(playerid,params[]) {
    SendPlayerMessageToAll(playerid, " {0000FF}Welcome {FF0000}Back!");
    return 1;
}
im newbie in scripting,i still dont understand plz
Reply
#7

I don't think you can do that. At least I don't know how to. You can just replace OnPlayerText with the example above and add pName(playerid) function anywhere in the script.
Reply
#8

Quote:
Originally Posted by RageCraftLV
Посмотреть сообщение
I don't think you can do that. At least I don't know how to. You can just replace OnPlayerText with the example above and add pName(playerid) function anywhere in the script.
If i did /wb

and SendPlayerMessageToAll(playerid, " {0000FF}Welcome {FF0000}Back!");

so,All player can see : Welcome Back message?

coz i want make this,if someone join server,and i do /wb,so he can see it ?
Reply
#9

Yes, all the players will see the message.

Код:
CMD:wb(playerid,params[]) {
    new string[128];
    format(string, sizeof string, "[%d] %s: {0000FF}Welcome {FF0000}Back!", playerid, pName(playerid));
    SendClientMessageToAll(-1, string);
    return 1;
}
Sorry, messed up a little myself, use this command.

And you need to use SendClientMessageToAll(color, message); Don't put playerid in there.
Reply
#10

Quote:
Originally Posted by RageCraftLV
Посмотреть сообщение
Yes, all the players will see the message.

Код:
CMD:wb(playerid,params[]) {
    new string[128];
    format(string, sizeof string, "[%d] %s: {0000FF}Welcome {FF0000}Back!", playerid, pName(playerid));
    SendClientMessageToAll(-1, string);
    return 1;
}
Sorry, messed up a little myself, use this command.

And you need to use SendClientMessageToAll(color, message); Don't put playerid in there.
Код:
CMD:wb(playerid,params[]) {
    new string[128];
    format(string, sizeof string, "[%d] %s: {0000FF}Welcome {FF0000}Back!", playerid, pName(playerid));
    SendPlayerMessageToAll(-1, string);
    return 1;
}

CMD:hi(playerid,params[]) {
    new string[128];
    format(string, sizeof string, "[%d] %s:  {ff000b}H{33FFFC}ello!", playerid, pName(playerid));
    SendPlayerMessageToAll(-1, string);
    return 1;
}

CMD:ty(playerid,params[]) {
    new string[128];
    format(string, sizeof string, "[%d] %s:  {9033FF}Thanks!", playerid, pName(playerid));
    SendPlayerMessageToAll(-1, string);
    return 1;
}

CMD:bye(playerid,params[]) {
    new string[128];
    format(string, sizeof string, "[%d] %s:  {9033FF}Bye,{FF33CA}Bye!", playerid, pName(playerid));
    SendPlayerMessageToAll(-1, string);
    return 1;
}
i did this,but when i write /wb

nothing shown

like empty,theres no /wb
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)