Chat help -
nickstar - 09.11.2012
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
Re: Chat help -
SnG.Scot_MisCuDI - 09.11.2012
(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;
}
Re: Chat help -
nickstar - 09.11.2012
Thanks and also what type of script is this zcmd? and if it is not is there a chance you can make it one?
Re: Chat help -
Lordzy - 09.11.2012
It is zcmd and uses sscanf2.
Re: Chat help -
nickstar - 09.11.2012
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
Re: Chat help -
SnG.Scot_MisCuDI - 10.11.2012
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;
}
Re: Chat help -
Lordzy - 10.11.2012
You must add the string size of flag, on sccanf function too.
pawn Код:
if(sscanf(params, "s[48]", flag))
Re: Chat help -
nickstar - 10.11.2012
alright thanks guys