27.06.2013, 13:16
Okay so i made a kick command wich shows you a dialog when you get kicked. well thats what it needs to do but it doesnt show up. What am i doing wrong?
Also i defined DialogKick as 5 on top of my gamemode
Also when i change
Into this
It works for the admin who kicked it. But if you want to show it to the other one it doesnt work
pawn Код:
CMD:kick(playerid, params[])
{
if(APlayerData[playerid][Admin] > 0)
{
new OtherPlayer, Reason[128], string4[1000], pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME], Year, Month, Day, Hour, Minute, Second;
if(sscanf(params, "us[128]", OtherPlayer, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/kick [playerid] [Reason]\"");
else
{
GetPlayerName(OtherPlayer, pName, sizeof(pName));
GetPlayerName(playerid, aName, sizeof(aName));
getdate(Year, Month, Day);
gettime(Hour, Minute, Second);
format(string4, 500, "%s{FFFFFF}-------{FF9900}Kick information{FFFFFF}-------\n", string4);
format(string4, 500, "%s{FFFFFF}Kick reason: {FF9900}%s\n",string4, Reason);
format(string4, 500, "%s{FFFFFF}Kicked by: {FF9900}%s\n", string4, aName);
format(string4, 500, "%s{FFFFFF}Date: {FF9900}%02d-%02d-%02d\n", string4, Day, Month, Year);
format(string4, 500, "%s{FFFFFF}Time: {FF9900}%02d:%02d:%02d\n", string4, Hour, Minute, Second);
format(string4, 500, "%s{FFFFFF}If you think this ban is unfair go to http://www.European-Trucking.com and make a ban appeal on forum\n", string4);
format(string4, 500, "%s{FFFFFF}Please make a picture of this! you will need this for unbanning!\n", string4);
format(string4, 500, "%s{FFFFFF}-----------------------------", string4);
ShowPlayerDialog(OtherPlayer, DialogKick, DIALOG_STYLE_MSGBOX,"Notice",string4,"Close","");
Kick(OtherPlayer);
}
}
else
SendClientMessage(playerid, 0xFF0000, "You are not admin");
return 1;
}
Also when i change
pawn Код:
ShowPlayerDialog(OtherPlayer, DialogKick, DIALOG_STYLE_MSGBOX,"Notice",string4,"Close","");
pawn Код:
ShowPlayerDialog(playerid, DialogKick, DIALOG_STYLE_MSGBOX,"Notice",string4,"Close","");