[REP+] Problem with CMD
#1

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

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

it's much bettter


And please give us more information?
Reply
#3

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

dmn.. how to pawn?
Reply
#5

thanx V Rep +
Reply
#6

i cant edit names of families
Reply
#7

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

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

try it when you removed

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

i should remove this ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)