SA-MP Forums Archive
/setmember command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /setmember command (/showthread.php?tid=422158)



/setmember command - Qaiis - 12.03.2013

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?


Re: /setmember command - Denying - 12.03.2013

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.


Re: /setmember command - Qaiis - 12.03.2013

No that does not work!


Re: /setmember command - Qaiis - 13.03.2013

Bump!


Re: /setmember command - zxc1 - 13.03.2013

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



Re: /setmember command - HimSelf - 13.03.2013

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)


Re: /setmember command - Qaiis - 13.03.2013

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



Re: /setmember command - HimSelf - 13.03.2013

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



Re: /setmember command - Qaiis - 13.03.2013

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?


Re: /setmember command - Qaiis - 13.03.2013

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