/ask system
#1

Hey, I'm using LuxAdmin and I want an /ask system for players to ask questions to online admins maybe an /ans(wer) command too for admins too respond

just wanting to know how to do it
Reply
#2

Here.
the ask commands wich players can use it , /ask:
Код:
//-------------------------[Ask]---------------------------------------------
if(strcmp(cmd, "/ask", true) == 0)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ask [question]");
return 1;
}
format(string, sizeof(string), "%s (id%d) asks %s", sendername, playerid, result);
ABroadCast(COLOR_YELLOW,string,1);
SendClientMessage(playerid, COLOR_GRAD2, "Your question has been sent, please wait a response");
}
and the admins can answer the question with this command " /ans(wer)

Код:
//-------------------------[Answer]---------------------------------------------
if((strcmp(cmd, "/answer", true) == 0 || strcmp(cmd, "/ans", true) == 0))
{
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pRealAdmin] == 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /ans(wer) [playerid/PartOfName] [Answer]");
return 1;
}
if(IsStringAName(tmp))
{
giveplayerid = GetPlayerID(tmp);
}
else
{
giveplayerid = strval(tmp);
}
if (!IsPlayerConnected(giveplayerid))
{
SendClientMessage(playerid, COLOR_RED, "ERROR: That player is not connected!");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[128];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ans(wer) [playerID/PartOfName] [Answer]");
return 1;
}
format(string, sizeof(string), "Admin %s (%d) has Answered to your question with the following answer:", sendername, playerid);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
format(string, sizeof(string), "%s", result);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Admin %s has responded to %s [ID:%d]'s Question", sendername, giveplayer, giveplayerid);
ABroadCast(COLOR_GREEN, string,1);
}
}
Reply
#3

"Pawno Stop Responding"


When I try to compile
Reply
#4

Quote:
Originally Posted by mikeboy
"Pawno Stop Responding"


When I try to compile
Its because the person who gave you the code probably copied the code from godfather and probably is a noob and has no idea what he is doing.
Im not going to create the code though because im lazy.
Just make a command and split it (using the split function) into two. Then format the string so its like "Name asks: %s" then send it to all players, etc.
Reply
#5

Quote:
Originally Posted by lolumadd [cod5server.tk
]
Quote:
Originally Posted by mikeboy
"Pawno Stop Responding"


When I try to compile
Its because the person who gave you the code probably copied the code from godfather and probably is a noob and has no idea what he is doing.
Im not going to create the code though because im lazy.
Just make a command and split it (using the split function) into two. Then format the string so its like "Name asks: %s" then send it to all players, etc.
First of all i dont even played GF gamemode or Edit it or whatever, and you are not going to creat it because you are the noob ! and i make this two commands but i see nothing wrong that gave him the stop responding, also he didnt said what GM he have so please STFU and GTFO !
Reply
#6

Okay, #1 those obviously arent your functions
#2 those are the exact functions and variables from godfather
#3 you didnt even post the code for the functions
#4 try to explain what your code does cause you probably cant
Reply
#7

Me and my friends working on my own script 2 mounth ago, and stop whining me HE ASK FOR FUCKING COMMANDS I GAVE HIM if you don't have them STFU !! and dont post crazy things and i dont give a shit what ever you saying so gtfo 8 years old fat kid
Reply


Forum Jump:


Users browsing this thread: