Delete offline player - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Delete offline player (
/showthread.php?tid=655687)
Delete offline player -
,TomY' - 27.06.2018
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;
}
Re: Delete offline player -
Verc - 27.06.2018
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.
Re: Delete offline player -
,TomY' - 27.06.2018
Anyone, who can help update this code for older mysql version? :S
Re: Delete offline player -
Akeem - 27.06.2018
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.
Re: Delete offline player -
GTLS - 27.06.2018
Just update your mysql. Its the only way. Reverting back will ruin your script.
Re: Delete offline player -
,TomY' - 27.06.2018
Which mysql version do I need?
Re: Delete offline player -
,TomY' - 27.06.2018
P.S Really there no other way, to remake this code?