Mind Reading Script
#1

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.
Reply
#2

https://sampwiki.blast.hk/wiki/ShowPlayerDialog
https://sampwiki.blast.hk/wiki/OnDialogResponse
Reply
#3

xplain further.
Reply
#4

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

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.
Reply
#8

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
Reply
#9

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.
Reply
#10

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


Forum Jump:


Users browsing this thread: 2 Guest(s)