07.03.2015, 01:22
Okay so I have a dialog that allows you to change the time and bail of a person in prison except it is not working. I am able to release the person but I am not able to change their bail or time. Anyone got any idea?
PHP код:
case EFactionsDialog_PMDC: {
if(!response)
{
new mdcs[256];
format(mdcs,sizeof(mdcs),"Police MDC System - Logged in: %s",GetPlayerNameEx(playerid, ENameType_RPName_NoMask));
ShowPlayerDialog(playerid, EFactionDialog_MDC, DIALOG_STYLE_LIST, mdcs,"Name Search\nWanted\nSubmit Charges\nPlate Search((Plate))\nPrisoners Database\nRequest Backup\nAnswer Backup\nCancel Backup\nFind Business Address", "Select", "Cancel");
}
else if(response) {
new msg[128];
if(listitem == 0)
{
format(msg, sizeof(msg), "Please type how long %s has left in jail", GetPlayerNameEx(Prisoners[listitem], ENameType_RPName_NoMask));
ShowPlayerDialog(playerid,EFactionDialog_CTime,DIALOG_STYLE_INPUT,"MDC",msg,"Confirm","Go back");
}
else if(listitem == 1)
{
format(msg, sizeof(msg), "Please type how much %s bail should be", GetPlayerNameEx(Prisoners[listitem], ENameType_RPName_NoMask));
ShowPlayerDialog(playerid,EFactionDialog_CBail,DIALOG_STYLE_INPUT,"MDC",msg,"Confirm","Go back");
}
else if(listitem == 2)
{
format(msg, sizeof(msg), "%s has released %s from prison.", GetPlayerNameEx(playerid,ENameType_RPName), GetPlayerNameEx(Prisoners[listitem], ENameType_RPName_NoMask));
SendCopMessage(TEAM_BLUE_COLOR, msg);
releaseFromJail(Prisoners[listitem]);
DeletePVar(Prisoners[listitem], "ReleaseTime");
}
}
}
/*This dialog*/case EFactionDialog_CTime: {
if(response) {
new msg[128];
new time = GetPVarInt(Prisoners[listitem], "ReleaseTime");
new ATime = strval(inputtext);
format(msg, sizeof(msg), "%s has changed %s prison time from %d to %d .", GetPlayerNameEx(playerid,ENameType_RPName), GetPlayerNameEx(Prisoners[listitem], ENameType_RPName_NoMask),time,ATime);
SendCopMessage(TEAM_BLUE_COLOR, msg);
SetPVarInt(Prisoners[listitem], "ReleaseTime", ATime);
}
}
/*and this Dialog*/case EFactionDialog_CBail: {
if(response) {
new msg[128];
new bail = GetPVarInt(Prisoners[listitem], "Bail");
new ATime = strval(inputtext);
format(msg, sizeof(msg), "%s has changed %s bail from %d to %d .", GetPlayerNameEx(playerid,ENameType_RPName), GetPlayerNameEx(Prisoners[listitem], ENameType_RPName_NoMask),bail,ATime);
SendCopMessage(TEAM_BLUE_COLOR, msg);
SetPVarInt(Prisoners[listitem], "Bail", ATime);
}
}