25.07.2011, 22:53
Hi , im making an fs and it dosnt work , when im click on player , I get dialog and when im choose somwthing , nothing happens . When im login in rcon and when im click on player it say "You clicked on player 0" and doesn't show me dialog .
here is my code :
EDIT : Fixed
here is my code :
pawn Код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
SetPVarInt(playerid,"ClickedPlayer",clickedplayerid);
ShowPlayerDialog(playerid,9137,DIALOG_STYLE_LIST,"Pick Option","Kick\nBan","Action","Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 9137)
{
if(response)
{
if(listitem == 0)
{
new gName[MAX_PLAYER_NAME],string[128];
new victim = GetPVarInt(playerid,"ClickedPlayer");
GetPlayerName(victim,gName,sizeof gName);
format(string,sizeof string,"You kicked player %s",gName);
SendClientMessage(playerid,0x00ff00ff,string);
Kick(victim);
}
if(listitem == 1)
{
new gName[MAX_PLAYER_NAME],string[128];
new victim = GetPVarInt(playerid,"ClickedPlayer");
GetPlayerName(victim,gName,sizeof gName);
format(string,sizeof playerid,"You banned player %s",gName);
SendClientMessage(playerid,0x00ff00ff,string);
Ban(victim);
}
}
}