#include <a_samp>
new tmp[128], adminPlayer[20], Mute[MAX_PLAYERS];
forward Unmute(playerid);
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Admin Menu", "Kick\nMute\nSet Player Score\nGive Player Money\nCrash Player", "Select", "Cancel");
new id = strval(tmp);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF,"Invalid ID");
adminPlayer[playerid] = clickedplayerid;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(!response)return SendClientMessage(playerid, 0xFF303EAA,"Error: You have cancelled.");
{
if(listitem == 0) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Kick Menu", "Why do you want to kick him?", "Kick", "Cancel");
else if(listitem == 1) return ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Mute Menu", "Why do you want to mute him?\n(Will be Auto-Unmuted)", "Mute", "Cancel");
else if(listitem == 2) return ShowPlayerDialog(playerid, 4, DIALOG_STYLE_INPUT, "Score Menu", "Enter the new score (numbers)", "Ok", "Cancel");
else if(listitem == 3) return ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Money Menu","Enter how much money you want to give/take from him","ok","Cancel");
else if(listitem == 4) return ShowPlayerDialog(playerid, 6, DIALOG_STYLE_MSGBOX, "Crash Menu", "Do you really want to crash that player?", "Yes", "No");
}
}
//Kick--------------------------------------------------------------------------
if(dialogid == 2)
{
if(response)
{
new playerwhogotkicked[MAX_PLAYER_NAME], string[128];
GetPlayerName(adminPlayer[playerid], playerwhogotkicked, sizeof(playerwhogotkicked));
format(string, sizeof(string), "**(ADMIN KICK)** %s(%d) %s",playerwhogotkicked, playerid, inputtext);
SendClientMessageToAll(0xFF7F0EFF, string);
adminPlayer[playerid] = 0;
Kick(adminPlayer[playerid]);
adminPlayer[playerid] = 0;
} return SendClientMessage(playerid, 0xFF303EAA, "Error: You have cancelled.");
}
//Mute
else if(dialogid == 3)
{
if(response)
{
new playerwhogotmuted[MAX_PLAYER_NAME], string[128];
GetPlayerName(adminPlayer[playerid], playerwhogotmuted, sizeof(playerwhogotmuted));
format(string, sizeof(string), "Admin Mute: %s(%d) %s",playerwhogotmuted, playerid, inputtext);
SendClientMessageToAll(0xFF7F0EFF, string);
adminPlayer[playerid] = 0;
//Mute
Mute[adminPlayer[playerid]] = 1;
adminPlayer[playerid] = 0;
//Timer
SetTimerEx("Unmute",120000,0,"i",adminPlayer[playerid]);
} else return SendClientMessage(playerid, 0xFF303EAA, "Error: You have cancelled.");
}
//Set Player Score--------------------------------------------------------------
else if(dialogid == 4)
{
if(response)
{
if(strlen(inputtext) > 8) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: Your new name was too long. Max: 8 characters");
GetPlayerScore(playerid); SetPlayerScore(adminPlayer[playerid],strval(inputtext));
adminPlayer[playerid] = 0;
} return SendClientMessage(playerid, 0xFF303EAA, "Error: You have cancelled the Score Menu.");
}
//Give Player Money-------------------------------------------------------------
else if(dialogid == 5)
{
if(response)
{
if(strlen(inputtext) > 8) return SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: Your new name was too long. Max: 8 characters");
GetPlayerMoney(playerid); GivePlayerMoney(adminPlayer[playerid],strval(inputtext));
adminPlayer[playerid] = 0;
} return SendClientMessage(playerid, 0xFF303EAA, "Error: You have cancelled the Money Menu.");
}
//Crash Player------------------------------------------------------------------
else if(dialogid == 6)
{
if(response)
{
CrashPlayer(adminPlayer[playerid]);
adminPlayer[playerid] = 0;
} return SendClientMessage(playerid, 0xFF303EAA, "Error: You have cancelled.");
}
return 1;
}
//Mute
public OnPlayerText(playerid, text[])
{
if(Mute[playerid] == 1)
{
SendClientMessage(playerid, 0x007F0EFF, "You Are Muted. You Cannot Chat");
return 0;
}
return 1;
}
//Mute
public OnPlayerDisconnect(playerid, reason)
{
Mute[playerid] = 0;
return 1;
}
//Mute
public Unmute(playerid)
{
new playerwhogotmuted[MAX_PLAYER_NAME], string[128];
GetPlayerName(adminPlayer[playerid], playerwhogotmuted, sizeof(playerwhogotmuted));
format(string, sizeof(string), "Admin Unmute: %s(%d) Read /rules 'n' /commands",playerwhogotmuted, playerid);
SendClientMessageToAll(0xFF7F0EFF, string);
Mute[adminPlayer[playerid]] = 0;
adminPlayer[playerid] = 0;
}
//Crash
stock CrashPlayer(playerid)
{
GameTextForPlayer(playerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 1000, 0);
GameTextForPlayer(playerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 2000, 1);
GameTextForPlayer(playerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 3000, 2);
GameTextForPlayer(playerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 4000, 3);
GameTextForPlayer(playerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 5000, 4);
GameTextForPlayer(playerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 6000, 5);
GameTextForPlayer(playerid, "•¤¶§!$$%&'()*+,-./01~!@#$^&*()_-+={[}]:;'<,>.?/", 7000, 6);
return 1;
}
I can't even find the commands because of this 200 line bullshit, learn how to script.
|
Your not even using strval in the kick/mute commands...
And what the fuck is this? I can't even find the commands because of this two-hundred line bullshit, learn how to script and stop posting fucking long codes. |
tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /mute [playerid/PartOfName]"); return 1; } new playa; playa = ReturnUser(tmp); if (PlayerInfo[playerid][pAdmin] >= 1) { if(IsPlayerConnected(playa)) { if(playa != INVALID_PLAYER_ID) { GetPlayerName(playa, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); if(PlayerInfo[playa][pMuted] == 0) { PlayerInfo[playa][pMuted] = 1; printf("AdmCmd: %s silenced %s",sendername, giveplayer); format(string, sizeof(string), "AdmCmd: %s was silenced by %s",giveplayer ,sendername);
Your not even using strval in the kick/mute commands... And what the fuck is this? I can't even find the commands because of this two-hundred line bullshit, learn how to script and stop posting fucking long codes. |
Your sig. is useless, your post was useless. Overall, you need to get your shit together. And actually think/read before you talk, the reason why it's so long is because it's using OnPlayerClickPlayer and dialogs. Nice fail at trololing.
|
//Mute Mute[adminPlayer[playerid]] = 1; adminPlayer[playerid] = -1;