SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/10/2011, 06:59 AM   #1
DriftboyZ
Big Clucker
 
DriftboyZ's Avatar
 
Join Date: Feb 2010
Location: New Delhi, India
Posts: 110
Reputation: 20
Default Small Problem

Hello, need little help here. I have a /helpme command which shows the dialog, player can type problem and send it to admin. But for some reason when player types i am not receiving the text. Any can tell what maybe the problem?


Dialog
Code:
if(strcmp(cmd, "/helpme", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if(Mute[playerid] == 1)
			{
				SendClientMessage(playerid, TEAM_CYAN_COLOR, "   You can't speak, you have been silenced !");
				return 1;
	        }
	        else
			{
			    if (Requesting_Help[playerid] == 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "Warning: You already have one helpme request waiting for response!");
			    if (HelperTimer[playerid] > 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Warning: You have to wait before submitting another Help Request!");
				new helpmediatext[500];
				format(helpmediatext, sizeof(helpmediatext), "You are requesting help, please do the following:\n -Write down your problem/question; \n -Your question must be clear; \n -Your question must be easy to read.");
  				ShowPlayerDialog(playerid, DIALOG_HELPME, DIALOG_STYLE_INPUT, "Help Request", helpmediatext, "Send", "Cancel");
				return 1;
			}


	    }
	    return 1;
	}


Dialog Response

Code:
if(dialogid == DIALOG_HELPME)
    {
        if(response == 1)
        {
    		if(strlen(inputtext) > 8)
     		{
     			new helpmetext[128];


				Requesting_Help[playerid] = 1;
				format(helpmetext, sizeof(helpmetext),"%s(ID:%i) is requesting help:%s",PlayerName(playerid),playerid,inputtext);
				SendHelperMessage(COLOR_RED, helpmetext);
				SendHelperMessage(COLOR_RED, "Type /ahm to accept his help request.");
				HelperTimer[playerid] = 60;




			}
			else
			{
				SendClientMessage(playerid,COLOR_LIGHTRED, "ERROR: Your message is too short, it must contain at least 8 characters");
  		 	}
  		 }
       	if(response == 0)
       	 {
       	     SendClientMessage(playerid, COLOR_RED, "Action Canceled");
       	     return 1;
       	 }
DriftboyZ is offline   Reply With Quote
Old 04/10/2011, 07:01 AM   #2
Wesley221
High-roller
 
Wesley221's Avatar
 
Join Date: Apr 2011
Posts: 1,564
Reputation: 715
Default Re: Small Problem

pawn Code:
SendHelperMessage(Color, Text[])
{
    foreach(Player, i)
    {
        if( IsPlayerHelper( i ) )
        {
            SendClientMessage( i, Color, Text );
        }
    }
    return 0;
}
Does your helper function looks like this?
__________________
yes
Wesley221 is offline   Reply With Quote
Old 04/10/2011, 07:03 AM   #3
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 933
Reputation: 143
Default Re: Small Problem

are you logged in as admin or what ever?show SendHelperMessage function
and little cleaner code:
pawn Code:
if(dialogid == DIALOG_HELPME)
{
    if(!response) return 0;
    if(strlen(inputtext) < 8) return SendClientMessage(playerid,COLOR_LIGHTRED, "ERROR: Your message is too short, it must contain at least 8 characters");
    new helpmetext[128];
    Requesting_Help[playerid] = 1;
    format(helpmetext, sizeof(helpmetext),"%s(ID:%i) is requesting help:%s",PlayerName(playerid),playerid,inputtext);
    SendHelperMessage(COLOR_RED, helpmetext);
    SendHelperMessage(COLOR_RED, "Type /ahm to accept his help request.");
    HelperTimer[playerid] = 60;
}
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!
System64 is offline   Reply With Quote
Old 04/10/2011, 07:03 AM   #4
GrimR
Huge Clucker
 
Join Date: Sep 2011
Location: Sydney
Posts: 209
Reputation: 14
Default Re: Small Problem

Why don't you just have them do /helpme text and pull the text out and
send/admin broadcast it, then you dont need to worry about showing and interpreting dialog.
GrimR is offline   Reply With Quote
Old 04/10/2011, 07:06 AM   #5
System64
Gangsta
 
System64's Avatar
 
Join Date: May 2011
Location: Zadar, Croatia
Posts: 933
Reputation: 143
Default Re: Small Problem

Quote:
Originally Posted by GrimR View Post
Why don't you just have them do /helpme text and pull the text out and
send/admin broadcast it, then you dont need to worry about showing and interpreting dialog.
Maybe because thye can't spam with /helpme, than they must type it in dialog again and again (if they want spam)
also give /ahm command here
__________________
All my works
I left SA:MP! Maybe once I start scripting again but now I'm based on web programming
Soon, I'll buy domain system32.com.hr but for now you can contact me on LogoOff or on my Youtube channel!
System64 is offline   Reply With Quote
Old 04/10/2011, 07:08 AM   #6
GrimR
Huge Clucker
 
Join Date: Sep 2011
Location: Sydney
Posts: 209
Reputation: 14
Default Re: Small Problem

They should have spam prevention in place anyway lol
GrimR is offline   Reply With Quote
Old 04/10/2011, 07:13 AM   #7
DriftboyZ
Big Clucker
 
DriftboyZ's Avatar
 
Join Date: Feb 2010
Location: New Delhi, India
Posts: 110
Reputation: 20
Default Re: Small Problem

Oh my... -__- I am so stupid, i forgot its a SendHelperMessage function.. it sends it to available Helpers and not admin...

I am logged in as Admin. Thanks anyways guys :P
DriftboyZ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A very small npc problem Davz*|*Criss Help Archive 4 04/08/2011 01:20 PM
Small Problem ionaustinb Help Archive 6 11/07/2011 06:51 PM
Small problem Swiftz Help Archive 3 11/04/2011 01:11 AM
Help - small problem? NewYorkRP Help Archive 10 29/11/2010 08:06 PM


All times are GMT. The time now is 08:12 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.