[HELP] NPC OnPlayerClickPlayer - 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: [HELP] NPC OnPlayerClickPlayer (
/showthread.php?tid=520148)
[HELP] NPC OnPlayerClickPlayer -
Bokyyy - 17.06.2014
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;
Re: [HELP] NPC OnPlayerClickPlayer -
Pboachie - 17.06.2014
This isnt enough information for me to help you.
Re: [HELP] NPC OnPlayerClickPlayer -
Bokyyy - 17.06.2014
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...
Re: [HELP] NPC OnPlayerClickPlayer -
Pboachie - 17.06.2014
I wound need to see the dialog 23
Re: [HELP] NPC OnPlayerClickPlayer -
Konstantinos - 17.06.2014
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.
Re: [HELP] NPC OnPlayerClickPlayer -
Bokyyy - 17.06.2014
@Konstantinos
Thank You SO MUCH !!!