SA-MP Forums Archive
[REP+] Problem with CMD - 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: [REP+] Problem with CMD (/showthread.php?tid=380980)



[REP+] Problem with CMD - virusa1 - 27.09.2012

Hello all!

i have a problem with cmds.

1)
pawn Код:
/adjust name
[QUOTE]CMD:adjust(playerid, params[])
{
    if(PlayerInfo[playerid][pFMember] == 255)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You aren't in a family.");
        return 1;
    }
    new family = PlayerInfo[playerid][pFMember];
    new string[128];
    if(PlayerInfo[playerid][pRank] == 6)
    {
        new choice[32], opstring[100];
        if(sscanf(params, "s[32]S[100]", choice, opstring))
        {
            SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /adjust [name]");
            SendClientMessageEx(playerid, COLOR_WHITE, "Available Names: Name, MOTD, Safe, Invite, Uninvite");
            return 1;
        }

        if(strcmp(choice,"name",true) == 0)
        {
            if(PlayerInfo[playerid][pRank] == 6)
            {
                if(!opstring[0])
                {
                    SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /adjust name [family name]");
                    return 1;
                }
                if(strfind(opstring, "|", true) != -1)
                {
                    SendClientMessageEx(playerid, COLOR_GRAD2,  "You can't use '|' in a family name.");
                    return 1;
                }
                if(strlen(opstring) >= 40 )
                {
                    SendClientMessageEx( playerid, COLOR_GRAD1, "That family name is too long, please refrain from using more than 40 characters." );
                    return 1;
                }
                strmid(FamilyInfo[family][FamilyName], opstring, 0, strlen(opstring), 100);
                SaveFamilies();
                SendClientMessageEx(playerid, COLOR_WHITE, "You've adjusted your family's name.");
                format(string, sizeof(string), "%s adjusted family %d's name to %s", GetPlayerNameEx(playerid), family+1, opstring);
                Log("logs/family.log", string);
            }
        }

2) i need the /pm cmd

Thanx!


Re: [REP+] Problem with CMD - ikbenremco - 27.09.2012

Please use
pawn Код:
[pawn]
[/pawn]

it's much bettter


And please give us more information?


Re: [REP+] Problem with CMD - .v - 27.09.2012

pawn Код:
CMD:pm(playerid,params[])
{
    new player, msg[128], finmsg[192];
    if(sscanf(params,"rs[128]", player, msg))
    {
        SendClientMessage(playerid, RED,"Usage: /pm [PlayerID/PartOfName] [Message]");
        return 1;
    }
    if(!IsPlayerConnected(player))
    {
        SendClientMessage(playerid, RED,"Invalid PlayerID or the PlayerID is not online");
        return 1;
    }
    if(player == playerid)
    {
        SendClientMessage(playerid, RED, "You can't PM yourself");
        return 1;
    }
    format(finmsg,sizeof(finmsg),"***[PM] from %s(%d): %s", GetName(playerid), playerid, msg);
    SendClientMessage(player, 0xFF7F50FF, finmsg);
    format(finmsg,sizeof(finmsg),">>>[PM] to %s(%d): %s", GetName(player), player, msg);
    SendClientMessage(playerid, 0xFF7F50FF, finmsg);
    return 1;
}



Re: [REP+] Problem with CMD - virusa1 - 27.09.2012

dmn.. how to pawn?


Re: [REP+] Problem with CMD - virusa1 - 27.09.2012

thanx V Rep +


Re: [REP+] Problem with CMD - virusa1 - 27.09.2012

i cant edit names of families


Re: [REP+] Problem with CMD - ikbenremco - 27.09.2012

Do you got lvl 6 rank of that family/faction?


Re: [REP+] Problem with CMD - virusa1 - 27.09.2012

i am the owner of the server and yes i am when i do : /adjust name "test" it gives me /adjust [name]


Re: [REP+] Problem with CMD - ikbenremco - 28.09.2012

try it when you removed

pawn Код:
if(!opstring[0])
                {
                    SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /adjust name [family name]");
                    return 1;
                }
just /* and */ it


Re: [REP+] Problem with CMD - virusa1 - 28.09.2012

i should remove this ?