Delete offline player
#1

Hi. Trying to make command, that will delete offline player from job. In other gamemode I found that command. But when I use that command in my gamemode ( I changed all variables ), I got errors like: undefined symbol "mysql_store_result" , undefined symbol "mysql_retrieve_row", undefined symbol "mysql_num_rows" ... As I read, I should update mysql or something like that. Is any other way, to create this command?

Код:
	if(!strcmp(cmdtext, "/del", true, 4))
{
	new uQuerry[150], ifwork,zName[MAX_PLAYER_NAME];
	if(GetPlayeridMid(zName) != INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "* Text.");
	format(uQuerry, 150, "SELECT * FROM `players` WHERE `Name` = '%s'", zName);
	mysql_query(uQuerry);
	mysql_store_result();
	mysql_retrieve_row();
	if(mysql_num_rows())
	{
		mysql_fetch_field_row(uQuerry, "Job"); ifwork = strval(uQuerry);
		if(playerDB [ playerid ] [ plead ] != ifwork) return SendClientMessage(playerid,RED,"* Text.");
		else
		{
			if(ifwork > 0)
			{
				SendClientMessage(playerid, RED, "* Text");
				format(uQuerry, 150, "UPDATE players SET `Job` = '0' WHERE `Name` = '%s'", zName);
				mysql_query(uQuerry);

				return 1;
			}
		}
	}
	else
	{
		SendClientMessage(playerid, RED, "* Text.");
	}
	return 1;
}
Reply
#2

You shouldn't copy code from other gamemodes,it's a bad practice and that's not how code works..
Anyway,yes you need to update the code,that's older version of MySQL.
Reply
#3

Anyone, who can help update this code for older mysql version? :S
Reply
#4

I recommand redo-ing that part using easymysql.inc if you can't don't mysql. Easymysql is super easy to use and you don't have to worry about casheing data.
Reply
#5

Just update your mysql. Its the only way. Reverting back will ruin your script.
Reply
#6

Which mysql version do I need?
Reply
#7

P.S Really there no other way, to remake this code?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)