/makecop [playerid] ((SOLVED))
#5

Quote:
Originally Posted by Torran
Quote:
Originally Posted by Chrham_2
Quote:
Originally Posted by Torran
A good way would be to use sscanf
Naahh.. I solved it.. It was as simple as:
pawn Код:
if(strcmp(cmdtext, "/makecop", true) == 0)
    {
        new tmp[256];
        new idx;
        new giveplayerid;
        if(IsPlayerConnected(playerid))
    {
                tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /makecop [playerid]");
            }
                        if (IsPlayerConnected(giveplayerid))
            {
              if(giveplayerid != INVALID_PLAYER_ID)
              {
                    CopMake(giveplayerid);
                    }
              }
            }
            return 1;
        }
With sscanf you could do it better and it would save alot of lines
Unfortunately I do not know about sscanf.
Reply


Messages In This Thread
/makecop [playerid] ((SOLVED)) - by Chrham_2 - 09.03.2010, 11:43
Re: /setjobcop [playerid] - by Torran - 09.03.2010, 11:47
Re: /setjobcop [playerid] - by Chrham_2 - 09.03.2010, 11:55
Re: /setjobcop [playerid] - by Torran - 09.03.2010, 11:58
Re: /setjobcop [playerid] - by Chrham_2 - 09.03.2010, 12:13
Re: /makecop [playerid] ((SOLVED)) - by aircombat - 09.03.2010, 12:30
Re: /makecop [playerid] ((SOLVED)) - by Torran - 09.03.2010, 13:47

Forum Jump:


Users browsing this thread: 1 Guest(s)