IRCCMD error
#1

PHP код:
IRCCMD:rename(botidchannel[], user[], host[], params[])
{
    if(
IRC_IsOp(botidchanneluser))
    {
        new 
playeridname[32];
        if(
sscanf(params"is[32]"playeridname))
        {
            return 
1;
        }
        new 
Query[250],string[128],ircMsg[128],length;
        
length strlen(name);
        if(
PlayerInfo[playerid][LoggedIn] == 0) return IRC_GroupSay(GroupIDchannel"4ERROR: Player should loggin to use this command on him");
          if(
length || length MAX_PLAYER_NAME+1) return IRC_GroupSay(GroupIDchannel"4ERROR: Incorrect Name Length");
          if(
IsPlayerConnected(playerid) && playerid != INVALID_PLAYER_ID) {
            
mysql_format(mysqlQuerysizeof Query,"SELECT * FROM `accounts` WHERE `Name` = '%s'",name);
            new 
Cache:result mysql_query(mysqlQuery);
            if(
cache_num_rows() >= 1) { SendClientMessage(playerid,COLOR_BRIGHTRED,"ERROR: This name is already taken!"); return cache_delete(result); }
            
cache_delete(result);
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle1]][owner], name0strlen(name), 255);
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle2]][owner], name0strlen(name), 255);
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle3]][owner], name0strlen(name), 255);
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle4]][owner], name0strlen(name), 255);
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle5]][owner], name0strlen(name), 255);
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle6]][owner], name0strlen(name), 255);
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle7]][owner], name0strlen(name), 255);
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle8]][owner], name0strlen(name), 255);
            
UpdateDynamic3DTextLabelText(hTextInfo[PlayerInfo[playerid][hID]],0xFF0000FF,name);
            
strmid(HouseInfo[PlayerInfo[playerid][hID]][Owner], name0strlen(name), 255);
            
UpdateDynamic3DTextLabelText(bizTextInfo[PlayerInfo[playerid][bID]],0xFF0000FF,name);
            
strmid(BizInfo[PlayerInfo[playerid][bID]][bOwner], name0strlen(name), 255);
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle1]][ID]);
            
mysql_tquery(mysqlQuery"""");
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle2]][ID]);
            
mysql_tquery(mysqlQuery"""");
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle3]][ID]);
            
mysql_tquery(mysqlQuery"""");
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle4]][ID]);
            
mysql_tquery(mysqlQuery"""");
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle5]][ID]);
            
mysql_tquery(mysqlQuery"""");
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle6]][ID]);
            
mysql_tquery(mysqlQuery"""");
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle7]][ID]);
            
mysql_tquery(mysqlQuery"""");
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle8]][ID]);
            
mysql_tquery(mysqlQuery"""");
            
format(Querysizeof(Query), "UPDATE `houses` SET `Owner` = '%s' WHERE `ID` = '%d'"name,HouseInfo[PlayerInfo[playerid][hID]][Houseid]);
            
mysql_tquery(mysqlQuery"""");
            
format(Querysizeof(Query),"UPDATE `bussines` SET `Owner` = '%s' WHERE `bID` = '%d'",name,BizInfo[PlayerInfo[playerid][bID]][bID]);
            
mysql_tquery(mysqlQuery"""");
            
mysql_format(mysqlQuerysizeof Query,"UPDATE `accounts` SET `Name` = '%s' WHERE `Name` = '%s'",name,pName(playerid));
            
mysql_tquery(mysqlQuery"""");
            
format(ircMsgsizeof(ircMsg), "8***IRC Administrator \"%s\" has set \"%s's\" name to \"%s\" ***"userpName(playerid), name); IRC_GroupSay(GroupIDchannelircMsg);
            
format(string,sizeof(string),"[IRC] Administrator \"%s\" has set your name to \"%s\" "username); SendClientMessage(playerid,blue,string); }
            
PlayerInfo[playerid][God] = 0;
            
SetPlayerHealth(playerid100);
            
SetPlayerName(playeridname);
            return 
OnPlayerConnect(playerid);
        } else return 
IRC_GroupSay(GroupIDchannel"4ERROR: Player is not connected");
    } else return 
IRC_GroupSay(GroupIDchannel"4ERROR: You need to be Operator to use this command"); // <<< Line 40234

Код:
D:\SA-MP Servers\SATDMv12\gamemodes\SATDMv12.pwn(40234) : error 010: invalid function or declaration
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

Which line has the error?
Reply
#3

Quote:
Originally Posted by Akeem
Посмотреть сообщение
Which line has the error?
} else return IRC_GroupSay(GroupID, channel, "4ERROR: You need to be Operator to use this command"); // <<< Line 40234
Reply
#4

Can you show lines 4023-4-5?
Reply
#5

you have an bracket remove it and it will be fixed

Код:
format(string,sizeof(string),"[IRC] Administrator \"%s\" has set your name to \"%s\" ", user, name); SendClientMessage(playerid,blue,string); }
try this
PHP код:
IRCCMD:rename(botidchannel[], user[], host[], params[]) 

    if(
IRC_IsOp(botidchanneluser)) 
    { 
        new 
playeridname[32]; 
        if(
sscanf(params"is[32]"playeridname)) 
        { 
            return 
1
        } 
        new 
Query[250],string[128],ircMsg[128],length
        
length strlen(name); 
        if(
PlayerInfo[playerid][LoggedIn] == 0) return IRC_GroupSay(GroupIDchannel"4ERROR: Player should loggin to use this command on him"); 
          if(
length || length MAX_PLAYER_NAME+1) return IRC_GroupSay(GroupIDchannel"4ERROR: Incorrect Name Length"); 
          if(
IsPlayerConnected(playerid) && playerid != INVALID_PLAYER_ID) { 
            
mysql_format(mysqlQuerysizeof Query,"SELECT * FROM `accounts` WHERE `Name` = '%s'",name); 
            new 
Cache:result mysql_query(mysqlQuery); 
            if(
cache_num_rows() >= 1) { SendClientMessage(playerid,COLOR_BRIGHTRED,"ERROR: This name is already taken!"); return cache_delete(result); } 
            
cache_delete(result); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle1]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle2]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle3]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle4]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle5]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle6]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle7]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle8]][owner], name0strlen(name), 255); 
            
UpdateDynamic3DTextLabelText(hTextInfo[PlayerInfo[playerid][hID]],0xFF0000FF,name); 
            
strmid(HouseInfo[PlayerInfo[playerid][hID]][Owner], name0strlen(name), 255); 
            
UpdateDynamic3DTextLabelText(bizTextInfo[PlayerInfo[playerid][bID]],0xFF0000FF,name); 
            
strmid(BizInfo[PlayerInfo[playerid][bID]][bOwner], name0strlen(name), 255); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle1]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle2]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle3]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle4]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle5]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle6]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle7]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle8]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `houses` SET `Owner` = '%s' WHERE `ID` = '%d'"name,HouseInfo[PlayerInfo[playerid][hID]][Houseid]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query),"UPDATE `bussines` SET `Owner` = '%s' WHERE `bID` = '%d'",name,BizInfo[PlayerInfo[playerid][bID]][bID]); 
            
mysql_tquery(mysqlQuery""""); 
            
mysql_format(mysqlQuerysizeof Query,"UPDATE `accounts` SET `Name` = '%s' WHERE `Name` = '%s'",name,pName(playerid)); 
            
mysql_tquery(mysqlQuery""""); 
            
format(ircMsgsizeof(ircMsg), "8***IRC Administrator \"%s\" has set \"%s's\" name to \"%s\" ***"userpName(playerid), name); IRC_GroupSay(GroupIDchannelircMsg); 
            
format(string,sizeof(string),"[IRC] Administrator \"%s\" has set your name to \"%s\" "username); SendClientMessage(playerid,blue,string); 
            
PlayerInfo[playerid][God] = 0
            
SetPlayerHealth(playerid100); 
            
SetPlayerName(playeridname); 
            return 
OnPlayerConnect(playerid); 
        } else return 
IRC_GroupSay(GroupIDchannel"4ERROR: Player is not connected"); 
    } else return 
IRC_GroupSay(GroupIDchannel"4ERROR: You need to be Operator to use this command"); // <<< Line 40234 

Reply
#6

Quote:
Originally Posted by Slawi
Посмотреть сообщение
you have an bracket remove it and it will be fixed

Код:
format(string,sizeof(string),"[IRC] Administrator \"%s\" has set your name to \"%s\" ", user, name); SendClientMessage(playerid,blue,string); }
try this
PHP код:
IRCCMD:rename(botidchannel[], user[], host[], params[]) 

    if(
IRC_IsOp(botidchanneluser)) 
    { 
        new 
playeridname[32]; 
        if(
sscanf(params"is[32]"playeridname)) 
        { 
            return 
1
        } 
        new 
Query[250],string[128],ircMsg[128],length
        
length strlen(name); 
        if(
PlayerInfo[playerid][LoggedIn] == 0) return IRC_GroupSay(GroupIDchannel"4ERROR: Player should loggin to use this command on him"); 
          if(
length || length MAX_PLAYER_NAME+1) return IRC_GroupSay(GroupIDchannel"4ERROR: Incorrect Name Length"); 
          if(
IsPlayerConnected(playerid) && playerid != INVALID_PLAYER_ID) { 
            
mysql_format(mysqlQuerysizeof Query,"SELECT * FROM `accounts` WHERE `Name` = '%s'",name); 
            new 
Cache:result mysql_query(mysqlQuery); 
            if(
cache_num_rows() >= 1) { SendClientMessage(playerid,COLOR_BRIGHTRED,"ERROR: This name is already taken!"); return cache_delete(result); } 
            
cache_delete(result); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle1]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle2]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle3]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle4]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle5]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle6]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle7]][owner], name0strlen(name), 255); 
            
strmid(VehicleInfo[PlayerInfo[playerid][vehicle8]][owner], name0strlen(name), 255); 
            
UpdateDynamic3DTextLabelText(hTextInfo[PlayerInfo[playerid][hID]],0xFF0000FF,name); 
            
strmid(HouseInfo[PlayerInfo[playerid][hID]][Owner], name0strlen(name), 255); 
            
UpdateDynamic3DTextLabelText(bizTextInfo[PlayerInfo[playerid][bID]],0xFF0000FF,name); 
            
strmid(BizInfo[PlayerInfo[playerid][bID]][bOwner], name0strlen(name), 255); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle1]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle2]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle3]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle4]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle5]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle6]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle7]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'"name,VehicleInfo[PlayerInfo[playerid][vehicle8]][ID]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query), "UPDATE `houses` SET `Owner` = '%s' WHERE `ID` = '%d'"name,HouseInfo[PlayerInfo[playerid][hID]][Houseid]); 
            
mysql_tquery(mysqlQuery""""); 
            
format(Querysizeof(Query),"UPDATE `bussines` SET `Owner` = '%s' WHERE `bID` = '%d'",name,BizInfo[PlayerInfo[playerid][bID]][bID]); 
            
mysql_tquery(mysqlQuery""""); 
            
mysql_format(mysqlQuerysizeof Query,"UPDATE `accounts` SET `Name` = '%s' WHERE `Name` = '%s'",name,pName(playerid)); 
            
mysql_tquery(mysqlQuery""""); 
            
format(ircMsgsizeof(ircMsg), "8***IRC Administrator \"%s\" has set \"%s's\" name to \"%s\" ***"userpName(playerid), name); IRC_GroupSay(GroupIDchannelircMsg); 
            
format(string,sizeof(string),"[IRC] Administrator \"%s\" has set your name to \"%s\" "username); SendClientMessage(playerid,blue,string); 
            
PlayerInfo[playerid][God] = 0
            
SetPlayerHealth(playerid100); 
            
SetPlayerName(playeridname); 
            return 
OnPlayerConnect(playerid); 
        } else return 
IRC_GroupSay(GroupIDchannel"4ERROR: Player is not connected"); 
    } else return 
IRC_GroupSay(GroupIDchannel"4ERROR: You need to be Operator to use this command"); // <<< Line 40234 

Thanks mate, REP+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)