public OnPlayerClickPlayer Not Working
#1

Hey guys, I have a problem with public OnPlayerClickPlayer(playerid, clickedplayerid, source).
I'm making a Admin script where one of the Admins click on a player's name in the "TAB" score screen, which then calls a dialog that gives the Admin a number of options like Kick and Ban etc.

Now the problem is that the "public OnPlayerClickPlayer" does not work at all, i've tried almost everything, from SendClientMessage to SetPVarInt but nothing is executed.

Here is my current code that does not work.

Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
	SetPVarInt(playerid, "ClickedPlayerID", clickedplayerid);
	ShowPlayerDialog(playerid, DIALOG_MOD1MENU, DIALOG_STYLE_LIST, "ABL-Admin Junior Modderator Menu", "Kick Player","Select","Exit");
	return 1;
}
Please note that it is in a filterscript and not a Game Mode, also putting this in a command works correctly, but I want it to work with the Score Screen.

Thanx in advance.
Reply
#2

pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{  
    ShowPlayerDialog(playerid, DIALOG_MOD1MENU, DIALOG_STYLE_LIST, "ABL-Admin Junior Modderator Menu", "Kick Player","Select","Exit");
    SetPVarInt(playerid,"ClickedPlayerID", clickedplayerid);}
    return 1;
}
Try this
Reply
#3

Copy and paste caused an error which I fixed but still didn't solve my problem, I even tried this...
Код:
{
	SendClientMessage(playerid, COLOR_PURERED, "Testing");
	return 1;
}
And even that doesn't work. I'm running it on the latest samp03z_svr_R1-2_win32. With Streamer, YSI, Whirlpool, zcmd and sscanf.
Reply
#4

Use the one of the wiki.
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    new message[32];
    format(message, sizeof(message), "You clicked on player %d", clickedplayerid);
    SendClientMessage(playerid, 0xFFFFFFFF, message);
    return 1;
}
Let me know if that worked for you
Reply
#5

Nope tried that, still not working. What gives? does it work for you?
Reply
#6

It does work for me, I think everything given in the wiki does work, I really don't know why it doesn't work for you =(
Reply
#7

Try to redownload your SA-MP server packages, maybe it'll fix the problem.
Reply
#8

Quote:
Originally Posted by RenovanZ
Посмотреть сообщение
Try to redownload your SA-MP server packages, maybe it'll fix the problem.
He is right try to redownload your server package, Even your code is correct and it should go fine.
Reply
#9

Are you actually sure you've loaded the correct filterscript with that code in OnPlayerClickPlayer? Mistakes happen.
Reply
#10

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Are you actually sure you've loaded the correct filterscript with that code in OnPlayerClickPlayer? Mistakes happen.
Yeah, like I said, I've put a CMD in the script that works fine, its just that part that does not.

I will try redownloading the server but I doubt it will solve my problem, could you please try it on your side and tell me if it actually works?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)