27.06.2018, 11:32
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; }