public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new string[256],
second,
minute,
hour,
day,
month,
year;
if(dialogid == A)
{
if(listitem == 0 && response == 1)// Kick
{
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"Please enter a reason to kick player %s for:",PlayerName(selectedID[playerid]));
ShowPlayerDialog(playerid,214,DIALOG_STYLE_INPUT,"Admin CP - Kick Player",string,"Kick","Close");
}
else ShowPlayerDialog(playerid,80,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Close");
}
else if(listitem == 1 && response == 1)// Ban
{
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"Please enter a reason to ban player %s for:",PlayerName(selectedID[playerid]));
ShowPlayerDialog(playerid,215,DIALOG_STYLE_INPUT,"Admin CP - Ban Player",string,"Ban","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Close");
}
else if(listitem == 2 && response == 1)// Unban IP
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid,216,DIALOG_STYLE_INPUT,"Admin CP - Unban IP","Please enter the IP to unban","Unban","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Close");
}
else if(listitem == 3 && response == 1)//Freeze
{
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"Please enter a reason to freeze player %s for:",PlayerName(selectedID[playerid]));
ShowPlayerDialog(playerid,219,DIALOG_STYLE_INPUT,"Admin CP - Freeze Player",string,"Freeze","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Close");
}
else if(listitem == 4 && response == 1)//Unfreeze
{
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"Please enter a reason to unfreeze player %s for:",PlayerName(selectedID[playerid]));
ShowPlayerDialog(playerid,220,DIALOG_STYLE_INPUT,"Admin CP - Unfreeze Player",string,"Unfreeze","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Close");
}
else if(listitem == 5 && response == 1)//Admin Kill
{
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"Please enter a reason to kill player %s for:",PlayerName(selectedID[playerid]));
ShowPlayerDialog(playerid,221,DIALOG_STYLE_INPUT,"Admin CP - Kill Player",string,"Kill","Cancel");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Close");
}
else if(listitem == 6 && response == 1)//Whois
{
if(IsPlayerAdmin(playerid))
{
new Float:health,
Float:armor;
GetPlayerHealth(playerid,health);
GetPlayerArmour(playerid,armor);
format(string, sizeof(string), "Name: %s\nID: %d\nCash: $%d\nHealth: %0.1f\nArmor: %0.1f\nIP: %s", PlayerName(selectedID[playerid]), selectedID[playerid], GetPlayerMoney(selectedID[playerid]),health,armor,PlayerIp(selectedID[playerid]));
ShowPlayerDialog(playerid,222,DIALOG_STYLE_MSGBOX,"Admin CP - Whois Results",string,"Back","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Close");
}
else if(listitem == 7 && response == 1)//Jail
{
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"Please enter a reason to jail player %s for:",PlayerName(selectedID[playerid]));
ShowPlayerDialog(playerid,223,DIALOG_STYLE_INPUT,"Admin CP - Jail Player",string,"Jail","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Close");
}
else if(listitem == 8 && response == 1)//Unjail
{
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"Please enter a reason to unjail player %s for:",PlayerName(selectedID[playerid]));
ShowPlayerDialog(playerid,224,DIALOG_STYLE_INPUT,"Admin CP - Unjail Player",string,"Unjail","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Close");
}
else if(listitem == 9 && response == 1)//Restart Server
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid,225,DIALOG_STYLE_MSGBOX,"Admin CP - Restart Server","Are you sure you want to restart the server?","Restart","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Close");
}
else if(listitem == 10 && response == 1)//Spectate
{
if(IsPlayerAdmin(playerid))
{
if(IsPlayerConnected(selectedID[playerid]))
{
TogglePlayerSpectating(playerid, 1);
if(IsPlayerInAnyVehicle(selectedID[playerid]))
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(selectedID[playerid]));
else
PlayerSpectatePlayer(playerid, selectedID[playerid]);
SetPlayerInterior(playerid, GetPlayerInterior(selectedID[playerid]));
spectateID[playerid] = selectedID[playerid];
spectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
}
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Cancel");
}
else if(listitem == 11 && response == 1)//Spectate Vehicle
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid,229,DIALOG_STYLE_INPUT,"Admin CP - Spectate Vehicle","Enter the vehicle ID to spectate","Spectate","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Cancel");
}
else if(listitem == 12 && response == 1)//Stop Spectating
{
if(IsPlayerAdmin(playerid))
{
TogglePlayerSpectating(playerid, 0);
spectateID[playerid] = INVALID_PLAYER_ID;
spectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Cancel");
}
else if(listitem == 13 && response == 1)//Go to
{
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"Are you sure you want to teleport to %s?",PlayerName(selectedID[playerid]));
ShowPlayerDialog(playerid,232,DIALOG_STYLE_MSGBOX,"Admin CP - Go to Player",string,"Yes","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Cancel");
}
else if(listitem == 14 && response == 1)//Get
{
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"Are you sure you want to teleport %s to you?",PlayerName(selectedID[playerid]));
ShowPlayerDialog(playerid,233,DIALOG_STYLE_MSGBOX,"Admin CP - Get Player",string,"Yes","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Cancel");
}
else if(listitem == 15 && response == 1)//Give Cash
{
if(IsPlayerAdmin(playerid))
{
format(string,sizeof(string),"Enter the amount you want to give %s.",PlayerName(selectedID[playerid]));
ShowPlayerDialog(playerid,234,DIALOG_STYLE_INPUT,"Admin CP - Give Cash",string,"Set","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Cancel");
}
else if(response == 0)
{
}
else if(listitem == 16 && response == 1)//Repair vehicle
{
if(IsPlayerAdmin(playerid))
{
if(IsPlayerInAnyVehicle(selectedID[playerid]))
{
RepairVehicle(GetPlayerVehicleID(selectedID[playerid]));
format(string,sizeof(string),"Administrator %s has repaired your vehicle.",PlayerName(playerid));
SystemMessage(selectedID[playerid],string);
}
else return SendClientMessage(selectedID[playerid],COLOR_GREY,"The player is not in any vehicle!");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Cancel");
}
else if(response == 0)
{
}
else if(listitem == 17 && response == 1)//Give Weapon
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid,237,DIALOG_STYLE_INPUT,"Admin CP - Give Weapon","Enter the weapons name:","Give","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Cancel");
}
else if(response == 0)
{
}
else if(listitem == 18 && response == 1)//Spawn vehicle
{
if(IsPlayerAdmin(playerid))
{
ShowPlayerDialog(playerid,238,DIALOG_STYLE_INPUT,"Admin CP - Spawn Vehicle","Enter the vehicles name or model ID:","Spawn","Close");
}
else ShowPlayerDialog(playerid,280,DIALOG_STYLE_MSGBOX,"Admin CP - Error!","Insufficient administrator priviledges!","Back","Cancel");
}
else if(response == 0)
{
}
}