16.12.2016, 15:26
(
Последний раз редактировалось Younes44; 16.12.2016 в 16:01.
)
Hi..
i'm still learning mysql so don't judge me :P ( i'm ini scripter )
anyway
well.. is there wrong with my codes -_-
Line: 1243
Full code:
And line 26711:
full code:
i'm still learning mysql so don't judge me :P ( i'm ini scripter )
anyway
PHP код:
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(1243) : error 076: syntax error in the expression, or invalid function call
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(1246) : error 076: syntax error in the expression, or invalid function call
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26693) : warning 235: public function lacks forward declaration (symbol "Banip")
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26706) : warning 235: public function lacks forward declaration (symbol "BanCheck")
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26711) : error 012: invalid function call, not a valid address
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26711) : warning 215: expression has no effect
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26711) : error 001: expected token: ";", but found ")"
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26711) : error 029: invalid expression, assumed zero
C:\Users\PC\Desktop\Younes\-\Nouveau doss4ier\mysql.pwn(26711) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
7 Errors.
Line: 1243
PHP код:
PlayerInfo[i][Time] += 1;
Код:
public PlayersData() { foreach (new i : Player) { if(IsPlayerConnected(i)) { PlayerInfo[i][Time] += 1; if(PlayerInfo[i][Registered] == 1 && PlayerInfo[i][LoggedIn] == 1) { new Query[250]; format(Query, sizeof(Query),"UPDATE `accounts` SET `Score` = '%d',`Money` = '%d',`TimeOnServer` = '%d' WHERE `Name` = '%s'",GetPlayerScore(i),GetPlayerMoney(i),PlayerInfo[i][Time],pName(i)); mysql_tquery(mysql, Query, "", ""); } } } }
PHP код:
format(Query, sizeof(Query),"UPDATE `banneds` SET `ip` = '%s' WHERE `name` = '%s'",pIP(playerid),pName(playerid));
PHP код:
public BanCheck(playerid) {
new rows, fields,ibanned[10][2],ifbanned[2],save[4][80],Query[250];
cache_get_data(rows, fields, mysql);
if(rows)
{
format(Query, sizeof(Query),"UPDATE `banneds` SET `ip` = '%s' WHERE `name` = '%s'",pIP(playerid),pName(playerid));
mysql_tquery(mysql, Query, "", "");
cache_get_field_content(0, "banned", ibanned[0], mysql, 10);
ifbanned[0] = strval(ibanned[0]);
if(ifbanned[0] == 1) {
cache_get_field_content(0, "date", save[0], mysql, 80);
cache_get_field_content(0, "time", save[1], mysql, 80);
cache_get_field_content(0, "bannedby", save[2], mysql, 80);
cache_get_field_content(0, "reason", save[3], mysql, 80);
new str[550],content[128]; format(content,sizeof content,"%s %s",save[0],save[1]);
format(str, sizeof(str),"{C0C0C0}Your Account's currently Banned.\n\n{00FFFF}In-Game Name: {33FF33}%s\n{00FFFF}Administrator: {33FF33}%s\n{00FFFF}Date: {33FF33}%s\n{00FFFF}Reason: {33FF33}%s\n{C0C0C0}* if you think that you're banned wrongfully,\n feel free to make unban appeal on our forum: \n forum link: coming soon",pName(playerid),save[2],content,save[3]);
ShowPlayerDialog(playerid, 801, DIALOG_STYLE_MSGBOX, "{FF0000}You Are Banned!", str, "Close","");
SetTimerEx("kickplayer", 3000, false, "i", playerid);
return 1;
} else if(ifbanned[0] == 0) {
cache_get_field_content(0, "tempban", ibanned[1], mysql, 10);
ifbanned[1] = strval(ibanned[1]);
if(ifbanned[1] == 1) {
new whatdate;
whatdate = cache_get_field_content_int(0,"bdate",mysql);
new Year,Month,Day,tempbandate[3],string;
getdate(Year, Month, Day);
tempbandate[0] = 60 * 60 * 24 * Year;
tempbandate[1] = 60 * 60 * 24 * 30 * Month;
tempbandate[2] = 60 * 60 * 24 * Day;
string = tempbandate[0]+tempbandate[1]+tempbandate[2];
if(whatdate - string <= 0) {
format(Query, sizeof(Query),"UPDATE `banneds` SET `tempban` = 0,`bannedby` = %d,`reason` = %d WHERE `name` = '%s'",0,0,pName(playerid));
mysql_tquery(mysql, Query, "", "");
format(Query, 100, "DELETE FROM `bannedips` WHERE `ip` = '%s'",pIP(playerid));
mysql_tquery(mysql, Query, "", "");
return SendClientMessage(playerid, 0x33FF33AA,"Ban BOT: |- Your Ban Has been Expired -|");
}
new saves[3][128],by[128],expire;
cache_get_field_content(0, "date", saves[0], mysql, 128);
cache_get_field_content(0, "time", saves[1], mysql, 128);
cache_get_field_content(0, "reason", saves[2], mysql, 128);
cache_get_field_content(0, "bannedby", by, mysql, 128);
expire = cache_get_field_content_int(0, "bdate",mysql);
new str[550],content[128]; format(content,sizeof content,"%s %s",saves[0],saves[1]);
expire -= string;
expire /= 86400;
if(expire == 1) {
format(str, sizeof(str),"{C0C0C0}Your Account's currently Banned.\n\n{00FFFF}In-Game Name: {33FF33}%s\n{00FFFF}Administrator: {33FF33}%s\n{00FFFF}Date: {33FF33}%s\n{00FFFF}Reason: {33FF33}%s\n{00FFFF}Ban Expire After: {33FF33}%d Day\n{C0C0C0}* if you think that you're banned wrongfully,\n feel free to make unban appeal on our forum: \n forum link: comingsoon"\
,pName(playerid),by,content,saves[2],expire);
}
if(expire > 1) {
format(str, sizeof(str),"{C0C0C0}Your Account's currently Banned.\n\n{00FFFF}In-Game Name: {33FF33}%s\n{00FFFF}Administrator: {33FF33}%s\n{00FFFF}Date: {33FF33}%s\n{00FFFF}Reason: {33FF33}%s\n{00FFFF}Ban Expire After: {33FF33}%d Days\n{C0C0C0}* if you think that you're banned wrongfully,\n feel free to make unban appeal on our forum: \n forum link: comingsoon"\
,pName(playerid),by,content,saves[2],expire);
}
ShowPlayerDialog(playerid, 801, DIALOG_STYLE_MSGBOX, "{FF0000}You Are Temporary Banned!", str, "Close","");
SetTimerEx("kickplayer", 3000, false, "i", playerid);
return 1;
}
}
if(ifbanned[1] == 0) {
banrows[playerid] = 1;
format(Query, sizeof(Query), "SELECT * FROM `bannedips` WHERE `ip` = '%s'", pIP(playerid));
mysql_tquery(mysql, Query, "BanIPCheck", "i", playerid);
}
}
if(!rows)
{
format(Query, sizeof(Query), "SELECT * FROM `bannedips` WHERE `ip` = '%s'", pIP(playerid));
mysql_tquery(mysql, Query, "BanIPCheck", "i", playerid);
}
return 1;
}