SA-MP Forums Archive
code does nothing - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: code does nothing (/showthread.php?tid=70332)



code does nothing - CJ101 - 23.03.2009

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



Re: code does nothing - FUNExtreme - 23.03.2009

You have to be RCON admin to use it.


Re: code does nothing - tom_jonez - 23.03.2009

http://pawn.pastebin.com/m517dfeb0


Re: code does nothing - LarzI - 23.03.2009

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;
}



Re: code does nothing - MenaceX^ - 23.03.2009

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)


Re: code does nothing - LarzI - 23.03.2009

You mean the EOS part?
Monkey see, monkey do


Re: code does nothing - CJ101 - 23.03.2009

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.


Re: code does nothing - LarzI - 23.03.2009

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;
}



Re: code does nothing - pen_theGun - 23.03.2009

.


Re: code does nothing - pen_theGun - 24.03.2009

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