[HELP] NPC OnPlayerClickPlayer
#1

Script: Mine
Problem: When I click TAB (My ID is 1 cuz NPC is 0) opens dialog with admin commands for example slap and when I choose slap, it slaps NPC but not me...
Part of script: I added this just to see if it will show me dialog and it shows...
Код:
if(!IsPlayerNPC(clickedplayerid))
   {
   SPD(playerid,23,DIALOG_STYLE_LIST,"INFORMACIJE I ADMINISTRACIJA","Informacije o igracu\nAdministracija","Odaberi","Izlaz");
   }
   return 1;
Reply
#2

This isnt enough information for me to help you.
Reply
#3

When I click TAB and click on me (my name) it opens dialog with admin commands and when I choose for example slap player it slaps NPC, not me.

If you need some code or more info tell me...
Reply
#4

I wound need to see the dialog 23
Reply
#5

You probably declare a variable in OnDialogResponse for dialogid 23 and its default value is 0. Store it to a variable:
pawn Код:
// global:
new Player_Clicked[MAX_PLAYERS];

// OnPlayerConnect:
Player_Clicked[playerid] = INVALID_PLAYER_ID;

// OnPlayerClickPlayer:
Player_Clicked[playerid] = clickedplayerid;
In OnDialogResponse, use Player_Clicked[playerid] (it will store the clicked player's ID) and reset it to INVALID_PLAYER_ID after done what you want with the list items from the dialog.
Reply
#6

@Konstantinos

Thank You SO MUCH !!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)