Help me, /ask command -
Goldino - 19.11.2012
Hey guys... Its me again.
I'm looking for a command that if a player has a question, they /ask then a admin uses /reply to answer the question.
Thanks
Re: Help me, /ask command -
park4bmx - 19.11.2012
using
ZCMD &
Scannf
pawn Код:
COMMAND:ask(playerid, params[])
{
new String[256];if(sscanf(params,"s", String)) return SendClientMessage(playerid, COLOR_WHITE, ""WHITE"Usage: "GREEN"/Ask "WHITE"[Message]");
new SenderName[MAX_PLAYER_NAME];GetPlayerName(playerid, SenderName, sizeof(SenderName));
SendClientMessage(playerid, COLOR_WHITE, "Ask Message Was "GREEN"Send "WHITE"To Admins.");
new string[128];format(string,sizeof(string),""BLUE"\"%s\" (%d) "WHITE"Has Asked a Qustion"WHITE" Question:",SenderName,playerid);
for(new i=0;i<MAX_PLAYERS;i++)//lopp all players
{
if(IsPlayerConnected(i) && PlayerInfo[i][PlayerAdmin] >= 1)//if player is admin(this is mREG admin check)
{
SendClientMessage(i,-1,string);
SendClientMessage(i,COLOR_BLUE,String);//send message to the admins
}
}
return 1;
}
:NOTE: You need to edit the color embeddings and the admin check
Re: Help me, /ask command -
d0nTtoucH - 23.08.2013
C:\Users\iliyan\Desktop\alfa - Copy (2)\pawno\include\PlayerCommands.inc(3) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\iliyan\Desktop\alfa - Copy (2)\pawno\include\PlayerCommands.inc(3) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\iliyan\Desktop\alfa - Copy (2)\pawno\include\PlayerCommands.inc(3) : warning 215: expression has no effect
C:\Users\iliyan\Desktop\alfa - Copy (2)\pawno\include\PlayerCommands.inc(3) : error 001: expected token: ";", but found "-integer value-"
C:\Users\iliyan\Desktop\alfa - Copy (2)\pawno\include\PlayerCommands.inc(3) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Help me, /ask command -
bensmart469 - 24.08.2013
Ask command:
pawn Код:
CMD:ask(playerid,params[])
{
new string[128],playername[24];
if(sscanf(params,"s[128]",params)) return SendClientMessage(playerid,0xFFFFFFFF,"USAGE: /ask [question]");
GetPlayerName(playerid,playername,24);
format(string,sizeof(string),"%s has requested help, question: %s",playername,params);
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i)) // Or use your admin variable, e.g. if(PlayerInfo[playerid][pAdmin])
{
SendClientMessage(i,0x00FF00FF,string);
}
}
}
return 1;
}
Reply command:
pawn Код:
CMD:reply(playerid,params[])
{
new string[128],playername[24],playerb;
if(!IsPlayerAdmin(playerid)) return 0; //hides the command if they're not an admin
if(sscanf(params,"us[128]",playerb,params)) return SendClientMessage(playerid,0xFFFFFFFF,"USAGE: /reply [id] [response]");
if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid,0xFF0000FF,"Invalid player ID!");
GetPlayerName(playerid,playername,24);
format(string,sizeof(string),"%s has responded, response: %s",playername,params);
SendClientMessage(playerb,0x00FF00FF,string);
GetPlayerName(playerb,playername,24);
format(string,sizeof(string),"You have replied to %s successfully",playername);
SendClientMessage(playerid,0x0000FFFF,string);
return 1;
}