04.07.2018, 10:28
PHP код:
IRCCMD:rename(botid, channel[], user[], host[], params[])
{
if(IRC_IsOp(botid, channel, user))
{
new playerid, name[32];
if(sscanf(params, "is[32]", playerid, name))
{
return 1;
}
new Query[250],string[128],ircMsg[128],length;
length = strlen(name);
if(PlayerInfo[playerid][LoggedIn] == 0) return IRC_GroupSay(GroupID, channel, "4ERROR: Player should loggin to use this command on him");
if(length < 3 || length > MAX_PLAYER_NAME+1) return IRC_GroupSay(GroupID, channel, "4ERROR: Incorrect Name Length");
if(IsPlayerConnected(playerid) && playerid != INVALID_PLAYER_ID) {
mysql_format(mysql, Query, sizeof Query,"SELECT * FROM `accounts` WHERE `Name` = '%s'",name);
new Cache:result = mysql_query(mysql, Query);
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], name, 0, strlen(name), 255);
strmid(VehicleInfo[PlayerInfo[playerid][vehicle2]][owner], name, 0, strlen(name), 255);
strmid(VehicleInfo[PlayerInfo[playerid][vehicle3]][owner], name, 0, strlen(name), 255);
strmid(VehicleInfo[PlayerInfo[playerid][vehicle4]][owner], name, 0, strlen(name), 255);
strmid(VehicleInfo[PlayerInfo[playerid][vehicle5]][owner], name, 0, strlen(name), 255);
strmid(VehicleInfo[PlayerInfo[playerid][vehicle6]][owner], name, 0, strlen(name), 255);
strmid(VehicleInfo[PlayerInfo[playerid][vehicle7]][owner], name, 0, strlen(name), 255);
strmid(VehicleInfo[PlayerInfo[playerid][vehicle8]][owner], name, 0, strlen(name), 255);
UpdateDynamic3DTextLabelText(hTextInfo[PlayerInfo[playerid][hID]],0xFF0000FF,name);
strmid(HouseInfo[PlayerInfo[playerid][hID]][Owner], name, 0, strlen(name), 255);
UpdateDynamic3DTextLabelText(bizTextInfo[PlayerInfo[playerid][bID]],0xFF0000FF,name);
strmid(BizInfo[PlayerInfo[playerid][bID]][bOwner], name, 0, strlen(name), 255);
format(Query, sizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'", name,VehicleInfo[PlayerInfo[playerid][vehicle1]][ID]);
mysql_tquery(mysql, Query, "", "");
format(Query, sizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'", name,VehicleInfo[PlayerInfo[playerid][vehicle2]][ID]);
mysql_tquery(mysql, Query, "", "");
format(Query, sizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'", name,VehicleInfo[PlayerInfo[playerid][vehicle3]][ID]);
mysql_tquery(mysql, Query, "", "");
format(Query, sizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'", name,VehicleInfo[PlayerInfo[playerid][vehicle4]][ID]);
mysql_tquery(mysql, Query, "", "");
format(Query, sizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'", name,VehicleInfo[PlayerInfo[playerid][vehicle5]][ID]);
mysql_tquery(mysql, Query, "", "");
format(Query, sizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'", name,VehicleInfo[PlayerInfo[playerid][vehicle6]][ID]);
mysql_tquery(mysql, Query, "", "");
format(Query, sizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'", name,VehicleInfo[PlayerInfo[playerid][vehicle7]][ID]);
mysql_tquery(mysql, Query, "", "");
format(Query, sizeof(Query), "UPDATE `vehicles` SET `owner` = '%s' WHERE `id` = '%d'", name,VehicleInfo[PlayerInfo[playerid][vehicle8]][ID]);
mysql_tquery(mysql, Query, "", "");
format(Query, sizeof(Query), "UPDATE `houses` SET `Owner` = '%s' WHERE `ID` = '%d'", name,HouseInfo[PlayerInfo[playerid][hID]][Houseid]);
mysql_tquery(mysql, Query, "", "");
format(Query, sizeof(Query),"UPDATE `bussines` SET `Owner` = '%s' WHERE `bID` = '%d'",name,BizInfo[PlayerInfo[playerid][bID]][bID]);
mysql_tquery(mysql, Query, "", "");
mysql_format(mysql, Query, sizeof Query,"UPDATE `accounts` SET `Name` = '%s' WHERE `Name` = '%s'",name,pName(playerid));
mysql_tquery(mysql, Query, "", "");
format(ircMsg, sizeof(ircMsg), "8***IRC Administrator \"%s\" has set \"%s's\" name to \"%s\" ***", user, pName(playerid), name); IRC_GroupSay(GroupID, channel, ircMsg);
format(string,sizeof(string),"[IRC] Administrator \"%s\" has set your name to \"%s\" ", user, name); SendClientMessage(playerid,blue,string); }
PlayerInfo[playerid][God] = 0;
SetPlayerHealth(playerid, 100);
SetPlayerName(playerid, name);
return OnPlayerConnect(playerid);
} else return IRC_GroupSay(GroupID, channel, "4ERROR: Player is not connected");
} else return IRC_GroupSay(GroupID, channel, "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.