How to get? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to get? (
/showthread.php?tid=336448)
How to get? -
Yako - 22.04.2012
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
Re: How to get? -
Yako - 22.04.2012
Can anyone help me?
Re: How to get? -
IceCube! - 22.04.2012
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!.
Re: How to get? -
Yako - 22.04.2012
Okay, I'll try it
Re: How to get? -
IceCube! - 22.04.2012
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.
Re: How to get? -
Yako - 22.04.2012
Maybe you can say how to do that
Код:
PInfo[playerid][Helprequest] = question;
now it says that array must be indexed or something like this
Re: How to get? -
IceCube! - 22.04.2012
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
Re: How to get? -
Yako - 23.04.2012
Yes!! I made it myself
Anyway thanks for advices.