2020-12-21, 10:18 PM
Hi, I'm new on scripting and sorry if i can't understand everything well.
So my problem is i have this requestevent codes:
And then more codes for dialogs is this:
this is the whole code for my event system, now i tried to add another dialog so player can write the rules of event but i couldn't make it. can anyone help me to do that?
So my problem is i have this requestevent codes:
Code:
if(strcmp(cmd, "/requestevent", true) == 0 || strcmp(cmd, "/re", true) == 0)
{
if(PINFO[playerid][pLevel]<5)return SEM(playerid, "Your level is too low to organize an event.");
if(IsThereEvent)return SEM(playerid, "There is an event already.");
if(HasWanted(playerid)||IsAtjail(playerid)||InSleep[playerid]==1)return SEM(playerid, "You can't request an event right now.");
ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"Request an Event","Enter the title of event below","Done","Close");
return 1;
}
And then more codes for dialogs is this:
Code:
if(dialogid == 5010)
{
if(!response)return 1;
if(!IsUsingValidHex(inputtext))
{
if(strlen(inputtext)>=21||strlen(inputtext)<=2)return ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"{FF0000}* Enter a title between 3 to 20 characters.\n{A9C4E4}Request an Event","Enter the title of event below","Done","Close");
? ? strcpy(ReqTitle[playerid],inputtext,30);
? ? ShowPlayerDialog(playerid, 5011, DIALOG_STYLE_LIST, "Select the type of event", "Duel\nLast Man Standing\nLast Car Standing\nRace\nProtect the VIP\nDice\nPaintball", "Done", "Back");
}
else
{
if(strlen(inputtext)>=29||strlen(inputtext)<=2)return ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"{FF0000}* Enter a title between 3 to 28 characters.\n{A9C4E4}Request an Event","Enter the title of event below","Done","Close");
? ? strcpy(ReqTitle[playerid],inputtext,30);
? ? ShowPlayerDialog(playerid, 5011, DIALOG_STYLE_LIST, "Select the type of event", "Duel\nLast Man Standing\nLast Car Standing\nRace\nProtect the VIP\nDice\nPaintball", "Done", "Back");
}
}
if(dialogid == 5011)
{
if(!response){ShowPlayerDialog(playerid,5010,DIALOG_STYLE_INPUT,"Request an Event","Enter the title of event below","Done","Close");return 1;}
ReqType[playerid]=listitem;
ShowInteriorList(playerid);
}
if(dialogid == 5012)
{
if(!response){ShowPlayerDialog(playerid, 5011, DIALOG_STYLE_LIST, "Select the type of event", "Duel\nLast Man Standing\nLast Car Standing\nRace\nProtect the VIP\nDice\nPaintball", "Done", "Back");return 1;}
ReqInt[playerid]=listitem;
ShowPlayerDialog(playerid, 5013, DIALOG_STYLE_INPUT, "Request an Event", "Enter the prize of event below", "Done", "Back");
}
if(dialogid == 5013)
{
if(!response){ShowInteriorList(playerid);return 1;}
new val=strval(inputtext);
if(val<10000||val>1000000)return ShowPlayerDialog(playerid, 5013, DIALOG_STYLE_INPUT, "Request an Event", "{FF0000}* Invalid prize entered.\n{A9C4E4}Enter the prize of event below", "Done", "Back");
ReqPrize[playerid]=val;
? ? ShowPlayerDialog(playerid, 5014, DIALOG_STYLE_INPUT, "Request an Event", "Enter minimum level to join your event below", "Done", "Back");
}
if(dialogid == 5014)
{
if(!response){ShowPlayerDialog(playerid, 5013, DIALOG_STYLE_INPUT, "Request an Event", "Enter the prize of event below", "Done", "Back");return 1;}
new val=strval(inputtext);
if(val<1||val>15)return ShowPlayerDialog(playerid, 5014, DIALOG_STYLE_INPUT, "Request an Event", "{FF0000}* Invalid level entered.\n{A9C4E4}Enter minimum level to join your event below", "Done", "Back");
ReqMinLevel[playerid]=val;
ShowPlayerDialog(playerid, 5015, DIALOG_STYLE_INPUT, "Request an Event", "Enter maximum level to join your event below", "Done", "Back");
}
if(dialogid == 5015)
{
if(!response){ShowPlayerDialog(playerid, 5014, DIALOG_STYLE_INPUT, "Request an Event", "Enter minimum level to join your event below", "Done", "Back");return 1;}
new val=strval(inputtext);
if(val<90||val>200)return ShowPlayerDialog(playerid, 5014, DIALOG_STYLE_INPUT, "Request an Event", "{FF0000}* Invalid level entered.\n{A9C4E4}Enter maximum level to join your event below", "Done", "Back");
ReqMaxLevel[playerid]=val;
ShowPlayerDialog(playerid, 5016, DIALOG_STYLE_INPUT, "Request an Event", "If you want have Event-Helper for help you by organizing, enter their ID or part of their name", "Done", "Back");
}
if(dialogid == 5016)
{
if(!response){ShowPlayerDialog(playerid, 5015, DIALOG_STYLE_INPUT, "Request an Event", "Enter maximum level to join your event below", "Done", "Back");return 1;}
new len=strlen(inputtext), target, msg[300];
if(len>=1)// Entered
{
target = ReturnUser6(inputtext);
if(!IsPlayerConnected(target))return ShowPlayerDialog(playerid, 5016, DIALOG_STYLE_INPUT, "{FF0000}* This player isn't connected.\n{A9C4E4}Request an Event", "If you want have Event-Helper for help you by organizing, enter their ID or part of their name", "Done", "Back");
if(target==playerid)return ShowPlayerDialog(playerid, 5016, DIALOG_STYLE_INPUT, "{FF0000}* You can't be event helper.\n{A9C4E4}Request an Event", "If you want have Event-Helper for help you by organizing, enter their ID or part of their name", "Done", "Back");
? if(HasWanted(target)||IsAtjail(target)||AFK[target]!=0)return ShowPlayerDialog(playerid, 5016, DIALOG_STYLE_INPUT, "{FF0000}* You can't select this player as event helper.\n{A9C4E4}Request an Event", "If you want have Event-Helper for help you by organizing, enter their ID or part of their name", "Done", "Back");
ReqHamkar[playerid]=target;
format(msg, sizeof(msg), "Are these informations correct about your event?\n{A9C4E4}Event Title: %s\n{A9C4E4}Event Prize: $%s\n{A9C4E4}Min-Max level: %d-%d\n{A9C4E4}Event Type: %s\n{A9C4E4}Location: %s\n{A9C4E4}Organizer: %s, Helper: %s", ReqTitle[playerid], FormatNumber(ReqPrize[playerid]), ReqMinLevel[playerid], ReqMaxLevel[playerid], GetEventTypeName(ReqType[playerid]), GetEventInteriorName(ReqType[playerid], ReqInt[playerid]), RPName(playerid), RPName(ReqHamkar[playerid]));
ShowPlayerDialog(playerid, 5017, DIALOG_STYLE_MSGBOX, "Request an Event", msg, "Yes", "No");
}
else// Not entered
{
format(msg, sizeof(msg), "Are these informations correct about your event?\n{A9C4E4}Event Title: %s\n{A9C4E4}Event Prize: $%s\n{A9C4E4}Min-Max level: %d-%d\n{A9C4E4}Event Type: %s\n{A9C4E4}Location: %s\n{A9C4E4}Organizer: %s", ReqTitle[playerid], FormatNumber(ReqPrize[playerid]), ReqMinLevel[playerid], ReqMaxLevel[playerid], GetEventTypeName(ReqType[playerid]), GetEventInteriorName(ReqType[playerid], ReqInt[playerid]), RPName(playerid));
ShowPlayerDialog(playerid, 5017, DIALOG_STYLE_MSGBOX, "Request an Event", msg, "Yes", "No");
}
}
if(dialogid == 5018)
if(dialogid == 5018)
{
if(!response)return 1;
if(ReqHamkar[playerid]!=9999&&!IsPlayerConnected(ReqHamkar[playerid])){ReqHamkar[playerid]=9999;}
if(HasWanted(playerid)||IsAtjail(playerid)||AFK[playerid]!=0||IsThereEvent)return SEM(playerid, "You can't request this event right now.");
? ? if(ReqHamkar[playerid]!=9999){if(HasWanted(ReqHamkar[playerid])||IsAtjail(ReqHamkar[playerid])||AFK[ReqHamkar[playerid]]!=0||IsThereEvent)return SEM(playerid, "You can't request this event right now.");}
? ? if(ReqHamkar[playerid]!=9999){SendEventRequest(playerid, ReqTitle[playerid], ReqPrize[playerid], ReqMinLevel[playerid], ReqMaxLevel[playerid], ReqType[playerid], ReqInt[playerid], ReqHamkar[playerid]);}
? ? if(ReqHamkar[playerid]==9999){SendEventRequest(playerid, ReqTitle[playerid], ReqPrize[playerid], ReqMinLevel[playerid], ReqMaxLevel[playerid], ReqType[playerid], ReqInt[playerid], 9999);}
}
this is the whole code for my event system, now i tried to add another dialog so player can write the rules of event but i couldn't make it. can anyone help me to do that?