/helpchat and /endhelpchat only for ID 0
#1

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

sscanf(params, "us[128]", userid, text)
Reply
#3

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
Reply
#4

static userid; is always 0 because you don't use it
Reply
#5

You want it to be one admin, or all admins?
Reply
#6

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

Is there an way to fix it.
Reply
#8

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
Reply
#9

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
Reply
#10

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)