Help Please
#1

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

OnPlayerText
Reply
#3

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

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"?
Reply
#5

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

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;
}
Reply
#7

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


Forum Jump:


Users browsing this thread: 4 Guest(s)