/setmember command
#1

pawn Код:
CMD:setmember(playerid, params[])
{
    new id;
    if(gsfmember[playerid] < 2) return SendClientMessage(playerid, 0xFF000000, "You cannot use this command");
    if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setmember [id]");
    if(request[id] == 1) return SendClientMessage(playerid, 0xFF000000, "This player is not requesting to join your organization!");
    {
        format(outp,sizeof(outp),"%s sat you as member of Grove Street Families!",PlayerName(playerid));
        SendClientMessage(id, 0xd0d18100,outp);
        format(outp,sizeof(outp),"You made %s a member of Grove Street Families!",PlayerName(id));
        SendClientMessage(playerid, 0xd0d18100,outp);
        gsfmember[id] = 1;
        request[id] = 0;
    }
    return 1;
}
well, this command sends all the messages to myself, and sets my 'gsfmember' to 1.

Whats wrong?
And how can i add so another player can use this if request[id] == 2?
Reply
#2

pawn Код:
CMD:setmember(playerid, params[])
{
    new id;
    if(gsfmember[playerid] < 2) return SendClientMessage(playerid, 0xFF000000, "You cannot use this command");
    if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setmember [id]");
    if(request[id] == 1) return SendClientMessage(playerid, 0xFF000000, "This player is not requesting to join your organization!");
    format(outp,sizeof(outp),"%s sat you as member of Grove Street Families!",PlayerName(playerid));
    SendClientMessage(id, 0xd0d18100,outp);
    format(outp,sizeof(outp),"You made %s a member of Grove Street Families!",PlayerName(id));
    SendClientMessage(playerid, 0xd0d18100,outp);
    gsfmember[id] = 1;
    request[id] = 0;
    return 1;
}
Try this, you had two extra braces.
Reply
#3

No that does not work!
Reply
#4

Bump!
Reply
#5

I am not sure if I have understood you correctly, but that's what I think should do the job.
pawn Код:
CMD:setmember(playerid, params[])
{
    new id;
    if(gsfmember[playerid] < 2) return SendClientMessage(playerid, 0xFF000000, "You cannot use this command");
    if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setmember [id]");
    if(request[id] == 1) return SendClientMessage(playerid, 0xFF000000, "This player is not requesting to join your organization!");
    if(request[id] == 2)
    {
    format(outp,sizeof(outp),"%s sat you as member of Grove Street Families!",PlayerName(playerid));
    SendClientMessage(id, 0xd0d18100,outp);
    format(outp,sizeof(outp),"You made %s a member of Grove Street Families!",PlayerName(id));
    SendClientMessage(playerid, 0xd0d18100,outp);
    gsfmember[id] = 1;
    request[id] = 0;
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Qaiis
Посмотреть сообщение
[pawn]
And how can i add so another player can use this if request[id] == 2?
if(request[id] == 1 || request[id] == 2)
Reply
#7

It does all the actions with myself. I get both messages and my gsfmember are being sat to 1.

also about the other request =2, is it something like this?
pawn Код:
CMD:setmember(playerid, params[])
{
    new id;
    if(gsfmember[playerid] < 2) return SendClientMessage(playerid, 0xFF000000, "You cannot use this command");
    if(sscanf(params,"u", id)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setmember [id]");
    if(request[id] == 1) return SendClientMessage(playerid, 0xFF000000, "This player is not requesting to join your organization!");
    {
    format(outp,sizeof(outp),"%s sat you as member of Grove Street Families!",PlayerName(playerid));
    SendClientMessage(id, 0xd0d18100,outp);
    format(outp,sizeof(outp),"You made %s a member of Grove Street Families!",PlayerName(id));
    SendClientMessage(playerid, 0xd0d18100,outp);
    gsfmember[id] = 1;
    request[id] = 0;
    } else if(request[id] == 2)
then the code here..:?

    return 1;
}
Reply
#8

pawn Код:
CMD:setmember(playerid, params[])
{
    new tmp[256], idx;
    tmp = strtok(params,idx);

    new id = strval(tmp);
    if(gsfmember[playerid] < 2) return SendClientMessage(playerid, 0xFF000000, "You cannot use this command");
    if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setmember [id]");
    if(request[id] == 1 || request[id] == 2) return SendClientMessage(playerid, 0xFF000000, "This player is not requesting to join your organization!");
    {
        format(outp,sizeof(outp),"%s sat you as member of Grove Street Families!",PlayerName(playerid));
        SendClientMessage(id, 0xd0d18100,outp);
        format(outp,sizeof(outp),"You made %s a member of Grove Street Families!",PlayerName(id));
        SendClientMessage(playerid, 0xd0d18100,outp);
        gsfmember[id] = 1;
        request[id] = 0;
    }
    return 1;
}
Reply
#9

Well, you guys dont get what i mean.

Well let me make an example:

if you are admin lvl 1, you only get a list of admin lvl 1 cmds. But if you are lvl 2 admin you get lvl 1 AND lvl 2 commands, how?
Reply
#10

Quote:
Originally Posted by HimSelf
Посмотреть сообщение
pawn Код:
CMD:setmember(playerid, params[])
{
    new tmp[256], idx;
    tmp = strtok(params,idx);

    new id = strval(tmp);
    if(gsfmember[playerid] < 2) return SendClientMessage(playerid, 0xFF000000, "You cannot use this command");
    if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFF00, "USAGE:/setmember [id]");
    if(request[id] == 1 || request[id] == 2) return SendClientMessage(playerid, 0xFF000000, "This player is not requesting to join your organization!");
    {
        format(outp,sizeof(outp),"%s sat you as member of Grove Street Families!",PlayerName(playerid));
        SendClientMessage(id, 0xd0d18100,outp);
        format(outp,sizeof(outp),"You made %s a member of Grove Street Families!",PlayerName(id));
        SendClientMessage(playerid, 0xd0d18100,outp);
        gsfmember[id] = 1;
        request[id] = 0;
    }
    return 1;
}
dosen't worsk eiter.. :c
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)