SA-MP Forums Archive
Dialog Help - 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: Dialog Help (/showthread.php?tid=527720)



Dialog Help - PMH - 24.07.2014

Hello guys!

I was making a duel script for my server. So I'm making it with dialogs, so when you type /duel (id), it shows the targetid the Accept/Decline Dialog.
But I need help with the response of that dialog. I need the id of the player who typed /duel or who invited him to the duel when he click accepts.
Like when he accepts:
new duelerid; <<smthng like that? Hope u understand me!
How can I use the player id of the one who typed /duel in OnPlayerDialogResponse? Is it even possible?


Re: Dialog Help - coole210 - 24.07.2014

In the command you can do something like..

pawn Код:
SetPVarInt(targetid, "Duelerid", playerid);
Then you use it with GetPVarInt(playerid, "Duelerid") in OnDialogResponse.

Will probably complicate things when receiving multiple duel requests though, would recommend making an array to accept multiple incoming duel requests or just block all requests to a player if that player is being requested already.


Re: Dialog Help - PMH - 24.07.2014

Quote:
Originally Posted by coole210
Посмотреть сообщение
In the command you can do something like..

pawn Код:
SetPVarInt(targetid, "Duelerid", playerid);
Then you use it with GetPVarInt(playerid, "Duelerid") in OnDialogResponse.

Will probably complicate things when receiving multiple duel requests though, would recommend making an array to accept multiple incoming duel requests or just block all requests to a player if that player is being requested already.
ok thnx a lot for replying, +rep'ed.
since only one duel request can be sent, it won't become complicated.