SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
//top of script #include <a_samp> #include <zcmd> #include <sscanf> new Mute[MAX_PLAYERS]; CMD:fakekick(playerid, params[]) { new ID, targetid; if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, 0x1F36E0FF, "USAGE: /fakekick [Playerid/Name]"); if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xF50A0AFF, "NOTICE: Player not found."); new string[128]; format(string,sizeof(string),"%s has been kicked by %s for ****** Hacks", PlayerName(ID), PlayerName(playerid)); SendClientMessageToAll(0xAA3333AA, string); SendClientMessage(ID, 0xAA3333AA, "Server closed the connection."); SendDeathMessage(INVALID_PLAYER_ID, playerid, 201); SetPlayerVirtualWorld(playerid, 2); Mute[targetid] = 1; return 1; } public OnPlayerText(playerid, text[]) { if(Mute[playerid] >= 1) { return 0; } return 1; } PlayerName(playerid) { new CName[24]; GetPlayerName(playerid, CName, 24); return CName; }
Код:
//top of script #include <a_samp> #include <zcmd> #include <sscanf> new Mute[MAX_PLAYERS]; CMD:fakekick(playerid, params[]) { new ID, targetid; if (sscanf(params, "us[90]", ID)) return SendClientMessage(playerid, 0x1F36E0FF, "USAGE: /fakekick [Playerid/Name]"); if (!IsPlayerConnected(ID)) return SendClientMessage(playerid, 0xF50A0AFF, "NOTICE: Player not found."); new string[128]; format(string,sizeof(string),"%s has been kicked by %s for ****** Hacks", PlayerName(ID), PlayerName(playerid)); SendClientMessageToAll(0xAA3333AA, string); SendClientMessage(ID, 0xAA3333AA, "Server closed the connection."); SendDeathMessage(INVALID_PLAYER_ID, playerid, 201); SetPlayerVirtualWorld(playerid, 2); Mute[targetid] = 1; return 1; } public OnPlayerText(playerid, text[]) { if(Mute[playerid] >= 1) { return 0; } return 1; } PlayerName(playerid) { new CName[24]; GetPlayerName(playerid, CName, 24); return CName; } |
new ID, targetid;
if (sscanf(params, "us[90]", ID))
new string[128];
OnPlayerText(playerid, text[])
{
if(Mute[playerid] >= 1)
{
return 0;
}
new bool:Mute[playerid]
Mute[playerid] = true;
Mute[playerid] = false;
Mute[playerid] = !Mute[playerid];
if(Mute[playerid]) // Player is muted
if(!Mute[playerid]) // Player is not muted
You shouldn't post code written under 2 minutes and untested:
You're not using targetid: PHP код:
PHP код:
PHP код:
PHP код:
PHP код:
PHP код:
PHP код:
PHP код:
PHP код:
PHP код:
|
What are you saying about target id part?
OnPlayertext isn't also inside cmd? As I said this was written in 2 minutes and works just fine according to my knowledge.Also obviously we all know this could be written better but I just gave him an example how can it be done. |
Mute[targetid] = 1;
Originally Posted by OP
mute him for 10 seconds so it seems like he is disconnected for real
|