PDA

View Full Version : IRC Bot problem [Rep +]


Zhoom
16/01/2012, 10:47 AM
Hello guys, how can I do something like this on IRC:


enum PlayerData
{
Test,
};
new PlayerInfo[MAX_PLAYERS][PlayerData];

I added this under my IRCCMD:slap
PlayerInfo[user][Test] = 0;


I tried this and failed :(
im using incognito's irc plugin

help me guys! + rep

Zhoom
16/01/2012, 10:55 AM
and if this script is not possible to work, can you guys tell me how to script it so that the functions will be the same

Zhoom
16/01/2012, 01:18 PM
*Bump*
what should I replace [MAX_PLAYERS] with?
on IRC for 'user'

Konstantinos
16/01/2012, 01:43 PM
new
PlayerInfo[ MAX_PLAYERS ][ PlayerData ];

// ---

IRCCMD:test(botid, channel[], user[], host[], params[])
{
PlayerInfo[user][Test] = 0;
return 1;
}
// ---
IRCCMD:test2(botid, channel[], user[], host[], params[])
{
if(PlayerInfo[user][Test] == 0)
{
IRC_GroupNotice(gGroupID, user, "It works!");
}
return 1;
}

Zhoom
16/01/2012, 02:16 PM
error 033: array must be indexed (variable "user")


help me please :(

Konstantinos
16/01/2012, 02:19 PM
Line?

Zhoom
16/01/2012, 02:26 PM
both of these:
PlayerInfo[user][Test] = 0;

[ABK]Antonio
16/01/2012, 02:29 PM
What exactly do you need it for?

Min
16/01/2012, 02:30 PM
well I want to make a user can only use this command 3 times.

EDITED:
P.S: Zhoom is my little cousin, he was using my laptop to post this. *facepalm*

thimo
16/01/2012, 02:33 PM
PlayerInfo[user][Test]++; // Everytime used variable will count 1 to old variable
Under command test 2

if(PlayerInfo[user][Test] == 3)
{
return 0;
}

Konstantinos
16/01/2012, 02:34 PM
new CMDSString[1048], FALSE = false;
// By Garsino
#define IRC_GroupNoticeEx(%0,%1,%2,%3) do{CMDSString = ""; format(CMDSString, sizeof(CMDSString), %2, %3); IRC_GroupNotice(%0, %1, CMDSString);}while(FALSE)

// ---
IRC_GroupNoticeEx(gGroupID, user, "Message");

Zhoom
16/01/2012, 02:54 PM
well I want to make a user can only use this command 3 times.

EDITED:
P.S: Zhoom is my little cousin, he was using my laptop to post this. *facepalm*

lol sorry Min i forgot to logout ur acc xD

ok dwane that is not the problem, it happens on this line:


PlayerInfo[user][Test] = 0;
and
if(PlayerInfo[user][Test] == 0)

linuxthefish
16/01/2012, 02:57 PM
Offering rep is a low way to get help...