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(playerid, params[])
{
new giveplayerid;
new result[120];
if(sscanf(params, "rs[120]", giveplayerid, result))
{
SendClientMessage(playerid, COLOR_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(playerid, params[])
{
new giveplayerid, result[120];
if(sscanf(params, "us[120]", giveplayerid, result)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /(m)ind®ead [playerid/PartOfName] [message]");
TogglePlayerControllable(playerid, 1); // Freezes the playerid
TogglePlayerControllable(giveplayerid, 1); // Freezes the target
ShowPlayerDialog(giveplayerid, MindReading, DIALOG_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.