Hello there, I need help of updating all of my msql_r6 functions to mysql_r9 / latest version.
#1

Good day sir,

I tried to update my mysql_r6 which is very age . Very old. I tried to upgrade it to mysql_r9 pBlueG latest MySQL version.

But i get these multiple 26 errors mismatch. I guess there's something need to be changed on these functions or codes. If you know how to fix it please let me know. I would be very grateful if you say it to me. Thanks bro....

Here(s) the list of errors
Quote:

C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(3057) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(6979) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(6995) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(9396) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(1375 : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(13827) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(13865) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(13965) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(14004) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(14072) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(16439) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(21413) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(22041) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(23102) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(24914) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(26259) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(34375) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(3670 : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(36734) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(40750) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(40834) : warning 206: redundant test: constant expression is non-zero
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(40834) : warning 215: expression has no effect
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(40836) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(46209) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(46661) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(46670) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(46696) : error 035: argument type mismatch (argument 1)
C:\Users\user\Desktop\SD\gamemodes\SAW.pwn(46739) : error 025: function heading differs from prototype

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


26 Errors.

Line 6979:
Код:
stock punishmentLog(playerid, issuerid, puntype, szPunishment[128], szReason[]) {
	if(AdminDuty[playerid] == 0) {
		new
			szPunText[128],
			szRawReason[128],
			szQuery[440];

		mysql_real_escape_string(szPunishment, szPunText, g_MySQLConnections[0]);
		mysql_real_escape_string(szReason, szRawReason, g_MySQLConnections[0]);
	
		format(szQuery, sizeof(szQuery), "INSERT INTO punishments (punIssuer, punIssuedTo, punText, punType, punReason, punTS) VALUES(%d, %d, '%s', %d, '%s', UNIX_TIMESTAMP(now()))", PlayerInfo[issuerid][pID], PlayerInfo[playerid][pID], szPunText, puntype, szRawReason);
		mysql_query(szQuery, THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
	}
	return 1;
}
Line 3057:
Код:
stock player_remove_vip_toys(iTargetID)
{
	if(PlayerInfo[iTargetID][pDonator] >= 3) return 1;
	else for(new iToyIter; iToyIter < MAX_PLAYER_ATTOBJECTS; ++iToyIter) {
		for(new LoopRapist; LoopRapist < sizeof(HoldingObjectsCop); ++LoopRapist) {
			if(HoldingObjectsCop[LoopRapist][holdingmodelid] == PlayerToyInfo[iTargetID][iToyIter][ptModelID]) {			
				new
					szQuery[128];

				SetPVarInt(iTargetID, "deleteObject", iToyIter);
				format(szQuery, sizeof(szQuery), "DELETE FROM toys WHERE Owner = %d AND ID = %d", PlayerInfo[iTargetID][pID], PlayerToyInfo[iTargetID][iToyIter][ptRealID]);
				mysql_query(szQuery, THREAD_DELETE_PLAYER_OBJECT, iTargetID, g_MySQLConnections[0]);
				if(IsPlayerAttachedObjectSlotUsed(iTargetID, iToyIter)) RemovePlayerAttachedObject(iTargetID, iToyIter);
			}
		}
	}
	SendClientMessage(iTargetID, COLOR_WHITE, "All accessories/toys that were property of your former employer have been removed.");
	return 1;
}
Line 6995:
Код:
stock punishmentLogEx(playerid, issuerid, puntype, szPunishment[128], szReason[]) {
	if(AdminDuty[playerid] == 0) {
		new
	    szPunText[128],
	    szRawReason[128],
	    szQuery[440];

		mysql_real_escape_string(szPunishment, szPunText, g_MySQLConnections[0]);
		mysql_real_escape_string(szReason, szRawReason, g_MySQLConnections[0]);
	
		format(szQuery, sizeof(szQuery), "INSERT INTO punishments (punIssuer, punIssuedTo, punText, punType, punReason, punTS) VALUES(%d, %d, '%s', %d, '%s', UNIX_TIMESTAMP(now()))", issuerid, playerid, szPunText, puntype, szRawReason);
		mysql_query(szQuery, THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
	}
	return 1;
}
Line 9396:
Код:
	format(szQuery, sizeof(szQuery), "UPDATE playervehicles SET Owner = %d WHERE ID = %d", PlayerInfo[playerid][pID], GetPVarInt(playerid, "carsaleid"));
							mysql_query(szQuery, THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
Line 13758:
Код:
CMD:oipcheck(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] < 2)
		return SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");

	if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
		return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

	if(isnull(params))
	    return SendClientMessage(playerid, COLOR_GREY, "USAGE: /oipcheck [name]");

	new
		string[128],
		szPlayerName[MAX_PLAYER_NAME];

	mysql_real_escape_string(params, szPlayerName, g_MySQLConnections[0]);

	format(string, sizeof(string), "SELECT Username, LastIP FROM players WHERE Username = '%s'", szPlayerName);
	mysql_query(string, THREAD_OFFLINE_IP_CHECK, playerid, g_MySQLConnections[0]);
	return 1;
}
Line 13827
Код:
CMD:unban(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] >= 6 || PlayerInfo[playerid][pBanAppealer] >= 1) {
		if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
			return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

		new
		    szPlayerName[MAX_PLAYER_NAME],
			string[128];
			
		if(isnull(params))
			return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unban [playername]");

		mysql_real_escape_string(params, szPlayerName, g_MySQLConnections[0]);
		
		format(string, sizeof(string), "SELECT Banned, Permabanned, Warnings, LastIP, Username FROM players WHERE Username = '%s'", szPlayerName);
		mysql_query(string, THREAD_CHECK_BANNED, playerid, g_MySQLConnections[0]);
	}
	else
	{
		return SendClientMessage(playerid, COLOR_GRAD1, " Only server manager or ban appealers can use this cmd!");
	}
	return 1;
}
Line 13865
Код:
CMD:oban(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] < 4)
		return SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");

 	if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
   		return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

	new
		string[128],
		playername[MAX_PLAYER_NAME],
		reason[64];
		
	if(sscanf(params, "s[MAX_PLAYER_NAME]s[64]", playername, reason))
		return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oban [playername] [reason]");

    new
		giveplayerid = ReturnUser(playername);
		
	if(IsPlayerConnected(giveplayerid))
		return SendClientMessage(playerid, COLOR_GRAD2, "That player is online, use /ban for online players.");

	SetPVarString(playerid, "obanreason", reason);
	
	new
	    szPlayerName[MAX_PLAYER_NAME];

	mysql_real_escape_string(playername, szPlayerName, g_MySQLConnections[0]);
	
	format(string, sizeof(string), "SELECT Permabanned, Banned, AdminLevel, Username, LastIP, ID FROM players WHERE Username = '%s'", szPlayerName);
	mysql_query(string, THREAD_OFFLINE_BAN, playerid, g_MySQLConnections[0]);
	return 1;
}
Line 14004
Код:
CMD:ofine(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] < 3)
		return SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
		
	if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
		return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

	new 
		string[128], 
		name[MAX_PLAYER_NAME], 
		amount, 
		reason[64];
		
	if(sscanf(params, "s[MAX_PLAYER_NAME]ds[64]", name, amount, reason)) 
		return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ofine [name] [amount] [reason]");

	new 
		giveplayerid = ReturnUser(name);
		
	if(giveplayerid != INVALID_PLAYER_ID)
		return SendClientMessage(playerid, COLOR_GRAD2, "That player is online, use /fine for online players.");
		
	if(amount < 1)
		return SendClientMessage(playerid, COLOR_GRAD2, "Amount must be greater than 0.");

	SetPVarString(playerid, "ofinereason", reason);
	SetPVarInt(playerid, "ofineamount", amount);
	
	new
	    szPlayerName[MAX_PLAYER_NAME];

	mysql_real_escape_string(name, szPlayerName, g_MySQLConnections[0]);
	
	format(string, sizeof(string), "SELECT Permabanned, Banned, AdminLevel, Username, LastIP, Bank, Cash FROM players WHERE Username = '%s'", szPlayerName);
	mysql_query(string, THREAD_OFFLINE_FINE, playerid, g_MySQLConnections[0]);
	
	return 1;
}
Line 14072
Код:
CMD:oflag(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] >= 2) {
 		if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
	        return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

		new
			string[128],
			name[MAX_PLAYER_NAME],
			reason[64];
			
		if(sscanf(params, "s[24]s[64]", name, reason))
			return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oflag [name] [reason]");

    	new
			giveplayerid = ReturnUser(name);

        if(IsPlayerConnected(giveplayerid)) {
			AddFlag(giveplayerid, playerid, reason);
			SendClientMessage(playerid, COLOR_WHITE, "The player is online and has been flagged!");
			
			format(string, sizeof(string), "AdmCmd: %s was flagged by %s, reason: %s.", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
			ABroadCast(COLOR_LIGHTRED, string, 1);
		} else {
		    new
		        szPlayerName[MAX_PLAYER_NAME],
		        szFlag[128],
		        szQuery[128];

			mysql_real_escape_string(name, szPlayerName, g_MySQLConnections[0]);

			mysql_real_escape_string(reason, szFlag, g_MySQLConnections[0]);
			SetPVarString(playerid, "offline_flag", szFlag);
			SetPVarString(playerid, "offline_flag_target", szPlayerName);

			format(szQuery, sizeof(szQuery), "SELECT Username FROM players WHERE Username = '%s'", szPlayerName);
			mysql_query(szQuery, THREAD_OFFLINE_FLAG, playerid, g_MySQLConnections[0]);
		}
		return 1;
	}
	return 1;
}
Line 16439
Код:
CMD:approvename(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] < 1)
	    return SendClientMessage(playerid, COLOR_GREY, "You're not authorised to use this command.");

	new
	    iTarget,
		szQuery[128];

	if(sscanf(params, "u", iTarget))
	    return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /approvename [playerid/partOfName]");

	if(iTarget == INVALID_PLAYER_ID)
	    return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");

    if(GetPVarInt(iTarget, "RequestingNameChange") == 0)
		return SendClientMessage(playerid, COLOR_GREY, "The specified player isn't requesting a name change.");

	new
	    szPlayerName[MAX_PLAYER_NAME];

    GetPVarString(iTarget, "NewNameRequest", szPlayerName, MAX_PLAYER_NAME);
    SetPVarInt(iTarget, "requestby", playerid);

    mysql_real_escape_string(szPlayerName, szPlayerName, g_MySQLConnections[0]);

    SetPVarString(iTarget, "requestedname", szPlayerName);

    format(szQuery, sizeof(szQuery), "SELECT Username FROM players WHERE Username = '%s'", szPlayerName);
	mysql_query(szQuery, THREAD_CHECK_NEW_NAME, iTarget, g_MySQLConnections[0]);
	return 1;
}
Line 21413
Код:
CMD:setname(playerid, params[]) {
	new
		szQuery[128],
		iTarget,
		szNewName[MAX_PLAYER_NAME];
	
	if(sscanf(params, "us[24]", iTarget, szNewName))
		return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setname [playerid/partofname] [newname]");
		
	if(iTarget == INVALID_PLAYER_ID)
	    return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");

	if(PlayerInfo[playerid][pAdmin] < 4)
	    return SendClientMessage(playerid, COLOR_GREY, "Insufficient admin level. ");

	if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
		return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

	if(AdminDuty[iTarget] == 1)
 		return SendClientMessage(playerid,COLOR_WHITE, "You can't use /setname on an on-duty admin.");

	if(strfind(szNewName, "_", false) == -1)
		return SendClientMessage(playerid, COLOR_GREY, "The name must include an underscore ('_').");

	mysql_real_escape_string(szNewName, szNewName, g_MySQLConnections[0]);
	
	SetPVarInt(iTarget, "requestby", playerid);
	SetPVarInt(iTarget, "requestpath", 3);
	SetPVarString(iTarget, "requestedname", szNewName);
	
	format(szQuery, sizeof(szQuery), "SELECT Username FROM players WHERE Username = '%s'", szNewName);
	mysql_query(szQuery, THREAD_CHECK_NEW_NAME, iTarget, g_MySQLConnections[0]);

	return 1;
}
Line 22041
Код:
CMD:listpnamechanges(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] < 3)
	    return SendClientMessage(playerid, COLOR_GREY, "You're not authorised to use this command.");

	if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
	    return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

	new
	    iTarget;
	    
	if(sscanf(params, "u", iTarget))
	    return SendClientMessage(playerid, COLOR_GREY, "USAGE: /listnchanges [playerid/partOfName]");

	if(iTarget == INVALID_PLAYER_ID)
	    return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified.");

	new
	    szQuery[114];

	SetPVarInt(playerid, "namechanges_target", iTarget);
	
	format(szQuery, sizeof(szQuery), "SELECT oldname, unixts, newname, approvedbyname FROM namechanges WHERE dbid = %d ORDER BY unixts DESC LIMIT 10", PlayerInfo[iTarget][pID]);
	mysql_query(szQuery, THREAD_LIST_NAMECHANGES, playerid, g_MySQLConnections[0]);
	return 1;
}
Line 23102
Код:
CMD:oprison(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] >= 3) {
		if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
   			return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

		new
			string[128],
			name[MAX_PLAYER_NAME],
			minutes,
			reason[64];

		if(sscanf(params, "s[24]ds[64]", name, minutes, reason))
			return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /oprison [playername] [time (minutes)] [reason]");

        new giveplayerid = ReturnUser(name);
        if(IsPlayerConnected(giveplayerid))
			return SendClientMessage(playerid, COLOR_GRAD2, "That player is online, use /prison for online players.");

		SetPVarInt(playerid, "oprisontime", minutes*60);
		SetPVarString(playerid, "oprisonreason", reason);
		
		new
		    szPlayerName[MAX_PLAYER_NAME];

		mysql_real_escape_string(name, szPlayerName, g_MySQLConnections[0]);

		format(string, sizeof(string), "SELECT Permabanned, Banned, AdminLevel, Username, LastIP, JailTime, ID FROM players WHERE Username = '%s'", szPlayerName);
		mysql_query(string, THREAD_OFFLINE_PRISON, playerid, g_MySQLConnections[0]);
	}
	return 1;
}
Line 24914
Код:
CMD:su(playerid, params[]) {
	if(IsACop(playerid) || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 5 || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2) {
		if(PlayerInfo[playerid][pJailed] > 0) {
			return SendClientMessage(playerid, COLOR_WHITE, "You can't use this in jail/prison.");
		}

		new
			iTargetID,
			szCrime[64];

		if(sscanf(params, "us[64]", iTargetID, szCrime)) {
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/su)spect [playerid/partofname] [crime description]");
		}
		else if(!IsPlayerConnected(iTargetID)) {
			SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
		}
		else if(IsACop(iTargetID)) {
			SendClientMessage(playerid, COLOR_GREY, "You can't use this command on a law enforcement officer.");
		}
		else if(PlayerInfo[iTargetID][pFaction] == 5) {
			SendClientMessage(playerid, COLOR_GREY, "This person has diplomatic immunity.");
		}
		else if(PlayerInfo[iTargetID][pWantedLevel] >= 6) {
			SendClientMessage(playerid, COLOR_GRAD2, "Target is already most wanted.");
		}
		else {

			new
				szMessage[128];

			++PlayerInfo[iTargetID][pCrimes];
			SetPlayerWantedLevel(iTargetID, ++PlayerInfo[iTargetID][pWantedLevel]);
			if(PlayerInfo[iTargetID][pWantedLevel] > 5)
 			{
				SetPlayerColor(iTargetID, WANTED_COLOR);
			}

			format(szMessage, sizeof(szMessage), "You've commited a crime (%s), reporter: %s.", szCrime, GetPlayerNameEx(playerid));
			SendClientMessage(iTargetID, COLOR_LIGHTRED, szMessage);

			format(szMessage, sizeof(szMessage), "Current wanted level: %d", PlayerInfo[iTargetID][pWantedLevel]);
			SendClientMessage(iTargetID, COLOR_YELLOW, szMessage);
			
			if(AdminDuty[iTargetID] == 0) {
				new
					szCleanDescription[64],
					szQuery[270];

				mysql_real_escape_string(szCrime, szCleanDescription, g_MySQLConnections[0]);

				format(szQuery, sizeof(szQuery), "INSERT INTO crimes (crimeIssuer, crimeIssuedTo, crimeDescription, crimeIssuerName, crimeIssuedToName) VALUES(%d, %d, '%s', '%s', '%s')", PlayerInfo[playerid][pID], PlayerInfo[iTargetID][pID], szCleanDescription, GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID));
				mysql_query(szQuery, THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
			}
			foreach(Player, i) if(IsACop(i) || PlayerInfo[i][pFaction] == 5 && PlayerInfo[i][pDivision] == 5 || PlayerInfo[playerid][pFaction] == 5 && PlayerInfo[playerid][pDivision] == 2) {
				format(szMessage, sizeof(szMessage), "HQ: All units APB (reporter: %s)",GetPlayerNameEx(playerid));
				SendClientMessage(i, TEAM_BLUE_COLOR, szMessage);
				format(szMessage, sizeof(szMessage), "HQ: Crime: %s, suspect: %s", szCrime, GetPlayerNameEx(iTargetID));
				SendClientMessage(i, TEAM_BLUE_COLOR, szMessage);
			}
		}
	}
	else SendClientMessage(playerid, COLOR_GRAD2, "You're not a law enforcement officer.");
	return 1;
}
Line 26259
Код:
CMD:ouninvite(playerid, params[]) {
	if(PlayerInfo[playerid][pLeader] >= 1) {
		if(isnull(params))
			return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ouninvite [name]");

		if(IsPlayerConnected(ReturnUser(params)))
		    return SendClientMessage(playerid, COLOR_GREY, "This player is currently connected, please use /uninvite to uninvite the player.");
		    
		new
		    szPlayerName[MAX_PLAYER_NAME],
		    szQuery[128];
		    
		mysql_real_escape_string(params, szPlayerName, g_MySQLConnections[0]);
		
		SetPVarString(playerid, "uninvite_target", szPlayerName);

		format(szQuery, sizeof(szQuery), "SELECT Faction, AdminLevel FROM players WHERE Username = '%s'", szPlayerName);
		mysql_query(szQuery, THREAD_OFFLINE_UNINVITE, playerid, g_MySQLConnections[0]);
	}
	else SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command - only leaders can do this.");
	return 1;
}
Line 34375
Код:
CMD:changeuserpassword(playerid, params[]) {
    if(PlayerInfo[playerid][pAdmin] < 5)
        return SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");

   	if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
   		return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

    new
		string[128],
		accountName[24],
		szPassword[64],
		password[64];
		
    if(sscanf(params, "s[MAX_PLAYER_NAME]s[64]", accountName, password))
		return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /changeuserpassword [playername] [new password]");

	mysql_real_escape_string(accountName, accountName, g_MySQLConnections[0]);
	mysql_real_escape_string(password, szPassword, g_MySQLConnections[0]);
	
	SetPVarString(playerid, "opasschange", szPassword);
	SetPVarString(playerid, "opasschangetarget", accountName);

	format(string, sizeof(string), "SELECT Username FROM players WHERE Username = '%s' AND AdminLevel = 0", accountName);
	mysql_query(string, THREAD_CHECK_NAME_PASSWORD, playerid, g_MySQLConnections[0]);
    return 1;
}
Line 36708
Код:
CMD:ocheck(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] < 3)
		return SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");

	if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  		return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

	if(isnull(params))
		return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ocheck [name]");
		
	new
		giveplayerid = ReturnUser(params);

	if(IsPlayerConnected(giveplayerid))
		return SendClientMessage(playerid, COLOR_WHITE, "That player is online, please use /check instead.");

	new
		szPlayerName[MAX_PLAYER_NAME],
	    szQuery[68];

	mysql_real_escape_string(params, szPlayerName, g_MySQLConnections[0]);
	format(szQuery, sizeof(szQuery), "SELECT * FROM players WHERE Username = '%s'", szPlayerName);
	mysql_query(szQuery, THREAD_GET_STATS, playerid, g_MySQLConnections[0]);
	return 1;
}
Line 36734
Код:
CMD:okills(playerid, params[]) {
	if(PlayerInfo[playerid][pAdmin] < 3)
		return SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");

	if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6)
  		return SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty.");

	if(isnull(params))
		return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /okills [name]");
		
	new
		giveplayerid = ReturnUser(params);

	if(IsPlayerConnected(giveplayerid))
		return SendClientMessage(playerid, COLOR_WHITE, "That player is online, please use /kills instead.");

	new
		szPlayerName[MAX_PLAYER_NAME],
	    szQuery[68];

	mysql_real_escape_string(params, szPlayerName, g_MySQLConnections[0]);
	format(szQuery, sizeof(szQuery), "SELECT * FROM players WHERE Username = '%s'", szPlayerName);
	mysql_query(szQuery, THREAD_OFFLINE_KILLS, playerid, g_MySQLConnections[0]);
	return 1;
}
Line 40750
Код:
forward OnPlayerRegister(playerid, password[]);
public OnPlayerRegister(playerid, password[]) {
	if(IsPlayerConnected(playerid)) {
		new
		    szPlayerName[MAX_PLAYER_NAME],
		    szPlayerName2[MAX_PLAYER_NAME],
		    szQuery[225];

		GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
		
		mysql_real_escape_string(szPlayerName, szPlayerName2, g_MySQLConnections[0]);
		
		SetPVarString(playerid, "password", password);
		
		// Set the variable to logged in so we aren't cockblocked by SaveAccount()
		gPlayerLogged[playerid] = 1;
		
		format(szQuery, sizeof(szQuery), "INSERT INTO players (Username, Password) VALUES('%s', '%s')", szPlayerName2, password);
		mysql_query(szQuery, THREAD_REGISTER_ACCOUNT, playerid, g_MySQLConnections[0]);
	}
	return 1;
}
Line 40834
Код:
	g_MySQLConnections[0] = mysql_connect("127.0.0.1", "asdo", "easdo", "093as99");
	
	mysql_debug(1);
	
	mysql_query("set session query_cache_type=0;", THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
Line 40836
Код:
mysql_query("set session query_cache_type=0;", THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
Line 46209
Код:
	new
		szQuery[128];
	format(szQuery, sizeof(szQuery), "DELETE FROM connections WHERE PlayerID = %d", playerid);
	mysql_query(szQuery, THREAD_NO_RESULT, playerid, g_MySQLConnections[0]);
Line 46661
Код:
stock AttemptPlayerLogin(playerid, passbuffer[]) {
	new
	    szQuery[225],
	    szPlayerName[MAX_PLAYER_NAME],
		szPlayerName2[MAX_PLAYER_NAME];

	GetPlayerName(playerid, szPlayerName, sizeof(szPlayerName));
	
	mysql_real_escape_string(szPlayerName, szPlayerName2, g_MySQLConnections[0]);

	format(szQuery, sizeof(szQuery), "SELECT * FROM players WHERE Username = '%s' AND Password = '%s'", szPlayerName2, passbuffer);
	mysql_query(szQuery, THREAD_LOGIN_ATTEMPT, playerid, g_MySQLConnections[0]);
	return 1;
}
Line 46670
Код:
stock LoadPlayerDynamicItems(playerid) {
	new
	    szString[128];

	format(szString, sizeof(szString), "SELECT toys.* FROM toys INNER JOIN players ON toys.Owner = players.ID WHERE players.ID = '%d' ORDER BY toys.ID ASC LIMIT %d", PlayerInfo[playerid][pID], MAX_PLAYERTOYS);
	mysql_query(szString, THREAD_LOAD_P_ITEMS_CHAIN_1, playerid, g_MySQLConnections[0]);
	return 1;
}
Line 46696
Код:
stock SaveAccount(playerid) {
    // The query threads continue in the callback for finished queries.
	if(GetPVarInt(playerid, "TempName") != 1 && gPlayerLogged[playerid] && AdminDuty[playerid] == 0) {
	    
		new
			szPlayerName[MAX_PLAYER_NAME],
			szPlayerName2[MAX_PLAYER_NAME],
			szAdminName[MAX_PLAYER_NAME],
		    szQuery[2048];

		GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);
		
		mysql_real_escape_string(szPlayerName, szPlayerName2, g_MySQLConnections[0]);
		mysql_real_escape_string(PlayerInfo[playerid][pAdminName], szAdminName, g_MySQLConnections[0]);

		format(szQuery, sizeof(szQuery), "UPDATE players SET Username = '%s', Password = '%s', Level = %d, AdminLevel = %d, AdminName = '%s', BanAppealer = %d, Donator = %d, Banned = %d, Permabanned = %d, Disabled = %d, LastIP = '%s', Registered = %d, \
		Tutorial = %d, Sex = %d, Age = %d, Skin = %d, PosX = '%f', PosY = '%f', PosZ = '%f', PosR = '%f', ConnectTime = %d, Respect = %d, PhoneNumber = %d, Warnings = %d, Gang = %d, Faction = %d, Leader = %d, Rank = %d WHERE ID = %d",
		szPlayerName, PlayerInfo[playerid][pKey], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pAdmin], szAdminName, PlayerInfo[playerid][pBanAppealer], PlayerInfo[playerid][pDonator], PlayerInfo[playerid][pBanned],
		PlayerInfo[playerid][pPermaBanned], PlayerInfo[playerid][pDisabled], PlayerInfo[playerid][pIP], PlayerInfo[playerid][pReg], PlayerInfo[playerid][pTut], PlayerInfo[playerid][pSex], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pPos_x],
		PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z], PlayerInfo[playerid][pPos_r], PlayerInfo[playerid][pConnectTime], PlayerInfo[playerid][pRespect], PlayerInfo[playerid][pNumber], PlayerInfo[playerid][pWarns], PlayerInfo[playerid][pGang],
		PlayerInfo[playerid][pFaction], PlayerInfo[playerid][pLeader], PlayerInfo[playerid][pRank], PlayerInfo[playerid][pID]);

		mysql_query(szQuery, THREAD_SAVE_ACCOUNT_CHAIN_1, playerid, g_MySQLConnections[0]);
	}
	return 1;
}
Line 46739
Код:
stock timec(timestamp, compare = -1) {
    if (compare == -1) {
        compare = gettime();
    }
    new
        n,
        // on the following line, I have removed the need for the diff() function.
        // if you want to use the diff() function in pawn, replace the following with:
        // Float:d = diff(timestamp, compare),
        Float:d = (timestamp > compare) ? timestamp - compare : compare - timestamp,
        returnstr[32];
    if (d < 60) {
        format(returnstr, sizeof(returnstr), "< 1 minute");
        return returnstr;
    } else if (d < 3600) { // 3600 = 1 hour
        n = floatround(floatdiv(d, 60.0), floatround_floor);
        format(returnstr, sizeof(returnstr), "minute");
    } else if (d < 86400) { // 86400 = 1 day
        n = floatround(floatdiv(d, 3600.0), floatround_floor);
        format(returnstr, sizeof(returnstr), "hour");
    } else if (d < 2592000) { // 2592000 = 1 month
        n = floatround(floatdiv(d, 86400.0), floatround_floor);
        format(returnstr, sizeof(returnstr), "day");
    } else if (d < 31536000) { // 31536000 = 1 year
        n = floatround(floatdiv(d, 2592000.0), floatround_floor);
        format(returnstr, sizeof(returnstr), "month");
    } else {
        n = floatround(floatdiv(d, 31536000.0), floatround_floor);
        format(returnstr, sizeof(returnstr), "year");
    }
    if (n == 1) {
        format(returnstr, sizeof(returnstr), "1 %s", returnstr);
    } else {
        format(returnstr, sizeof(returnstr), "%d %ss", n, returnstr);
    }
    return returnstr;
}

public OnQueryError(errorid, error[], resultid, extraid, callback[], query[], connectionHandle) {
	printf("errorid: %d | error: %s | callback: %s | query: %s | connection handle: %d | resultid: %d | extraid: %d", errorid, error, callback, query, connectionHandle, resultid, extraid);
	return 1;
}
Please, if i need to pay, Let me know and i will pay for this. Just pm me the price
I need help, im paying big amount

Help
Reply
#2

Try taking a look at the documentation for r9, check what the arguments for each function should be and change your script accordingly.
Reply
#3

Im new on mysql, Anyone provide me the codes?
Reply
#4

That contains
a_mysql.inc
mysql.dll
mysql.so
mysql_static.so
mysql_5.5.so

Don't ask me why im using old version!
Don't ask me why im using old version!
Don't tell i should use the newer version

OR
https://sampforum.blast.hk/showthread.php?tid=607662
AND I WILL PAY YOU $50 GRAND
Reply
#5

I don't know where is it exactly, but ... why don't you use the latest MySQL version?
Reply
#6

Quote:
Don't ask me why im using old version!
i recommend 2 pair of BIG GLASSES
Reply
#7

R6 is hell outdated, try updating your script to R39
Reply
#8

Quote:
Originally Posted by SecretBoss
Посмотреть сообщение
R6 is hell outdated, try updating your script to R39
I recommend 2 pair of BIG BIG BIG BIG BIG glasses

OR https://sampforum.blast.hk/showthread.php?tid=607662

AND I WILL PAY U $50
Reply
#9

Just go to its thread and scroll down. There are R5, R6 and R7.
Reply
#10

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
Just go to its thread and scroll down. There are R5, R6 and R7.
Tell me how to got the full package there
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)