PDA

View Full Version : Support-System


xJanx
29/07/2015, 09:21 PM
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:

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

StreetGT
29/07/2015, 09:22 PM
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;
}

xJanx
29/07/2015, 09:28 PM
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.

Mencent
29/07/2015, 09:50 PM
Hello! ;)

Try this:
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.

xJanx
29/07/2015, 10:04 PM
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. ._.

Mencent
29/07/2015, 10:11 PM
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)