Easy problem but hard to fix. REP ++ -
buburuzu19 - 08.11.2014
I want that liders who are playerVariables[playerid][pGroupRank] == 7; can't click themselves. Wht i tried is up , with groupl but not working.
Re: Easy problem but hard to fix. REP ++ -
HydraHumza - 08.11.2014
I didn't understand what error u facing
Re: Easy problem but hard to fix. REP ++ -
buburuzu19 - 08.11.2014
i have the command /members, when i type it , dialog_members shows up , and i want to make a restriction who disallow the leaders (playerVariables[playerid][pGroupRank] == 7

to click themselves.
if(listitem >= 1) because the first row is with the name of the faction.
Re: Easy problem but hard to fix. REP ++ -
Mic_H - 08.11.2014
Please explain better.. I dint understand ->
1: What do you want to do with the code?
2: Whats the error you are facing? [Run-Time error]
3: What does the code do?
Re: Easy problem but hard to fix. REP ++ -
buburuzu19 - 08.11.2014
LEADERS CAN CLICK THEMSELVES AND I DON'T WANT TO , THEY CAN UNINVITE THEMSELVES AND OTHER STUFF LIKE THIS MAKES THIS A BUG.
I AM TRYING TO MAKE A RESTRICTION BUT IT'S SEEMS THAT DOES NOT WORK.
Re: Easy problem but hard to fix. REP ++ -
dominik523 - 08.11.2014
Well if you are going to use input text for inviting and that stuff, you can check this:
Code:
if(strval(listitem) == playerid) return 1;
Re: Easy problem but hard to fix. REP ++ -
Mic_H - 08.11.2014
Caps off! No need to flame. We both posted it on same time.
Can you post the code of primary ShowPlayerDialog? The command
Re: Easy problem but hard to fix. REP ++ -
buburuzu19 - 08.11.2014
i tryied with if(listitem == playerid) return SCM(playerid, -1, "You can't click on this person"); and i started the server i clicked me and nothing happened.
Re: Easy problem but hard to fix. REP ++ -
buburuzu19 - 08.11.2014
....
Re: Easy problem but hard to fix. REP ++ -
Mic_H - 08.11.2014
I think you are understanding listitem wrong.
Listitem is the line which the player clicked. It jus shows the line number. Nothing else.
If the player click first line, listitem = 0
Second line, listitem = 1 ...
5th line, list item = 4
Re: Easy problem but hard to fix. REP ++ -
buburuzu19 - 08.11.2014
And what is necessary to do 4 fix?
Edit: When i type members i get:
"Los Santos PD members:" - first row
"Membername 1" - second row
"Membername 2" - third row
"Membername 3" - fifth row
"...."
"...."
"...."
I want to disallow the leader of clicking himself.
Re: Easy problem but hard to fix. REP ++ -
buburuzu19 - 08.11.2014
Quote:
Originally Posted by Mic_H
I think you are understanding listitem wrong.
Listitem is the line which the player clicked. It jus shows the line number. Nothing else.
If the player click first line, listitem = 0
Second line, listitem = 1 ...
5th line, list item = 4
|
And i want to leaders can't click themselves.
Re: Easy problem but hard to fix. REP ++ -
Mic_H - 08.11.2014
Better make a different table for group data... So creater / Leader stays on top always..
When you get data from Playerinfo table, it will be mixed up.. Leader might come second etc..
OR
Since only leader can use the command, don't display his name.. He knows he is in the group :P
enum grinfo
{
GP_PlayerName[24],//stores name
GP_GrRank,//ssaves his rank
GP_DBID,//store database_id for saving data
GP_listnumber,//saves the loop number to be used for listitem
GP_days,//days
GP_lastlogged[10],//last logged
Etc
};
new GroupInfo[max_groups][Max_members][grinfo];
Save data when he uses /members..
Stock GetPlayerListData(listitem, groupid)
{
For Loop and return if(GroupInfo[groupid][i][GP_listnumber]==listitem)
Return i;
}
Typing from mobile.. Sorry
Re: Easy problem but hard to fix. REP ++ -
buburuzu19 - 08.11.2014
Too hard for me , enum is very different at me ... can you intergrate in my command if i give you my command trough PM?
Re: Easy problem but hard to fix. REP ++ -
DavidBilla - 08.11.2014
Can you show the ShowPlayerDialog codes of DIALOG_MEMBERS?
Re: Easy problem but hard to fix. REP ++ -
buburuzu19 - 08.11.2014
Quote:
Originally Posted by DavidBilla
Can you show the ShowPlayerDialog codes of DIALOG_MEMBERS?
|
pawn Код:
case DIALOG_MEMBERS:
{
if(response)
{
if(listitem >= 1)
{
new item = listitem - 1;
new groupl = playerVariables[playerid][pGroupRank] == 7;
if(listitem == groupl) return SendClientMessage(playerid, COLOR_GREY, "You can't click on this item.(222)");
format(playerVariables[playerid][pSelected], MAX_PLAYER_NAME, "%s",Selected[item][snume]);
ShowPlayerDialog(playerid, 10007, DIALOG_STYLE_LIST, "Select an action", "Uninvite\nChangerank\nFwarn", "Go", "Cancel");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You can't click on this item.");
}
}
else SendClientMessage(playerid, COLOR_GREY, "Memebers dialog canceled");
}
Re: Easy problem but hard to fix. REP ++ -
DavidBilla - 08.11.2014
Dude, you are showing OnDialogResponse
I'm asking for the codes above the line which starts like
ShowPlayerDialog(playerid,DIALOG_MEMBERS.....
If you can show that code, perhaps i can help....
Re: Easy problem but hard to fix. REP ++ -
sammp - 08.11.2014
pawn Код:
if(!strcmp(Selected[item][snume], Player[playerid][Name])
{
SendClientMessage(playerid, -1, "you cant click this player");
}
Re: Easy problem but hard to fix. REP ++ -
buburuzu19 - 08.11.2014
Fixed.
Re: Easy problem but hard to fix. REP ++ -
sammp - 08.11.2014
How did you fix it?