code does nothing
#1

Код:
	if(strcmp(cmdtext, "/atalk", true) == 0) {
 	if (IsPlayerAdmin(playerid))
 	{
 	new string[256];
	format(string, 256, "[!] %s ",cmdtext[4]);
	SendClientMessageToAll(GetPlayerColor(playerid), string);
	}
	return 1;
	}
Reply
#2

You have to be RCON admin to use it.
Reply
#3

http://pawn.pastebin.com/m517dfeb0
Reply
#4

My version of it

pawn Код:
if(!strcmp(cmdtext, "/atalk", true))
{
    if(IsPlayerAdmin(playerid) && cmdtext[6] != EOS)
    {
        new
            string[128];
        format(string, 128, "[!] %s ", cmdtext[7]);
        return SendClientMessageToAll(GetPlayerColor(playerid), string);
    }
    return 0;
}
Reply
#5

Quote:
Originally Posted by lrZ^
My version of it

pawn Код:
if(!strcmp(cmdtext, "/atalk", true))
{
    if(IsPlayerAdmin(playerid) && cmdtext[6] != EOS)
    {
        new
            string[128];
        format(string, 128, "[!] %s ", cmdtext[7]);
        return SendClientMessageToAll(GetPlayerColor(playerid), string);
    }
    return 0;
}
Nice one but too bad that probably the idea is of Nero_3D (As I remember a few days ago with this code, I thought you made it and I was wrong)
Reply
#6

You mean the EOS part?
Monkey see, monkey do
Reply
#7

Quote:
Originally Posted by lrZ^
My version of it

pawn Код:
if(!strcmp(cmdtext, "/atalk", true))
{
    if(IsPlayerAdmin(playerid) && cmdtext[6] != EOS)
    {
        new
            string[128];
        format(string, 128, "[!] %s ", cmdtext[7]);
        return SendClientMessageToAll(GetPlayerColor(playerid), string);
    }
    return 0;
}
code still does nothing. Yea, im logged in as rcon.
Reply
#8

pawn Код:
if(!strcmp(cmdtext, "/atalk", true))
{
    if(IsPlayerAdmin(playerid))
    {
        if(cmdtext[6] != 32 || cmdtext[7] == EOS)       //just a check
            return SendClientMessage(playerid, COLOR_RED, "USAGE: /atalk [message]");
        new
            string[128];
        format(string, 128, "[!] %s ", cmdtext[7]);
        return SendClientMessageToAll(GetPlayerColor(playerid), string);
    }
    return 0;
}
Reply
#9

.
Reply
#10

Quote:
Originally Posted by pen_†ĥęGun
Код:
if(!strcmp(cmdtext, "/atalk", true, 6))
https://sampwiki.blast.hk/wiki/Strcmp

Quote:
Originally Posted by wiki
(6) When this length is set, the first x chars will be compared - doing "/atalk" and "/atalkahaha" with a length of 6 will say it's the same string
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)