22.04.2012, 13:18
Hello, I am making a helpers system and I need some help.
Here is the code of /helpme command.
And here is command /helprequests
I want that when helper types /helprequests he would see list of requested helps like this:
Help requests:
1. Name_Surname: Question
2. Name_Surname: Question
I don't know how to get the question
Here is the code of /helpme command.
Код:
CMD:helpme(playerid, params[])
{
new question[128], pID, name[24];
if(PInfo[playerid][Askedhelp] == 1) {
return SendClientMessage(playerid,COLOR_GREY,"You already requested help!");
}
if(sscanf(params,"s[128]",question)) {
return SendClientMessage(playerid,COLOR_GREY,"USAGE: /helpme [question]");
}
new Tplayer[MAX_PLAYER_NAME], string[128];
GetPlayerName(pID,Tplayer,sizeof(Tplayer));
GetPlayerName(playerid,name,24);
format(string,sizeof(string),"[HELP REQUEST] %s(%d) is asking for help: %s",Tplayer,pID,question);
SendHelperMessage(COLOR_YELLOW,string);
SendClientMessage(playerid,COLOR_GREEN,"You succesfully sent a help request to online helpers!");
PInfo[playerid][Askedhelp] = 1;
return 1;
}
Код:
CMD:helprequests(playerid, params[])
{
new zin[258] = "Help requests:";
new i = 0, Tplayer[MAX_PLAYER_NAME], x;
for(; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PInfo[i][Askedhelp] == 1)
{
x++;
GetPlayerName(i,Tplayer,sizeof(Tplayer));
format(zin,256,"%i. %s(%d): %s",x,Tplayer,i);
SendClientMessage(playerid,COLOR_GREEN,zin);
}
}
}
return 1;
}
Help requests:
1. Name_Surname: Question
2. Name_Surname: Question
I don't know how to get the question

