17.10.2015, 23:48
Here you go. So you can /ask and then /callhelp (call the player report/question)
Example code, not tested. Tell me if there are bugs with it and ill resolve it for you.
EDIT: Update, forgot to add /helpq. It lets you see all helps made.
pawn Код:
new
CreatedAsk[MAX_PLAYERS],
QuestionText[MAX_PLAYERS][180];
CMD:callhelp(playerid,params[]) //ch > call help
{
new otherplayer,string[256];
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid,COLOR_RED,"You are not an admin!"); //change or remove this
if(sscanf(params,"i",otherplayer))
return SendClientMessage(playerid,COLOR_RED,"Usage: /cr [playerid]");
if(CreatedAsk[otherplayer] == 0)
return SendClientMessage(playerid,COLOR_RED,"That player havent created any reports");
CreatedAsk[otherplayer] = 0; //setting other players Question to 0
format(string,sizeof(string),"%s has resolved %s help request",GetName(playerid),GetName(otherplayer));
SendClientMessageToAll(COLOR_GREEN,string);
return true;
}
CMD:ask(playerid,params[])
{
new
text[128],string[256];
if(sscanf(params,"s[128]",text))
return SendClientMessage(playerid,COLOR_RED,"Usage: /ask [question]");
CreatedAsk[playerid] = 1;
format(string,sizeof(string),"Question from (ID:%d)%s: %s",playerid,GetName(playerid),text);
SendClientMessageToAll(COLOR_GREEN,string); //sending the message to all, change to your admins/helpers w/e u want
strcpy(QuestionText[playerid],string,180); //copy the string so u can use it later
return true;
}
stock GetName(playerid);
{
new szName[MAX_PLAYER_NAME];
GetPlayerName(playerid, szName, sizeof(szName));
return szName;
}
EDIT: Update, forgot to add /helpq. It lets you see all helps made.
pawn Код:
CMD:helpq(playerid,params[])
{
if(!IsPlayerAdmin(playerid))
return SendClientMessage(playerid,COLOR_RED,"You are not level 1+ admin");
foreach(Player,i)
{
if(CreatedAsk[i] >= 1)
{
SendClientMessage(playerid,COLOR_RED,QuestionText[i]);
}
}
return true;
}