14.06.2011, 21:28
can anybody tell me how to make a /announce cmd.i also want to make the text bigger and colorful while i put /announce In-game
CMD:announce(playerid,params[])
{
if(!strlen(params)) return 0;
GameTextForAll(params,4000,3); //change this to whatever
return 1;
}
if(!strcmp(cmdtext, "/ann", true, 4))
{
new str[128];
if(cmdtext[4] == 0) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ann [message]");
format(str, sizeof(str)," %s %s", str, cmdtext[5]);
SendClientMessageToAll(COLOR_ORANGE, "---------------------------------------------------");
SendClientMessageToAll(COLOR_YELLOW, str);
SendClientMessageToAll(COLOR_ORANGE, "---------------------------------------------------");
return 1;
}
dcmd_announce(playerid,params[])
{
if(AccInfo[playerid][Level] >= 2 || IsPlayerAdmin(playerid))
{
if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /announce [Text]") &&
SendClientMessage(playerid, orange, "Function: Will Announce the specified Message in screen");
SendCommandToAdmins(playerid,"Announce");
return GameTextForAll(params,4000,3);
}
else return ErrorMessages(playerid, 7);
}
dcmd_announce(playerid,params[])
{
IsPlayerAdmin(playerid))
{
if(!strlen(params)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /announce [Text]") &&
SendClientMessage(playerid, orange, "Function: Will Announce the specified Message in screen");
SendCommandToAdmins(playerid,"Announce");
return GameTextForAll(params,4000,3);
}
else return ErrorMessages(playerid, 7);
}
|
pawn Код:
|
|
Actually, that command won't work either. See if you can figure it out...
|
dcmd_gametextall(playerid, cmdtext[])
{
new tmp[256], index;
tmp = strrest(cmdtext, index);
if (!strlen(tmp))
return SendClientMessage(0xFF444499, playerid, "/ann <message>");
if (strlen(tmp) > 25)
return SendClientMessage(0xFF444499, playerid, "Your announce message is too long");
GameTextForAll(tmp, 4000, 5);
return 1;
}
|
You high rollers are really annoying, why don't you help him out instead of making useless posts.
pawn Код:
|
|
You high rollers are really annoying, why don't you help him out instead of making useless posts.
pawn Код:
|
|
can u plz also tell me do i add it under playeroncommandtext?and also how do i make it on rcon login only?
|
if(!strcmp(cmdtext, "/gametextall", true, 11))
{
if(IsPlayerAdmin(playerid))
{
new tmp[256], index;
tmp = strrest(cmdtext, index);
if (!strlen(tmp))
return SendClientMessage(0xFF444499, playerid, "/gametextall <message>");
if (strlen(tmp) > 25)
return SendClientMessage(0xFF444499, playerid, "Your announce message is too long");
GameTextForAll(tmp, 4000, 5);
return 1;
}