Need finding a name using DIalog input! mysql!
#1

hi guys i have been trying to make an mdc system

I got one example but it uses diff system

So I want to pretty much translate this to dialog type

Код:
(strcmp(cmd, "/mdc", true) == 0)
	{
	    if(PlayerInfo[playerid][pMember] != 1)
	    {

			SendClientMessage(playerid, COLOR_GREY, "   You must be an LSPD member!");
			return 1;
	    }
		new tmpcar = GetPlayerVehicleID(playerid);
		tmp = strtok(cmdtext, idx);
		if(!strlen(tmp))
		{
            ShowPlayerDialog(playerid,DIALOG_MDC,DIALOG_STYLE_LIST,"Mobile Data Computer","{33FF66}Search User\n{33FF66}Search Plate","Select", "");
		//	SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} /mdc [playerid/PartOfName]");
			return 1;
		}
		giveplayerid = ReturnUser(tmp);
	    GetPlayerName(giveplayerid, sendername, sizeof(sendername));
        GiveNameSpace(sendername);
		if(!IsACopCar(tmpcar) && !IsASheriffCar(tmpcar) && !IsAnFbiCar(tmpcar))
		{
			SendClientMessage(playerid, COLOR_GRAD2, " You are not in a police Vehicle");
			return 1;
		}
	//	ShowPlayerDialog(playerid,DIALOG_MDC,DIALOG_STYLE_LIST,"Mobile Data Computer","{33FF66}Search User\n{33FF66}Search Plate","Select", "");
		SendClientMessage(playerid, TEAM_BLUE_COLOR,"          MOBILE DATA COMPUTER          ");
        GetPlayerName(giveplayerid, sendername, sizeof(sendername));
		format(string, 256, "Name: %s", sendername);
		SendClientMessage(playerid, COLOR_WHITE, string);
		format(string, 256, "Wanted Risk: %d", WantedLevel[giveplayerid]);
		SendClientMessage(playerid, COLOR_WHITE, string);
		if(PlayerInfo[giveplayerid][pHousekey] != 255)
	    {
            format(string, sizeof(string), "   Address: %s ((HouseID: %d))", HouseInfo[PlayerInfo[giveplayerid][pHousekey]][hDiscription], PlayerInfo[giveplayerid][pHousekey]);
	        SendClientMessage(playerid, COLOR_WHITE, string);
	    }
		if(PlayerInfo[giveplayerid][pArrested] > 0)
		{
		    SendClientMessage(playerid, COLOR_WHITE, "Criminal Record: True");
		    format(string, 256, "Crimes Commited: %d", PlayerInfo[giveplayerid][pCrimes]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		    format(string, 256, "Times Arrested: %d", PlayerInfo[giveplayerid][pArrested]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		}else {
		    SendClientMessage(playerid, COLOR_WHITE, "Criminal Record: None");
		}
		if(PlayerInfo[giveplayerid][pWarrant]==1) {
		    format(string, 256, "Warrant Issued: %s", PlayerInfo[giveplayerid][pWarrantReason]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		}
		if(PlayerInfo[giveplayerid][pTicket][0] > 0)
		{
		    format(string, 256, "Unpaid Ticket: $%d | Reason: %s", PlayerInfo[giveplayerid][pTicket][0], PlayerInfo[giveplayerid][pTicketReason0]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		    format(string, 256, "Ticket Issued: %s", PlayerInfo[giveplayerid][pTicketDate0]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		}
		if(PlayerInfo[giveplayerid][pTicket][1] > 0)
		{
		    format(string, 256, "Unpaid Ticket: $%d | Reason: %s", PlayerInfo[giveplayerid][pTicket][1], PlayerInfo[giveplayerid][pTicketReason1]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		    format(string, 256, "Ticket Issued: %s", PlayerInfo[giveplayerid][pTicketDate1]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		}
		if(PlayerInfo[giveplayerid][pTicket][2] > 0)
		{
		    format(string, 256, "Unpaid Ticket: $%d | Reason: %s", PlayerInfo[giveplayerid][pTicket][2], PlayerInfo[giveplayerid][pTicketReason2]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		    format(string, 256, "Ticket Issued: %s", PlayerInfo[giveplayerid][pTicketDate2]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		}
		if(PlayerInfo[giveplayerid][pTicket][3] > 0)
		{
		    format(string, 256, "Unpaid Ticket: $%d | Reason: %s", PlayerInfo[giveplayerid][pTicket][3], PlayerInfo[giveplayerid][pTicketReason3]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		    format(string, 256, "Ticket Issued: %s", PlayerInfo[giveplayerid][pTicketDate3]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		}
		if(PlayerInfo[giveplayerid][pTicket][4] > 0)
		{
		    format(string, 256, "Unpaid Ticket: $%d | Reason: %s", PlayerInfo[giveplayerid][pTicket][4], PlayerInfo[giveplayerid][pTicketReason4]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		    format(string, 256, "Ticket Issued: %s", PlayerInfo[giveplayerid][pTicketDate4]);
		    SendClientMessage(playerid, COLOR_WHITE, string);
		}
		if(PlayerInfo[giveplayerid][pAge] > 0 && GetPlayerSkin(giveplayerid) > 0)
		{
		    format(string, 256, "Age: %d | Clothes: %d", PlayerInfo[giveplayerid][pAge], GetPlayerSkin(giveplayerid));
			SendClientMessage(playerid, COLOR_WHITE, string);
		}
		SendClientMessage(playerid, TEAM_BLUE_COLOR,"_______________________________________");
		return 1;
	}
this shows me everything correctly but i want to transfer this to dialogs like this This does only on SendClientMessage but I want it on Dialogs

> When someone types /mdc -> It shows them dialog with this option "search user"
and When someone clicks Search User, We use DIALOG_STYLE_INPUT for that and put exact name like for example
Jason_Turkey
After they do serch button on Jason Turkey
I want four DIALOG_STYLE_LIST showing them
> personal information
When they click personal information it shows their name/age/gender
> Address
shows the house id/name
> ticket list
The ticket they got

Its all mysql based I tried myself couldn't seem to get it working hope someone helps me!
Reply
#2

damn... plz put code into bbcode [pawn] [/*pawn] ( remove * )
Reply
#3

k I hope its clear now
Reply
#4

Uhhh I'm confused right now.. you want to make a cmd as dialog or you want people writes a /mdc something and dialog pops up?
Reply
#5

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
Uhhh I'm confused right now.. you want to make a cmd as dialog or you want people writes a /mdc something and dialog pops up?
K I'll make clear myself.

> So when someone does the command /mdc
It will make them pop a dialog with one list item that is "Search user"
> When someone selects "search user"
It will make them pop a dialog where it says "Enter the player full_last name"
> So when they typed the name it'd make them pop another dialog with following things
Listitem == 0 -> Personal Information
Listitem == 1 -> Wanted Level
If they happen to choose one of those following

another dialoig would pop up showing the player personal info and wanted level.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)