3 Things (maybe easy)
#1

Hello,

How I can do this:

A command where the admin can do this:
Ex: /apm 13 Please don't make unless posts.
ID 13: Admin Says: Please don't make unless posts.
Then if he want to reply back do:
/r It wasnt me it was id 12.

Tnx for your help.

2nd: I have this !admins command, can someone convert it to stmrp.
Tnx for your help.

pawn Код:
IRCCMD:admins(botid, channel[], user[], host[], params[])
{
    new str[100],name[24];
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i) && adminlevel[i] > 1)
        {
            GetPlayerName(i,name,sizeof name);
            format(str,sizeof str,"0,3Admin %s (ID:%d) (Level %d)",name,i,adminlevel[i]);
            IRC_Say(IRC_EchoConnection[0],channel,str);
        }
    }
    return 1;
}

3rd: Can some one give me a link of a nice script of /buyguns.

Really appreciate your help.
Alex.
Reply
#2

For the first thing:

Use SendClientMessage...

Second:

We can't convert when we do not know the code.

Third:

Search
Reply
#3

Quote:
Originally Posted by Hipflop
Посмотреть сообщение
For the first thing:

Use SendClientMessage...

Second:

We can't convert when we do not know the code.

Third:

Search
Post Upadted.
Btw, Can you Please show me how to do it?
(the 1st thing)
Reply
#4

Well, you need strtok if you use strcmp.

pawn Код:
if(strcmp("/apm", cmdtext, 4) == 0)
{
new tmp, tmp2, idx, string;
tmp = strtok(cmdtext[5], idx);
tmp2 = strtok(cmdtext[7], idx);
if((!strlen(tmp)) || (!strlen(tmp2)))
{
SendClientMessage(playerid, {your color}, "USAGE: /apm [playerid] [message]");
}
else
{
format(string, sizeof(string), "ID %d: Admin says: %s", tmp, tmp2);
SendClientMessage(tmp, {your color}, string);
}
return 1;
}
You need to set some extra checks like if playerid is not filled in etc etc.
But this is a begin on how to make that command
Reply
#5

Your script give me this:

pawn Код:
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(91) : warning 213: tag mismatch
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(94) : error 017: undefined symbol "strtok"
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(95) : error 017: undefined symbol "strtok"
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(96) : error 035: argument type mismatch (argument 1)
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(98) : error 017: undefined symbol "your"
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(98) : error 029: invalid expression, assumed zero
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(98) : warning 215: expression has no effect
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(98) : error 001: expected token: ";", but found ")"
C:\Users\Alex\Desktop\Otros\CodSamp\codsamp_aw\gamemodes\Untitled.pwn(98) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


7 Errors.
Reply
#6

Its not to copy it!

Its a begin, try to make it how u want....
Not in the mood to make your whole commands
Reply
#7

Which command processor do you want?
Dcmd, Zcmd or Ycmd?
Reply
#8

I've made it using zcmd and sscanf:

pawn Код:
CMD:pm(playerid, params[])
{
        new PID, pName[MAX_PLAYER_NAME];
        if(sscanf(params, "us[128]", PID, params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /pm [playerid] [message]");
        if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
        new Str[128];
        GetPlayerName(PID, pName, sizeof(pName));
        format(Str, sizeof(Str), "Admin says: %s", Sender, params);
        SendClientMessage(PID, COLOR_WHITE, Str);
    }
    else
    {
        SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
    }
    return 1;
}
Reply
#9

Tnx, Now, Can someone please convert the IRC cmd to strcmp or w/e
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)