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



Help Please - Finn707 - 04.09.2012

Okay, heres what I am having trouble with:
pawn Код:
SendClientMessage(playerid, RED, "Are you sure?");
I need the server to be able to detect if you say "yes" and "No" for a conversation.
So if the player types "Yes" in the chat the server will be able to respond with another SendClientMessage.
How can I do this? (Basically I need a very basic conversation between the player and the server, just Yes and No answers)


Re: Help Please - ThePhenix - 04.09.2012

OnPlayerText


Re: Help Please - MarinacMrcina - 04.09.2012

Use this: https://sampforum.blast.hk/showthread.php?tid=374156


Re: Help Please - Finn707 - 04.09.2012

Thanks!
What Im scripting is a drivers license exam and your having a small conversation with the instructor, how can I make it so that the driving instructor will only reply if Im doing the theory exam because I dont want him to reply whenever somebody says "Yes"?


Re: Help Please - ThePhenix - 04.09.2012

Nope that tutorial won't help you.

Everybody that may say the word "Yes" will receive the same message.
I recommend you, to do a dialog.


Re: Help Please - jueix - 04.09.2012

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
OnPlayerText
put something like this under you'r drivers license system and make it a enum or somert e.g
pawn Код:
PlayerInfo[playerid][Intest] = 1
I put that code under where i start my theory test and have this under on player chat.

pawn Код:
public OnPlayerText(playerid, text[])
{
   if(!strcmp(text, "Yes", true) && PlayerInfo[playerid][Intest] == 1)    
   {  
      //your code for after yes here.
      SendClientMessageToAll(green, "Driving Instructor: Ok Next quest !"); // do what ever you want here.    
      return 0;    
   }    
   return 1;
}



Re: Help Please - Finn707 - 04.09.2012

Quote:
Originally Posted by jueix
Посмотреть сообщение
put something like this under you'r drivers license system and make it a enum or somert e.g
pawn Код:
PlayerInfo[playerid][Intest] = 1
I put that code under where i start my theory test and have this under on player chat.

pawn Код:
public OnPlayerText(playerid, text[])
{
   if(!strcmp(text, "Yes", true) && PlayerInfo[playerid][Intest] == 1)    
   {  
      //your code for after yes here.
      SendClientMessageToAll(green, "Driving Instructor: Ok Next quest !"); // do what ever you want here.    
      return 0;    
   }    
   return 1;
}
Yeah thats what I was considering, in the end I just used Dialogs, thanks anyway mate.