19.12.2015, 16:31
Hello!
You can use inputtext instead of offense. Also you have to take a auxiliary variable to save the player who is reported.
So, it would look like this:
You can use inputtext instead of offense. Also you have to take a auxiliary variable to save the player who is reported.
So, it would look like this:
PHP код:
COMMAND:mdc(playerid, params[])
{
new criminal, string[128];
new Float:X, Float:Y, Float:Z;
GetPlayerPos(criminal, X, Y, Z);
new caption[32], info[256];
format(caption, sizeof(caption), "%s", GetName(criminal));
if(sscanf(params, "u", criminal)) return SendClientMessage(playerid, COLOR_GREY, "[Usage:] /mdc [name].");
if(criminal == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_LIGHTRED, "That player is not connected.");
if(PlayerInfo[playerid][pFaction] != 2) return SCM(playerid, COLOR_LIGHTRED, "You are not a police officer.");
SetPVarInt(playerid,"criminal_value",criminal);
//format(string, sizeof(string),"_______________________________[%s]_______________________________", GetName(criminal));
//SCM(playerid, COLOR_WHITE, string);
if(PlayerInfo[criminal][pActiveOffenses] < 1)
{
format(info, sizeof(info), "Varsta: %d \nNumar Telefon: %d \nAdresa Casa: %d \nAdresa Firma: %d \n__________________\nAceasta persoana nu este cautata.", PlayerInfo[playerid][pAge], PlayerInfo[playerid][pNumber], PlayerInfo[playerid][HouseID], PlayerInfo[playerid][BizID]);
ShowPlayerDialog(playerid, DIALOG_MDC, DIALOG_STYLE_MSGBOX, caption, info, "Adauga", "Inchide");
//SendClientMessage(playerid, COLOR_SJPD, "[SJPD Database:] "COL_WHITE"None.");
}
else
{
format(info, sizeof(info), "Varsta: %d \nNumar Telefon: %d \nAdresa Casa: %d \nAdresa Firma: %d \n__________________\nINFRACTIUNI: \n%s.", PlayerInfo[playerid][pAge], PlayerInfo[playerid][pNumber], PlayerInfo[playerid][HouseID], PlayerInfo[playerid][BizID], PlayerInfo[criminal][pActiveOffense]);
ShowPlayerDialog(playerid, DIALOG_MDC, DIALOG_STYLE_MSGBOX, caption, info, "Adauga", "Inchide");
/*format(string, sizeof(string), "[SJPD Database:] "COL_WHITE"%s", PlayerInfo[criminal][pActiveOffense]);
SCM(playerid, COLOR_SJPD, string);*/
}
return 1;
}
case DIALOG_SUSPECT:
{
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_SUSPECT, DIALOG_STYLE_INPUT, "Police Database","Ai introdus o infractiune gresita.\n""Introduceti infractiunea,","Enter","Cancel");
new criminal = GetPVarInt(playerid,"criminal_value"), string[128];
format(string, sizeof(string), "[LSPD:] %s has reported %s as a suspect, offense: %s", GetName(playerid), GetName(criminal), inputtext);
format(PlayerInfo[playerid][pActiveOffense], 46, string);
PoliceBroadcast(COLOR_SJPD,string,1);
//PlayerInfo[criminal][pActiveOffense] = offense;
PlayerInfo[criminal][pActiveOffenses] += 1;
}
}