Paying for this to be done
#1

ok i want a thing made so i say /setnotice WRITINGGOESHERE and then it saves to a .cfg file in my scriptfiles and when a player connects it check if the notice is set then shows it up in a dialog on there screen and they have a button to dismiss it but if i dont want the box to show i type /setnotice 0 and then it doesnt show when a player conencts please help
Reply
#2

If you know how you want to save it, just do like:

pawn Код:
new startnote[126];

//do a command just like normally then set this function in there.
new writethisnow[126];//sscanf or something to detect and save what the player writes after the command part.
format(startnote, sizeof(startnote), "%s", writethisnow);

//and on player connect just use
if(strval(startnote) != 0){
ShowPlayerDialog(playerid, 18273, DIALOG_STYLE_MSGBOX, "Important notice", startnote, "Dissmiss", "");
}
Hope it helped
Reply
#3

thats a start but can you please do a step by step tut on it im confused already haha
Reply
#4

I'll try xD:

pawn Код:
new startnote[126];//start with doing a global variable to store the string you want the players to get when logged in.

//do a command just like normally then set this function in there.
YCMD:setloginmessage(playerid, params[], help){
    new message[126];//sscanf or something to detect and save what the player writes after the command part.
    if (help)return SendClientMessage(playerid, COLOR_HELP, "Use this command to set the login message");//this is just a thing you are using in YCMD, if you are not using YCMD skip this.
    if(sscanf(params, "s[126]", message))return SendClientMessage(playerid, COLOR_ERROR, "Usage: /setloginmessage [text] (0 if you don't want any login message)");//this is used to get the thing that the player typed after /setloginmessage
    format(startnote, sizeof(startnote), "%s", message);//here you just set the local variable to the same as the one you typed
    SendClientMessage(playerid, -1, "You have changed the login message to:");//only used to send a message that they have succeded made the command
    SendClientMessage(playerid, -1, startnotice);//this will send them the current login message

//and on player connect just use
if(strval(startnote) != 0){
ShowPlayerDialog(playerid, 18273, DIALOG_STYLE_MSGBOX, "Important notice", startnote, "Dissmiss", "");
}
Hope you understans taht a little better :S
Reply
#5

still confusing the shit out of me haha im using ZCMD can you basically make the hole thing for me <3?
Reply
#6

anyone
Reply
#7

What file saving system are you using?
Reply
#8

im actually not sure but heres a ling of code

pawn Код:
File: fHandle = fopen("houses.cfg", io_write);
Reply
#9

I suggest that you use a file saving system like y_ini, but whatever.
I'm gonna try and create this for you.
Reply
#10

Quote:
Originally Posted by NinjaChicken
Посмотреть сообщение
im actually not sure but heres a ling of code

pawn Код:
File: fHandle = fopen("houses.cfg", io_write);
"Houses.cfg? I guess a file called Users.ini
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)