SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 29/07/2015, 09:21 PM   #1
xJanx
Little Clucker
 
Join Date: Mar 2014
Posts: 3
Reputation: 0
Default Support-System

Hey guys, i hope you can help me with the Support-System.
I cant write as Support with /sup, i don't know why. I want to make a command: /asup for Support.
But i don't know how i do this. I hope you can help me.

Here is the code:

Code:
COMMAND:sup(playerid,params[])
{
	new text[256];
	if(sscanf(params,"s[128]",text))
	{
		SendClientMessage(playerid, COLOR_GREY,"* /sup [Message]");
	}
	else
	{
		if(TicketAnwered[playerid] == 0)
		{
			SendClientMessage(playerid, COLOR_GREY,"You aren not in a active report at the moment!");
		}
		else
		if(TicketAnswered[playerid] == 1)
		{
			new pID = YourSupport[playerid];
			new answer[128], answer2[128], TheQuestion[MAX_PLAYER_NAME], TheSupport[MAX_PLAYER_NAME];
			GetPlayerName(playerid, TheQuestion, sizeof (TheQuestion));
			GetPlayerName(pID, TheSupport, sizeof (TheSupport));
			format(answer, sizeof (answer),"--> %s", text);
			SendClientMessage(playerid, COLOR_YELLOW, answer);
			format(answer2, sizeof (answer2), "%s writes: %s", TheQuestion, text);
			SendClientMessage(pID, COLOR_YELLOW, answer2);
		}
	}
	return 1;
}
xJanx is offline   Reply With Quote
Old 29/07/2015, 09:22 PM   #2
StreetGT
Banned
 
Join Date: Dec 2008
Location: Portugal
Posts: 1,034
Reputation: 108
Default Re: Support-System

pawn Code:
COMMAND:asup(playerid,params[])
{
    new text[256];
    if(sscanf(params,"s[128]",text))
    {
        SendClientMessage(playerid, COLOR_GREY,"* Benutzung: /asup [Nachricht]");
    }
    else
    {
        if(TicketAngenommen[playerid] == 0)
        {
            SendClientMessage(playerid, COLOR_GREY,"Du bist in keinem aktivem Report!");
        }
        else
        if(TicketAngenommen[playerid] == 1)
        {
            new pID = DeinSupport[playerid];
            new antwort[128], antwort2[128], DerFragende[MAX_PLAYER_NAME], DerSup[MAX_PLAYER_NAME];
            GetPlayerName(playerid, DerFragende, sizeof (DerFragende));
            GetPlayerName(pID, DerSup, sizeof (DerSup));
            format(antwort, sizeof (antwort),"--> %s", text);
            SendClientMessage(playerid, COLOR_YELLOW, antwort);
            format(antwort2, sizeof (antwort2), "%s schrieb: %s", DerFragende, text);
            SendClientMessage(pID, COLOR_YELLOW, antwort2);
        }
    }
    return 1;
}
StreetGT is offline   Reply With Quote
Old 29/07/2015, 09:28 PM   #3
xJanx
Little Clucker
 
Join Date: Mar 2014
Posts: 3
Reputation: 0
Default Re: Support-System

Sorry for the german code at the begining. I don't see it so fast xD I wrote it now in english that u understand the text. I hope you can help me now.

@StreetGT

No. I already do this. When i do that and i wrote the command SAMP don't send a message to the player. I think it was a problem with this ID's....
I don't know how to change that.
xJanx is offline   Reply With Quote
Old 29/07/2015, 09:50 PM   #4
Mencent
High-roller
 
Mencent's Avatar
 
Join Date: Mar 2015
Location: Lower Saxony (Niedersachsen)
Posts: 1,314
Reputation: 92
Default AW: Support-System

Hello!

Try this:
PHP Code:
COMMAND:sup(playerid,params[])
{
    new 
text[128];
    if(
sscanf(params,"s[128]",text))return SendClientMessage(playerid,COLOR_GREY,"* /sup [Message]");
    if(
TicketAnswered[playerid]== 0)return SendClientMessage(playerid,COLOR_GREY,"You aren't in a active report at the moment!");
    new 
pID YourSupport[playerid],answer[145],names[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,names,MAX_PLAYER_NAME);
    
format(answer,sizeof answer,"--> %s",text);
    
SendClientMessage(playerid,COLOR_YELLOW,answer);
    
format(answer,sizeof answer,"%s writes: %s",names,text);
    
SendClientMessage(pID,COLOR_YELLOW,answer);
    return 
1;
}
COMMAND:asup(playerid,params[])
{
    new 
text[128];
    if(
sscanf(params,"s[128]",text))return SendClientMessage(playerid,COLOR_GREY,"* Benutzung: /asup [Nachricht]");
    if(
TicketAngenommen[playerid] == 0)return SendClientMessage(playerid,COLOR_GREY,"Du bist in keinem aktiven Report!");
    new 
pID DeinSupport[playerid],antwort[145],names[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,names,MAX_PLAYER_NAME);
    
format(antwort,sizeof antwort,"--> %s",text);
    
SendClientMessage(playerid,COLOR_YELLOW,antwort);
    
format(antwort,sizeof antwort,"%s schrieb: %s",names,text);
    
SendClientMessage(pID,COLOR_YELLOW,antwort);
    return 
1;

If it doesn't work you should give us information about what doesn't work.
__________________
Best wishes,
Mencent

(Sorry for my bad english, I hope you can understand this!)
Mencent is offline   Reply With Quote
Old 29/07/2015, 10:04 PM   #5
xJanx
Little Clucker
 
Join Date: Mar 2014
Posts: 3
Reputation: 0
Default Re: Support-System

I do this. Now i don't can use /asup but my friend can use it. We are the 2 owner's but why he can use it and i not? I receive his messages but i cant do any command of this 2 when i am at the report. ._.
xJanx is offline   Reply With Quote
Old 29/07/2015, 10:11 PM   #6
Mencent
High-roller
 
Mencent's Avatar
 
Join Date: Mar 2015
Location: Lower Saxony (Niedersachsen)
Posts: 1,314
Reputation: 92
Default AW: Support-System

PHP Code:
COMMAND:sup(playerid,params[])
{
    new 
text[128];
    if(
sscanf(params,"s[128]",text))return SendClientMessage(playerid,COLOR_GREY,"* /sup [Message]");
    
printf("TicketAnswered[%i] == %i",playerid,TicketAnswered[playerid]);
    if(
TicketAnswered[playerid]== 0)return SendClientMessage(playerid,COLOR_GREY,"You aren't in a active report at the moment!");
    new 
pID YourSupport[playerid],answer[145],names[MAX_PLAYER_NAME];
    
printf("YourSupport[%i] = %i",playerid,pID);
    
GetPlayerName(playerid,names,MAX_PLAYER_NAME);
    
format(answer,sizeof answer,"--> %s",text);
    
SendClientMessage(playerid,COLOR_YELLOW,answer);
    
format(answer,sizeof answer,"%s writes: %s",names,text);
    
SendClientMessage(pID,COLOR_YELLOW,answer);
    return 
1;
}
COMMAND:asup(playerid,params[])
{
    new 
text[128];
    if(
sscanf(params,"s[128]",text))return SendClientMessage(playerid,COLOR_GREY,"* Benutzung: /asup [Nachricht]");
    
printf("TicketAngenommen[%i] == %i",playerid,TicketAngenommen[playerid]);
    if(
TicketAngenommen[playerid] == 0)return SendClientMessage(playerid,COLOR_GREY,"Du bist in keinem aktiven Report!");
    new 
pID DeinSupport[playerid],antwort[145],names[MAX_PLAYER_NAME];
    
printf("DeinSupport[%i] = %i",playerid,pID);
    
GetPlayerName(playerid,names,MAX_PLAYER_NAME);
    
format(antwort,sizeof antwort,"--> %s",text);
    
SendClientMessage(playerid,COLOR_YELLOW,antwort);
    
format(antwort,sizeof antwort,"%s schrieb: %s",names,text);
    
SendClientMessage(pID,COLOR_YELLOW,antwort);
    return 
1;

What is printing if their used this commands? (in the server.log)
__________________
Best wishes,
Mencent

(Sorry for my bad english, I hope you can understand this!)
Mencent 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
[Include] Cyanide's Inventory System (Saving, and Loading Support | Great for Roleplay | Descriptions) Cyanide Includes 11 24/08/2017 06:41 PM
[Include] Cyanide's Gang Spray/Tag System (Plug n' Play | Saving, Loading, & Crouching Support) Cyanide Includes 81 25/07/2013 08:25 PM
[FilterScript] Register/Login System [SIMPLE] (y_ini + whirlpool + zcmd) - with Antijetpack Hack support! JaKe Elite Filterscripts 21 20/07/2012 01:07 PM
Need your support! NuggaN_ Everything and Nothing 3 09/07/2011 12:20 PM
[Include] [INC] Language System (nine languages support) - !No developer, no script! Luka P. Includes 34 17/01/2010 03:05 PM


All times are GMT. The time now is 03:09 AM.


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