dialog input
#2

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:
PHP код:
COMMAND:mdc(playeridparams[])
{
    new 
criminalstring[128];
    new 
Float:XFloat:YFloat:Z;
    
GetPlayerPos(criminalXYZ);
    new 
caption[32], info[256];
    
format(captionsizeof(caption), "%s"GetName(criminal));
    if(
sscanf(params"u"criminal)) return SendClientMessage(playeridCOLOR_GREY"[Usage:] /mdc [name].");
    if(
criminal == INVALID_PLAYER_ID) return SendClientMessage(playeridCOLOR_LIGHTRED"That player is not connected.");
    if(
PlayerInfo[playerid][pFaction] != 2) return SCM(playeridCOLOR_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(infosizeof(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(playeridDIALOG_MDCDIALOG_STYLE_MSGBOXcaptioninfo"Adauga""Inchide");
        
//SendClientMessage(playerid, COLOR_SJPD, "[SJPD Database:] "COL_WHITE"None.");
    
}
    else
    {
        
format(infosizeof(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(playeridDIALOG_MDCDIALOG_STYLE_MSGBOXcaptioninfo"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(playeridDIALOG_SUSPECTDIALOG_STYLE_INPUT"Police Database","Ai introdus o infractiune gresita.\n""Introduceti infractiunea,","Enter","Cancel");
           new 
criminal GetPVarInt(playerid,"criminal_value"), string[128];
        
format(stringsizeof(string), "[LSPD:] %s has reported %s as a suspect, offense: %s"GetName(playerid), GetName(criminal), inputtext);
        
format(PlayerInfo[playerid][pActiveOffense], 46string);
        
PoliceBroadcast(COLOR_SJPD,string,1);
        
//PlayerInfo[criminal][pActiveOffense] = offense;
        
PlayerInfo[criminal][pActiveOffenses] += 1;
    }

Reply


Messages In This Thread
dialog input - by AndreiWow - 19.12.2015, 12:20
Re: dialog input - by Mencent - 19.12.2015, 16:31

Forum Jump:


Users browsing this thread: 1 Guest(s)