Chat help
#1

can you make an announce to only a certain interior like say this

the command would be /flag [.....](red,yellow,green, or checkered)

if i do this one /flag red the command would make an announce to the inteior in the chat box and say "RED Flag" or
"Red flag all racers come to put" /flag yellow same concept but it would say "Yellow flag" or "Yellow flag all racers slow down and pit or go slow around track" and so on with /flag green and /flag checkered

does any one know if this is possible i've searched ****** nothing came up about it
Reply
#2

(my first code since almost a half a year..)

pawn Код:
CMD:flag(playerid, params[])
{
    new string[128],
    flag[48];

    if(sscanf(params, "s", flag)) return SendClientMessage(playerid, "/flag [color]");

    if(!strcmp(flag, "red", true))
    {
        format(string, sizeof(string), "Red flag message");
    }
    if(!strcmp(flag, "yellow", true))
    {
        format(string, sizeof(string), "yellow flag message");
    }
    if(!strcmp(flag, "green", true))
    {
        format(string, sizeof(string), "green flag message");
    }
    for(new i=0; i < MAX_PLAYERS; i++)
        if(IsPlayerConnected(i) && GetPlayerInterior(i) == INTERIORID)
            SendClientMessage(i, COLOR, string);
           
    return 1;
}
Reply
#3

Thanks and also what type of script is this zcmd? and if it is not is there a chance you can make it one?
Reply
#4

It is zcmd and uses sscanf2.
Reply
#5

Our server uses this type of command system how could i get the one SnG.Scot_MisCuDI made to the command system we use

Код:
if(strcmp(cmd, "/command", true) == 0)


i dont know what type of command system it is i forgot what it is called
Reply
#6

I would recommend switching to zcmd because personally i think its a lot more efficent and a lot faster to make the first line (CMD:command)
pawn Код:
if(strcmp(cmd, "/flag", true) == 0)
{
    new string[128],
    flag[48];

    if(sscanf(params, "s", flag)) return SendClientMessage(playerid, "/flag [color]");

    if(!strcmp(flag, "red", true))
    {
        format(string, sizeof(string), "Red flag message");
    }
    if(!strcmp(flag, "yellow", true))
    {
        format(string, sizeof(string), "yellow flag message");
    }
    if(!strcmp(flag, "green", true))
    {
        format(string, sizeof(string), "green flag message");
    }
    for(new i=0; i < MAX_PLAYERS; i++)
        if(IsPlayerConnected(i) && GetPlayerInterior(i) == INTERIORID)
            SendClientMessage(i, COLOR, string);
           
    return 1;
}
Reply
#7

You must add the string size of flag, on sccanf function too.
pawn Код:
if(sscanf(params, "s[48]", flag))
Reply
#8

alright thanks guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)