/helpchat and /endhelpchat only for ID 0 -
lulo356 - 09.02.2015
This command works only for ID 0 what do i need to do
pawn Код:
CMD:helpchat(playerid, params[])
{
static
userid,
text[128];
if (sscanf(params, "s[128]", text))
return SendSyntaxMessage(playerid, "/helpchat [message]");
if(ahelpchat[playerid] == 0)
return SendErrorMessage(playerid, "You are not in a chat with an staff member");
if(ahelpchat[playerid] == 1)
SendClientMessageEx(userid, COLOR_YELLOW, "(( Helpchat %s: %s ))", ReturnName(playerid, 0), text);
SendClientMessageEx(playerid, COLOR_YELLOW, "(( Helpchat %s: %s ))", ReturnName(userid, 0), text);
return 1;
}
CMD:endhelpchat(playerid, params[])
{
static
userid;
if(!PlayerData[playerid][pAdmin] && !PlayerData[playerid][pHelper] && !PlayerData[playerid][pMod])
return SendErrorMessage(playerid, "You are not an staff member");
ahelpchat[userid] = 0;
ahelpchat[playerid] = 0;
SendClientMessageEx(userid, COLOR_YELLOW, "Staff Member %s has ended the HelpChat", ReturnName(playerid, 0));
SendClientMessageEx(playerid, COLOR_YELLOW, "You have ended the HelpChat between you and %s", ReturnName(userid, 0));
return 1;
}
Re: /helpchat and /endhelpchat only for ID 0 -
Jefff - 10.02.2015
sscanf(params, "us[128]", userid, text)
Re: /helpchat and /endhelpchat only for ID 0 -
lulo356 - 10.02.2015
Quote:
Originally Posted by Jefff
sscanf(params, "us[128]", userid, text)
|
No No, its an chat where an staff member and an player can talk about his or her issue you know
Re: /helpchat and /endhelpchat only for ID 0 -
Jefff - 10.02.2015
static userid; is always 0 because you don't use it
Re: /helpchat and /endhelpchat only for ID 0 -
Kar - 10.02.2015
You want it to be one admin, or all admins?
Re: /helpchat and /endhelpchat only for ID 0 -
lulo356 - 10.02.2015
Quote:
Originally Posted by Kar
You want it to be one admin, or all admins?
|
to one staff member
Quote:
Originally Posted by Jefff
static userid; is always 0 because you don't use it
|
even when i do new instand of static it will be only for id 0
Re: /helpchat and /endhelpchat only for ID 0 -
lulo356 - 10.02.2015
Is there an way to fix it.
Re: /helpchat and /endhelpchat only for ID 0 -
Sime30 - 10.02.2015
So it's a conversation only between 2 players right?
But where did you start a conversation with a desired player?
You need to do something like /helpchatstart [Id player/name] in which you will add a new global
variable[MAX_PLAYERS] (An ID of desired player to be stored in a variable) with whom you will talk. Then using /helpchat will send a message to the desired player using your variable (We stored an ID , remember) and /endhelpchat will put variable[playerid] = -1; (Use -1 because no one can use that ID)
EDIT: Also, put
variable[playerid] = -1; OnPlayerConnect
Re: /helpchat and /endhelpchat only for ID 0 -
lulo356 - 11.02.2015
Quote:
Originally Posted by Sime30
So it's a conversation only between 2 players right?
But where did you start a conversation with a desired player?
You need to do something like /helpchatstart [Id player/name] in which you will add a new global variable[MAX_PLAYERS] (An ID of desired player to be stored in a variable) with whom you will talk. Then using /helpchat will send a message to the desired player using your variable (We stored an ID , remember) and /endhelpchat will put variable[playerid] = -1; (Use -1 because no one can use that ID)
EDIT: Also, put variable[playerid] = -1; OnPlayerConnect
|
i have already somting likenthat as you see but its still not working what i just want is that an staaf member can talk to an other player like /pm bit without the id
Re: /helpchat and /endhelpchat only for ID 0 -
lulo356 - 11.02.2015
bump