SA-MP Forums Archive
Mind Reading Script - 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: Mind Reading Script (/showthread.php?tid=636323)



Mind Reading Script - SteSte - 25.06.2017

Can someone show me how to make a simple script?
I want to know how to make a mind reading script, I have an idea how to start it but I'm not that good.

PHP код:
CMD:mindread(playeridparams[])
{
   new 
giveplayerid;
   new 
result[120];
       if(
sscanf(params"rs[120]"giveplayeridresult))
       {
          
SendClientMessage(playeridCOLOR_GREY"USAGE: /(m)ind®ead [playerid/PartOfName] [message]");
          return 
1;
       } 
So the goal here is when the player /mindread, he can ask the target any question and the target will have no choice but to answer the question, for example /mindread (playerid) "Where were you last night?"
so now a input dialog would pop up on the target's screen saying "Your mind is being read, answer the question below, and do not lie, lying is cheating."

The input dialog would allow the player to answer the question and they can submit it to the mindreader (which would be the result) or cancel it.


If you need more info, feel free to ask me.


Re: Mind Reading Script - Threshold - 25.06.2017

https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/OnDialogResponse


Re: Mind Reading Script - SteSte - 25.06.2017

xplain further.


Re: Mind Reading Script - JasonRiggs - 25.06.2017

He totally gave you all what you need, Unless if you want us to write the code for you, Show player dialog, is to show the dialog for a player (after defining it), OnPlayerDialogResponse is the result for the player responding to the dialog.


Re: Mind Reading Script - Sew_Sumi - 25.06.2017

Mind out too, as when you do show the dialog the player will be frozen. Which then could be abused by the person using /mindread, or players who are collaborating with the command user to make the people who are subject to this, immobile, and gunned down when it pops up.


Re: Mind Reading Script - SteSte - 25.06.2017

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Mind out too, as when you do show the dialog the player will be frozen. Which then could be abused by the person using /mindread, or players who are collaborating with the command user to make the people who are subject to this, immobile, and gunned down when it pops up.
What do you mean?
Are you suggesting a mind out command?


So I finished making the /mindread command, so I'm gonna test it.


Re: Mind Reading Script - Sew_Sumi - 25.06.2017

No, I'm saying to mind out because of the locking in position that happens when a player is prompted with a dialog.

People use this sort of thing to make people easy targets and shoot them while they aren't paying attention.


Re: Mind Reading Script - sammp - 25.06.2017

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
No, I'm saying to mind out because of the locking in position that happens when a player is prompted with a dialog.

People use this sort of thing to make people easy targets and shoot them while they aren't paying attention.
Freeze the sender and the receiver. Mindreader must be at a certain safezone to mind read. Bla bla


Re: Mind Reading Script - saffierr - 25.06.2017

Freeze both players - You will have to use DIALOG_STLYE_INPUT for the 'giveplayerid'.
You were pretty close in your Command.

PHP код:
CMD:mindread(playeridparams[]) 

   new 
giveplayeridresult[120]; 
   if(
sscanf(params"us[120]"giveplayeridresult)) return SendClientMessage(playeridCOLOR_GREY"USAGE: /(m)ind®ead [playerid/PartOfName] [message]");
   
TogglePlayerControllable(playerid1); // Freezes the playerid
   
TogglePlayerControllable(giveplayerid1); // Freezes the target
   
ShowPlayerDialog(giveplayeridMindReadingDIALOG_STYLE_INPUT"Your mind is being read out"result"Enter""");
   return 
1;

Define 'MindReading' at the top of your script.
OnDialogResponse should do the rest.

Edit: You used the 'r' specifier for the playerid/partofname, but you should use 'u' for that.


Re: Mind Reading Script - SteSte - 26.06.2017

Yeah I finished the script, but I never thought freezing both players, thank you I'll edit it.