SA-MP Forums Archive
irc - 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)
+--- Thread: irc (/showthread.php?tid=625764)



- Loinal - 06.01.2017

PHP код:
IRCCMD:say(botidchannel[], user[], host[], params[])
{
    if (
IRC_IsOwner(botidchanneluser))
    {
        if (!
isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02*** Owner %s on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "*** Owner %s on IRC: %s"userparams);
            
SendClientMessageToAll(0x0000FFFFmsg);
        }
    }
    else if (
IRC_IsAdmin(botidchanneluser))
    {
        if (!
isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02*** Management %s on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "*** Management %s on IRC: %s"userparams);
            
SendClientMessageToAll(0x0000FFFFmsg);
        }
    }
    else if (
IRC_IsHalfop(botidchanneluser)) // back
    
{
        if (!
isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02*** Admin %s on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "*** Admin %s on IRC: %s"userparams);
            
SendClientMessageToAll(0x0000FFFFmsg);
        }
    }
    else if (
IRC_IsVoice(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02*** %s on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "*** %s on IRC: %s"userparams);
            
SendClientMessageToAll(0x0000FFFFmsg);
        }
    }
    return 
1;

Код:
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3199) : error 001: expected token: "-string end-", but found "-identifier-"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3199) : error 001: expected token: ";", but found "["
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3201) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3203) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3207) : error 021: symbol already defined: "format"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3213) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3215) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3217) : error 021: symbol already defined: "msg"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3219) : error 021: symbol already defined: "format"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3225) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3227) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3229) : error 021: symbol already defined: "msg"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3231) : error 021: symbol already defined: "format"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3237) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3240) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3242) : error 021: symbol already defined: "msg"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3244) : error 021: symbol already defined: "format"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3250) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3258) : warning 203: symbol is never used: "connectionHandle"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3258) : warning 203: symbol is never used: "msg"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


18 Errors.
All errors from codes witch have host[],user[],channel[]

Bump

Bump again !


Re: irc - ISmokezU - 06.01.2017

error 021: symbol already defined: "msg"

Код:
IRCCMD:say(botid, channel[], user[], host[], params[]) { 
    new msg[150]; 
    if (IRC_IsOwner(botid, channel, user)) { 
        if (!isnull(params)) { 
            // Echo the formatted message 
            format(msg, sizeof(msg), "02*** Owner %s on IRC: %s", user, params); 
            IRC_GroupSay(groupID, channel, msg); 
            format(msg, sizeof(msg), "*** Owner %s on IRC: %s", user, params); 
            SendClientMessageToAll(0x0000FFFF, msg); 
        } 
    } else if (IRC_IsAdmin(botid, channel, user)) { 
        if (!isnull(params)) { 
            // Echo the formatted message 
            format(msg, sizeof(msg), "02*** Management %s on IRC: %s", user, params); 
            IRC_GroupSay(groupID, channel, msg); 
            format(msg, sizeof(msg), "*** Management %s on IRC: %s", user, params); 
            SendClientMessageToAll(0x0000FFFF, msg); 
        } 
    } else if (IRC_IsHalfop(botid, channel, user)) {//back 
        if (!isnull(params)) { 
            // Echo the formatted message 
            format(msg, sizeof(msg), "02*** Admin %s on IRC: %s", user, params); 
            IRC_GroupSay(groupID, channel, msg); 
            format(msg, sizeof(msg), "*** Admin %s on IRC: %s", user, params); 
            SendClientMessageToAll(0x0000FFFF, msg); 
        } 
    } else if (IRC_IsVoice(botid, channel, user)) { 
        // Check if the user entered any text 
        if (!isnull(params)) { 
            // Echo the formatted message 
            format(msg, sizeof(msg), "02*** %s on IRC: %s", user, params); 
            IRC_GroupSay(groupID, channel, msg); 
            format(msg, sizeof(msg), "*** %s on IRC: %s", user, params); 
            SendClientMessageToAll(0x0000FFFF, msg); 
        } 
    } return true; 
}



Re: irc - Loinal - 06.01.2017

LOOK it gives me same error enough i don't know whats ****** wrong with my codes any **** with this
PHP код:
botidchannel[], user[], host[], params[] 
Gives me same errors i don't know Why IT gives that

Try to add me skype nournasser1234


Re: irc - iLearner - 06.01.2017

You are not providing us the right code, or you you are compiling a diff file.


Re: irc - Loinal - 06.01.2017

Iam compiling the right file can you add me skype? nournasser1234 i will show you my codes because i can't post it all here


Re: irc - Vince - 06.01.2017

I don't know what line the errors are referring to, but what I will say is: don't repeat so much code. The only thing that changes is the user's title, everything else is exactly the same. Hence, it would be far more efficient to just store that title in a variable.

PHP код:
IRCCMD:say(botidchannel[], user[], host[], params[])
{
    if(
isnull(params))
        return 
1;

    new 
        
mode[2],
        
title[16] = "",
        
msg[128];
        
    
IRC_GetUserChannelMode(botidchannelusermode);
    
    switch(
mode[0])
    {
        case 
'~'title "Owner ";
        case 
'&'title "Super Op ";
        case 
'@'title "Op ";
        case 
'%'title "Half Op ";
        case 
'+'title "Voice ";
    }
    
    
format(msgsizeof(msg), "02*** %s%s on IRC: %s"titleuserparams);
    
IRC_GroupSay(groupIDchannelmsg);
    
    
format(msgsizeof(msg), "*** %s%s on IRC: %s"titleuserparams);
    
SendClientMessageToAll(0x0000FFFFmsg);

    return 
1;




Re: irc - Loinal - 06.01.2017

Look all from this: IRCCMDay(botid, channel[], user[], host[], params[])

Any code have (botid,channel[],user[],host[],params[]) gives these errors


Re: irc - Yaa - 06.01.2017

Quote:
Originally Posted by Loinal
Посмотреть сообщение
Look all from this: IRCCMDay(botid, channel[], user[], host[], params[])

Any code have (botid,channel[],user[],host[],params[]) gives these errors
this is mine (from my gamemode) and it's complie fine try it

PHP код:
IRCCMD:say(botidchannel[], user[], host[], params[])
{
    if (
IRC_IsOwner(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02Owner(%s) on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "**Owner(%s): %s"userparams);
            
SendClientMessageToAll(COLOR_BLUEmsg);
        }
        return 
1;
    }
    if (
IRC_IsAdmin(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02Manager(%s) on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "**Manager(%s): %s"userparams);
            
SendClientMessageToAll(COLOR_BLUEmsg);
        }
        return 
1;
    }
    if (
IRC_IsOp(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02Admin(%s) on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "*Admin(%s): %s"userparams);
            
SendClientMessageToAll(COLOR_BLUEmsg);
        }
        return 
1;
    }
    if (
IRC_IsHalfop(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02Moderator(%s) on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "*Moderator(%s): %s"userparams);
            
SendClientMessageToAll(COLOR_BLUEmsg);
        }
        return 
1;
    }
    
// Check if the user has at least voice in the channel
    
if (IRC_IsVoice(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02*VIP(%s) on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "VIP(%s): %s"userparams);
            
SendClientMessageToAll(COLOR_ORANGEmsg);
        }
        return 
1;
    }
    else
    {
        if (!
isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02[-] 07%s: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "[-] %s: %s"userparams);
            
SendClientMessageToAll(-1msg);
        }
        return 
1;
    }




Re: irc - iLearner - 06.01.2017

Did you #include <irc> ?


Yaa - Loinal - 06.01.2017

Quote:
Originally Posted by Yaa
Посмотреть сообщение
this is mine (from my gamemode) and it's complie fine try it

PHP код:
IRCCMD:say(botidchannel[], user[], host[], params[])
{
    if (
IRC_IsOwner(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02Owner(%s) on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "**Owner(%s): %s"userparams);
            
SendClientMessageToAll(COLOR_BLUEmsg);
        }
        return 
1;
    }
    if (
IRC_IsAdmin(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02Manager(%s) on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "**Manager(%s): %s"userparams);
            
SendClientMessageToAll(COLOR_BLUEmsg);
        }
        return 
1;
    }
    if (
IRC_IsOp(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02Admin(%s) on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "*Admin(%s): %s"userparams);
            
SendClientMessageToAll(COLOR_BLUEmsg);
        }
        return 
1;
    }
    if (
IRC_IsHalfop(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02Moderator(%s) on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "*Moderator(%s): %s"userparams);
            
SendClientMessageToAll(COLOR_BLUEmsg);
        }
        return 
1;
    }
    
// Check if the user has at least voice in the channel
    
if (IRC_IsVoice(botidchanneluser))
    {
        
// Check if the user entered any text
        
if (!isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02*VIP(%s) on IRC: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "VIP(%s): %s"userparams);
            
SendClientMessageToAll(COLOR_ORANGEmsg);
        }
        return 
1;
    }
    else
    {
        if (!
isnull(params))
        {
            new 
msg[128];
            
// Echo the formatted message
            
format(msgsizeof(msg), "02[-] 07%s: %s"userparams);
            
IRC_GroupSay(groupIDchannelmsg);
            
format(msgsizeof(msg), "[-] %s: %s"userparams);
            
SendClientMessageToAll(-1msg);
        }
        return 
1;
    }

Код:
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3183) : error 001: expected token: "-string end-", but found "-identifier-"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3183) : error 001: expected token: ";", but found "["
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3184) : error 001: expected token: "-string end-", but found "-identifier-"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3184) : error 029: invalid expression, assumed zero
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3187) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3201) : error 001: expected token: "-string end-", but found "-identifier-"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3201) : error 001: expected token: ";", but found "["
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3203) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3206) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3210) : error 021: symbol already defined: "format"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3215) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3217) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3220) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3222) : error 021: symbol already defined: "msg"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3224) : error 021: symbol already defined: "format"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3229) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3231) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3234) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3236) : error 021: symbol already defined: "msg"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3238) : error 021: symbol already defined: "format"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3243) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3245) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3248) : error 010: invalid function or declaration
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3250) : error 021: symbol already defined: "msg"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3252) : error 021: symbol already defined: "format"
D:\samp folder\(XteMeS) xMs\gamemodes\xMs.pwn(3257) : error 010: invalid function or declaration

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
bump