10.01.2013, 02:13
i can't find a /ask
For Admin
Player Can do /ask
the admin's can help them.
For Admin
Player Can do /ask
the admin's can help them.
CMD:ask(playerid, params[])
{
new string[128], pname[24];
if(!sscanf(params,"s[128]",string))
{
GetPlayerName(playerid, pname, 24);
format(string,128,"[ASK] %s is asking: %s",pname,string);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerAdmin(i)) SendClientMessage(i, -1, string);
}
}
else SendClientMessage(playerid, 0xFF0000AA, "Usage: /ASK [Message]");
}
if(IsPlayerAdmin(i))
if(pInfo[i][pAdmin] >= 1)
if(PlayerInfo[i][pAdmin] >= 1 || IsPlayerAdmin(i))
CMD:ask(playerid, params[])
{
new text[128]; //Variable text
new string[256];
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
//You need sscanf2 include, sscanf plugin.
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, -1, "USAGE: /ask [text]");
for(new i=0;i<MAX_PLAYERS;i++)
{
if(PlayerInfo[i][pAdmin] >= 1 || IsPlayerAdmin(i))
{
format(string, sizeof(string),"Player %s asks %s", Name, text);
SendClientMessage(i, -1, string);
}
}
return 1;
}
//With your defines
#define COL_YEL 0xFFFF0000 // Color Yellow
SendClientMessage(i, COL_YEL, string);