Jump to content

Question

Posted

Salutare , am un "bug" care nu stiu din ce cauza este...in ce consta acest bug...

Nu trimite mesajele respectivului player care a primit ban (dupa re-relog) adica ii da direct server closed the connection...ce as putea face?

new
	    szPlayerName[MAX_PLAYER_NAME],
	    szQuery[93],
	    szIP[19]
	 ;

	GetPlayerIp(playerid, szIP, sizeof(szIP));
	GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

	format(szQuery, sizeof(szQuery), "SELECT banlength FROM bans WHERE ip = '%s' OR name = '%s'", szIP, DB_Escape(szPlayerName));

	new	DBResult: qHandle = db_query(dbBans, szQuery);

	if(db_num_rows(qHandle) > 0)
	{
	    new
	        szDump[32],
	        iDump,
			szMessage[64];

        db_get_field_assoc(qHandle, "banlength", szDump, sizeof(szDump));
        iDump = strval(szDump);

        if(iDump-gettime() < 0)
		{
            format(szMessage, sizeof(szMessage), "{FFFFFF}Your ban expired %d seconds ago. Welcome back.", gettime()-iDump);
            SendClientMessage(playerid, COLOR, szMessage);

            format(szQuery, sizeof(szQuery), "DELETE FROM bans WHERE name = '%s'", DB_Escape(szPlayerName));
            db_free_result(db_query(dbBans, szQuery));
        }
		else
		{
   			format(szMessage, sizeof(szMessage), "{FFFFFF}Your ban will expire in %d seconds.", iDump-gettime());
		    SendClientMessage(playerid, COLOR, "You're temporarily banned from this server.");
		    SendClientMessage(playerid, COLOR, szMessage);
		    Kick(playerid);
	    }
	}

Mesaju' cu Your ban expired %d seconds ago. Welcome back functioneaza perfect dar restu...nu

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

2 answers to this question

Recommended Posts

Posted

Buna seara stimate.

La folosirea comenzii /kick playerul deconectat de la server primeste mesajul?

ep41yhufqpagka5wfoornw1wjfjie.png

HTjr_G.png
12975.png
 
Posted

nu...da cand dau ban cuiva persoana respectiva primeste...dar la kick nu....

EDIT: am facut un timer pentru kick :) si acuma merge puteti da T/C ms

public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.