How to get?
#1

Hello, I am making a helpers system and I need some help.

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;
}
And here is command /helprequests

Код:
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;
}
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
Reply
#2

Can anyone help me?
Reply
#3

TO do that you would need to store the requests in a enum, this could then be called from an array to get a dialog or a text print out of the people that need help!.
Reply
#4

Okay, I'll try it
Reply
#5

If you get stick i'm sure theres a admin system floating arround here with the same thing but with reports. It wouldn't take two clicks of a button to dwnload the script and edit it to repots and implement it to your GM.
Reply
#6

Maybe you can say how to do that
Код:
PInfo[playerid][Helprequest] = question;
now it says that array must be indexed or something like this
Reply
#7

I didnt mean into the player enum, hmm. I'll tell you what. I'm currantly making the same thing but for Reports against players to admins. Add my skype and when i'm finished i'll convert it to Help Rquests and send it to you.

Skype - Hewlett_T
Reply
#8

Yes!! I made it myself Anyway thanks for advices.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)