SA-MP Forums Archive
Help me ! - 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: Help me ! (/showthread.php?tid=645568)



Help me ! - Espressino - 29.11.2017

Код:
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


Re: Help me ! - RageCraftLV - 29.11.2017

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;
}



Re: Help me ! - Espressino - 29.11.2017

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


Re: Help me ! - Espressino - 29.11.2017

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




Re: Help me ! - RageCraftLV - 29.11.2017

Код:
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?


Re: Help me ! - Espressino - 29.11.2017

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


Re: Help me ! - RageCraftLV - 29.11.2017

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.


Re: Help me ! - Espressino - 29.11.2017

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 ?


Re: Help me ! - RageCraftLV - 29.11.2017

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.


Re: Help me ! - Espressino - 29.11.2017

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