Newb chat -
Rafaeloo - 17.10.2015
Hello Guys.
I have a roleplay server.
the newb chat is for all EX : newbie: TEST , and the answer againg NEWB : TEST.
i need a script when you ask something the question to go on helpers. like : Qesution Sended : TEST , Answer from Helper : TEST.
CODE
PHP код:
CMD:newb(playerid, params[]) {
if(gPlayerLogged[playerid] == 0)
return SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
if(AntiAdv(playerid, params)) return 1;
if((nonewbie) && PlayerInfo[playerid][pAdmin] < 1)
return SendClientMessage(playerid, COLOR_GRAD2, "The newbie chat channel has been disabled by an Admin!");
if(gNewbie[playerid] == 1)
return SendClientMessage(playerid, COLOR_GREY, "You have the channel toggled, /tognewbie to re-enable!");
if(isnull(params))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/newb)ie [text]");
if(PlayerInfo[playerid][pNMute] == 1)
return SendClientMessage(playerid, COLOR_GREY, "You're muted from the newbie chat channel.");
new
string[128];
if(NewbieTimer[playerid] > 0) {
format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", NewbieTimer[playerid]);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
#Sorry for bad english
Re: Newb chat -
Rafaeloo - 17.10.2015
please help me please.
Re: Newb chat -
Luicy. - 17.10.2015
Relax, you've made this thread 2minutes ago and already bumps it.
Re: Newb chat -
Rafaeloo - 17.10.2015
do you know how to make it ?
Re: Newb chat -
SpikeSpigel - 17.10.2015
What you want to make its a /askq or /helpme command, not a /n one
Re: Newb chat -
TwinkiDaBoss - 17.10.2015
Here you go. So you can /ask and then /callhelp (call the player report/question)
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;
}
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 Код:
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;
}